{"id":22793295,"url":"https://github.com/fivetran/dbt_unified_rag","last_synced_at":"2025-07-17T02:04:09.046Z","repository":{"id":259058211,"uuid":"861770110","full_name":"fivetran/dbt_unified_rag","owner":"fivetran","description":"Fivetran dbt package designed to generate an end model and Cortex Search Service (for Snowflake destinations only) which contains unstructured document data to be used for Retrieval Augmented Generation (RAG) applications leveraging Large Language Models (LLMs)","archived":false,"fork":false,"pushed_at":"2025-06-26T04:52:48.000Z","size":1585,"stargazers_count":5,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T05:31:12.538Z","etag":null,"topics":["hubspot","jira","llm","rag","zendesk"],"latest_commit_sha":null,"homepage":"https://fivetran.github.io/dbt_unified_rag/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivetran.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-23T13:39:58.000Z","updated_at":"2025-04-18T14:00:00.000Z","dependencies_parsed_at":"2025-04-16T19:13:41.306Z","dependency_job_id":"6c4a59d4-d592-49e2-a0e4-5b6d42a405b6","html_url":"https://github.com/fivetran/dbt_unified_rag","commit_stats":null,"previous_names":["fivetran/dbt_unified_rag"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/fivetran/dbt_unified_rag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_unified_rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_unified_rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_unified_rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_unified_rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/dbt_unified_rag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_unified_rag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265559820,"owners_count":23788068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hubspot","jira","llm","rag","zendesk"],"created_at":"2024-12-12T03:19:05.301Z","updated_at":"2025-07-17T02:04:09.040Z","avatar_url":"https://github.com/fivetran.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unified RAG dbt Package ([Docs](https://fivetran.github.io/dbt_unified_rag/))\n\n\u003cp align=\"left\"\u003e\n    \u003ca alt=\"License\"\n        href=\"https://github.com/fivetran/dbt_unified_rag/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"dbt-core\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/dbt_Core™_version-\u003e=1.3.0_\u003c2.0.0-orange.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"Maintained?\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"PRs\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributions-welcome-blueviolet\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What does this dbt package do?\n\n\u003c!--section=\"unified_rag_transformation_model\"--\u003e\nThe main focus of this dbt package is to generate an end model that contains the below relevant unstructured document data to be used for Retrieval Augmented Generation (RAG) applications leveraging Large Language Models (LLMs):\n- [HubSpot](https://fivetran.com/docs/connectors/applications/hubspot): Deals\n- [Jira](https://fivetran.com/docs/connectors/applications/jira): Issues\n- [Zendesk](https://fivetran.com/docs/connectors/applications/zendesk): Tickets  \n\nThe following table provides a detailed list of all models materialized within this package by default. \n\u003e TIP: See more details about these models in the package's [dbt docs site](https://fivetran.github.io/dbt_unified_rag/#!/overview).\n\n| **Table**                 | **Description**                                                                                                    |\n| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |\n| [rag__unified_document](https://fivetran.github.io/dbt_unified_rag/#!/model/model.unified_rag.rag__unified_document)  | Each record represents a chunk of text prepared for semantic-search and additional fields for use in LLM workflows.   |\n\n### Materialized Models\n\nEach Quickstart transformation job run materializes the following model counts for each selected connector. The total model count represents all staging, intermediate, and final models, materialized as `view`, `table`, or `incremental`:\n\n| **Connector** | **Model Count** |\n| ------------- | --------------- |\n| HubSpot | 21 |\n| Jira | 11 |\n| Zendesk | 7 |\n| (Combined) | 1 |\n\n\u003c!--section-end--\u003e\n\n## How do I use the dbt package?\n\n### Step 1: Prerequisites\nTo use this dbt package, you must have the following:\n\n- At least one of the below support Fivetran connections syncing data into your destination.\n    - [HubSpot](https://fivetran.com/docs/connectors/applications/hubspot) (specifically deals)\n    - [Jira](https://fivetran.com/docs/connectors/applications/jira)\n    - [Zendesk Support](https://fivetran.com/docs/connectors/applications/zendesk)\n- A **Snowflake**, **BigQuery**, **Databricks**, or **PostgreSQL** destination.\n    - Redshift destinations are not currently supported due to the stringent character limitations within string datatypes. If you would like Redshift destinations to be supported, please comment within our logged [Feature Request](https://github.com/fivetran/dbt_unified_rag/issues/3).\n\n### Step 2: Install the package\nInclude the following package_display_name package version in your `packages.yml` file:\n\u003e TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.\n```yml\npackages:\n  - package: fivetran/unified_rag\n    version: 0.1.0-a8\n```\n\n### Step 3: Define database and schema variables\n#### Single connection\nBy default, this package looks for your HubSpot, Jira, and/or Zendesk data in your target database. If this is not where your data is stored, add the relevant `\u003cconnection\u003e_database` variables to your `dbt_project.yml` file (see below).\n\n```yml\n# dbt_project.yml\n\nvars:\n    rag_hubspot_schema: hubspot\n    rag_hubspot_database: your_database_name\n\n    rag_jira_schema: jira\n    rag_jira_database: your_database_name\n\n    rag_zendesk_schema: zendesk\n    rag_zendesk_database: your_database_name\n```\n#### Union multiple connections\nIf you have multiple supported connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the source_relation column of each model. To use this functionality, you will need to set either the `\u003cpackage_name\u003e_union_schemas` OR `\u003cpackage_name\u003e_union_databases` variables (cannot do both) in your root `dbt_project.yml` file. Below are the variables and examples for each connector:\n\n```yml\n# dbt_project.yml\n\nvars:\n    rag_hubspot_union_schemas: ['hubspot_rag_test_one', 'hubspot_rag_test_two']\n    rag_hubspot_union_databases: ['hubspot_rag_test_one', 'hubspot_rag_test_two']\n\n    rag_jira_union_schemas: ['jira_rag_test_one', 'jira_rag_test_two']\n    rag_jira_union_databases: ['jira_rag_test_one', 'jira_rag_test_two']\n\n    rag_zendesk_union_schemas: ['zendesk_rag_test_one', 'zendesk_rag_test_two']\n    rag_zendesk_union_databases: ['zendesk_rag_test_one', 'zendesk_rag_test_two']\n```\n\nThe native `source.yml` connection set up in the package will not function when the union schema/database feature is utilized. Although the data will be correctly combined, you will not observe the sources linked to the package models in the Directed Acyclic Graph (DAG). This happens because the package includes only one defined `source.yml`.\n\nTo connect your multiple schema/database sources to the package models, follow the steps outlined in the [Union Data Defined Sources Configuration](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source) section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG.\n\n### Step 4: Enabling/Disabling Models\nThis package takes into consideration that not every account will have leverage every supported connector type. If you do not leverage all of the supported connector types, you are able to disable the respective dependent models using the below variables in your `dbt_project.yml`.\n\n```yml\nvars:\n    rag__using_hubspot: False # by default this is assumed to be True\n    rag__using_jira: False # by default this is assumed to be True\n    rag__using_zendesk: False # by default this is assumed to be True\n```\n\n### (Optional) Step 5: Additional configurations\n#### Customizing Chunk Size for Vectorization\nThe `rag__unified_document` and upstream platform specific `*__document` models were developed to limit approximate chunk sizes to 5,000 tokens, optimized for OpenAI models. However, you can adjust this limit by setting the max_tokens variable in your `dbt_project.yml`:\n```yml\nvars:\n    document_max_tokens: 5000 # Default value\n```\n\n#### Changing the Build Schema\nBy default this package will build the Unified RAG staging models within a schema titled (\u003ctarget_schema\u003e + `_unified_rag_source`) and the Unified RAG final models within a schema titled (\u003ctarget_schema\u003e + `_unified_rag`) in your target database. If this is not where you want your modeled Unified RAG data to be written to, add the following configuration to your `dbt_project.yml` file:\n\n```yml\nmodels:\n    unified_rag:\n        +schema: my_new_schema_name # leave blank for just the target_schema\n        staging:\n            +schema: my_new_schema_name # leave blank for just the target_schema\n```\n\n#### Change the source table references\nIf an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:\n\n\u003e IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_unified_rag/blob/main/dbt_project.yml) variable declarations to see the expected names.\n\n```yml\n# dbt_project.yml\n\nvars:\n    rag_\u003cdefault_source_table_name\u003e_identifier: your_table_name \n```\n\u003c/details\u003e\n\n\n### (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™\n\u003cdetails\u003e\u003csummary\u003eExpand for details\u003c/summary\u003e\n\u003cbr\u003e\n    \nFivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide).\n\u003c/details\u003e\n\n\n## Does this package have dependencies?\nThis dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.\n\u003e IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.\n    \n```yml\npackages:\n    - package: fivetran/fivetran_utils\n      version: [\"\u003e=0.4.0\", \"\u003c0.5.0\"]\n\n    - package: dbt-labs/dbt_utils\n      version: [\"\u003e=1.0.0\", \"\u003c2.0.0\"]\n```\n## How is this package maintained and can I contribute?\n### Package Maintenance\nThe Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/dbt_unified_rag/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_unified_rag/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.\n\n### Contributions\nA small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.\n\nWe highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package.\n\n## Are there any resources available?\n- If you have questions or want to reach out for help, refer to the [GitHub Issue](https://github.com/fivetran/dbt_unified_rag/issues/new/choose) section to find the right avenue of support for you.\n- If you want to provide feedback to the dbt package team at Fivetran or want to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_unified_rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Fdbt_unified_rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_unified_rag/lists"}