Retrieval-Augmented Generation (RAG)

Updated:


February 13, 2026

Last updated: October 2026

This page explains how to implement a RAG pipeline using Unified.to.

RAG is an implementation pattern built on top of Unified.to's APIs. Unified.to reads records from the source at request time, returns them in one data model per category, and delivers change events as webhooks on supported integrations. You are responsible for embeddings, vector storage and retrieval.

At a high level, RAG with Unified.to follows this sequence:

  1. Subscribe to webhooks.
  2. Receive created or updated objects.
  3. Retrieve full content from the source API.
  4. Chunk the content.
  5. Generate embeddings.
  6. Store embeddings in your vector database.
  7. On query, retrieve relevant chunks and generate a response.

The pattern is the same across categories.

What RAG Means in Practice

RAG allows you to answer questions using customer data from connected SaaS platforms.

Instead of relying only on model training data, your application:

  • Retrieves relevant customer records.
  • Supplies those records as context.
  • Generates a response grounded in that context.

Unified.to reads records directly from the source APIs at request time and sends change events on supported integrations. Records come back:

  • In the same fields, whichever provider they come from.
  • As the source holds them at the moment of the request.

Unified.to does not store embeddings or maintain a vector index.

Step 1: Connect Data Sources

Authorize integrations using Embedded Auth.

Common RAG source categories include:

  • File Storage
  • Knowledge Management
  • CRM
  • Ticketing
  • ATS
  • Messaging

Each authorized integration returns a connection_id.

RAG pipelines should treat connection_id as the tenant boundary.

Step 2: Subscribe to Object Updates

Create webhook subscriptions for the objects you want to index.

Backfill on first subscription

Set include_all: true when creating the webhook subscription. This delivers all existing records to your endpoint before transitioning to incremental updates. Pages are delivered with type: INITIAL-PARTIAL; the final page is tagged type: INITIAL-COMPLETE. After that, the same subscription delivers ongoing changes tagged NATIVE or VIRTUAL depending on whether the source integration supports native webhooks.

Your endpoint receives the same payload structure for backfill and incremental updates, so no separate backfill handler is required.

On created or updated events:

  • Your endpoint receives the event.
  • You call the appropriate retrieve endpoint to fetch the latest version of the object.
  • If the object contains a download_url, fetch the content from that URL.

List endpoints often return metadata but not full content. For RAG, you must explicitly retrieve full text before chunking.

Native webhooks forward the vendor's events. Virtual webhooks use the same payload and detect changes at an interval you set, as often as every minute on paid plans.

Webhooks are recommended over polling for RAG ingestion.

Step 3: Chunk and Embed

Large text (files, pages, tickets, resumes, notes, transcripts) should be split into chunks before embedding.

Each chunk should include stable metadata such as:

  • connection_id — tenant boundary; required for all retrieval filters
  • object_type — e.g. crm_deal, ats_candidate, ticketing_ticket
  • object_id — source record ID; used to target re-embedding on update
  • updated_at — timestamp of the source record's last update
  • is_latest — boolean flag indicating whether this chunk is current; set to false when a record updates and new chunks are inserted. This field is not returned by Unified.to; you maintain it in your vector store schema.

You may also include other returned fields as metadata filters.

Unified.to returns each object in the same fields whichever provider it comes from, so any field it returns can be stored as metadata in your vector index and used for filtering at retrieval time.

You generate embeddings using the embedding model of your choice. Unified.to's Generative AI API can create embeddings on supported integrations, but embeddings and indexes are stored in your infrastructure.

Step 4: Store in a Vector Database

Store embeddings in your vector database (for example, Pinecone or pgvector).

Include metadata to support:

  • Tenant isolation (connection_id)
  • Object filtering (object_type)
  • Update replacement (updated_at)
  • Permission enforcement (see below)

Unified.to does not:

- Cache end-customer payloads
- Store embeddings
- Maintain a vector index

Step 5: Retrieve and Generate

When a user submits a query:

  1. Embed the query.
  2. Retrieve the top matching chunks from your vector database.
  3. Filter by connection_id and any relevant metadata.
  4. Pass retrieved context to your model.
  5. Return the generated answer.

If required, include citations that map back to object_id or web_url.

Unified.to does not perform retrieval. It delivers change events; your application re-embeds and replaces vectors to keep the index in step with the source.

Permissions

File objects include explicit permissions metadata.

Other objects (CRM, ATS, ticketing, messaging) do not return user- or group-level permission structures. If row-level enforcement is required, implement that logic in your application layer before returning retrieved results

Always filter retrieval results by tenant and permission constraints before generation.

How current is the index?

For RAG pipelines, how current the index is depends on how changes reach you:

  • Native webhooks forward the vendor's events.
  • Virtual webhooks detect changes at an interval you set, as often as every minute on paid plans.
  • Most list endpoints support pagination and incremental filtering via updated_gte

To keep embeddings current:

  • Re-fetch objects on update events.
  • Re-chunk and re-embed.
  • Replace outdated vectors in your index.

When to Use RAG

Use this pattern when you need to:

  • Build enterprise search across connected platforms.
  • Ground AI responses in customer documents or records.
  • Enable resume or candidate search.
  • Support contract or document Q&A.
  • Build account-level CRM assistants.

The ingestion architecture is consistent across categories. Object models and content retrieval methods vary by API.

RAG pipelines commonly use:

Refer to category documentation for supported objects and webhook availability.

→ Start your 30-day free trial

→ Book a demo

Share
All guidesAccounting Account Type Hierarchy in UnifiedAdvertising Report Metrics by IntegrationAmazon S3: Required IAM PermissionsATS to Vector DB: How to Power Talent Intelligence with Real-Time DataBuilding AI applications with Unified and LangbaseConcur & Concur (Company) — Connection GuideConfigure Greenhouse Native Candidate WebhooksConfigure Salesforce Meetings and Notes for UnifiedConnect Amazon Seller Central to Unified.toConnecting BambooHR via OAuth 2Connecting Google Workspace Integrations with a Service AccountCorrect WelcomeKit Scopes for Jungle IntegrationCreating Ads using the Unified Ads APICreating Walmart Items via UnifiedEnd-Users, Integrations, and ConnectionsEnriching Unified Objects with Custom MetadataEnterprise-managed authorization (EMA) with a static keyEnterprise-managed authorization (EMA) with a workspace secretEnterprise-managed authorization (EMA) with Microsoft Entra IDExtended observability — pushing API logs to ClickHouseExtended observability — pushing API logs to Grafana / LokiExtended Observability - Pushing API Logs to your Datadog InstanceFacebook Messenger Webhook SetupFireflies Integration GuideGetting started with WorkableHandling Delegated vs. Application Scopes in Microsoft IntegrationsHiBob & Unified: connection and time off guideHow long are logs retainedHow to access employees and usersHow to add API support for the Create Activity in CrelateHow to Associate a Connection ID with Your End-UserHow to build a Candidate Assessment product withHow to build a candidate sourcing or job board app with Unified.toHow to build a Discord support bot with Unified.to and LangbaseHow to Build a Fintech Application with Unified's Payments APIHow to Build an E-Commerce Product Integration with UnifiedHow to build an invoicing system with Unified.toHow to build Enterprise Search using RAGHow to configure Bullhorn Redirect URI for creating a connectionHow to configure webhooks in HubSpotHow to configure webhooks in Thrive LearningHow to configure webhooks in Toast for UnifiedHow to Connect Anthropic to Real-Time SaaS Data with Unified.to MCP ServerHow to Connect Cohere to Real-Time SaaS Data with Unified.to MCP ServerHow to Connect Google Gemini to Real-Time SaaS Data with Unified.to MCP ServerHow to connect HiBob (Bob) to Unified with OAuth 2.0How to Connect LLMs to Real-Time SaaS Data with Unified.to MCP ServerHow to Connect OpenAI to Real-Time SaaS Data with Unified.to MCP ServerHow to Connect Zoom and Zoom PhoneHow to create a Connection In Microsoft TeamsHow to create a token-based connection in HighlevelHow to Create a Unified.to Connection to HighLevelHow to Create a Xero Connection in Unified.toHow to create and configure webhooksHow to create Connection with HubspotHow to customize portal URLs for Stripe and GoCardlessHow to filter webhook eventsHow-to Get a Private Support Channel for Your Unified IntegrationHow to get help fromHow to get your 8x8 Connect API Key, Account ID and SMS Subaccount ID (optional): Step-by-step guideHow to get your ADP Workforce Now Oauth2 client ID, Oauth2 client secret, Oauth2 PEM certificate and Oauth2 private key: Step-by-step guideHow to get your Amazon S3 AWS Region, AWS S3 Key, AWS S3 Secret and AWS S3 Bucket(s) (optional, comma-separated): Step-by-step guideHow to get your Ashby API Key: Step-by-step guideHow to get your Brex API token: Step-by-step guideHow to get your Bullhorn OAuth2 Client ID, OAuth2 Client Secret, API Username and API Password: Step-by-step guideHow to get your Ceridian Dayforce Username, Password and Client Namespace: Step-by-step guideHow to get your Crelate API key: Step-by-step guideHow to get your Dashlane API Key: Step-by-step guideHow to get your Deel Access Token: Step-by-step guideHow to get your Dialpad API Key: Step-by-step guideHow to get your Discord OAuth 2 credentials and bot tokenHow to get your ELMO client ID and client secret: Step-by-step guideHow to get your Gainsight Client ID, Client Secret and Gainsight API Domain: Step-by-step guideHow to get your Greenhouse API Key and Job board token: Step-by-step guideHow to get your Helpscout API Key: Step-by-step guideHow to get your HiBob Service User ID and Service User Token: Step-by-step guideHow to get your HighLevel API Key and Location ID: Step-by-step guideHow to get your HubSpot developer key and OAuth 2 credentials (Legacy Apps)How to get your Humaans API Key: Step-by-step guideHow to get your iCIMS API Username, API Password and Customer ID: Step-by-step guideHow to get your JobDiva Client ID, Username/email and Password: Step-by-step guideHow to get your Jobvite API Key, API Key Secret and Email: Step-by-step guideHow to get your Lever API Key: Step-by-step guideHow to get your Loxo Agency slug, API Key and Agency ID: Step-by-step guideHow to get your Microsoft Active Directory / Entra ID Client ID, Client Secret and Tenant ID: Step-by-step guideHow to get your Microsoft Azure AD OAuth 2 credentialsHow to get your OAuth 2 credentials for GmailHow to get your OAuth 2 credentials for Microsoft Dynamics 365How to get your OAuth 2 credentials in PipeDriveHow to get your OpenAI API Key: Step-by-step guideHow to get your Paycom SID/Username and Token/Password: Step-by-step guideHow to get your PCRecruiter Username, Password, Database ID, App Key and App ID: Step-by-step guideHow to get your SAP SuccessFactors (OpenID Connect) Username, Password, Client ID, Client Secret, Dependency Name, IAS Host and API URL: Step-by-step guideHow to get your SAP SuccessFactors Username, Company ID, Password and API URL: Step-by-step guideHow to get your Shopify Admin API access token and Store ID: Step-by-step guideHow to get your Wayfair Client ID, Client Secret and Vendor Encrypted Key: Step-by-step guideHow to get your Workable API Token and Subdomain: Step-by-step guideHow to get your yotpo APP Key / Store ID and Secret Key: Step-by-step guideHow to Handle Attachments in Invoice, Bill and Credit MemoHow to Manage Google Ad Manager Orders, Line Items and Creatives with theHow to migrate or import your integrations into Unified.toHow to obtain your GitHub OAuth2 credentialsHow to Power Claude with Live Customer Data Using Unified MCPHow to receive assessment orders from an ATS with Unified.toHow to register a Google developer app and get OAuth 2 credentialsHow to Register a HiBob Developer App and Get OAUTH2 CredentialsHow to register a Salesforce developer app and get OAuth 2 credentialsHow to register a Slack developer account and get OAuth 2 credentialsHow to Register a Workday Developer App and Get OAUTH2 CredentialsHow to Register a Workday Developer App and Get OAUTH2/ SOAP CredentialsHow to Register a ZendeskSell Developer App and Get OAUTH2 CredentialsHow to Register a Zoho Developer App and Get OAUTH2 CredentialsHow to Register an ADP Developer App and Get OAUTH2 CredentialsHow to Register an Atlassian Developer App and Get OAUTH2 CredentialsHow to Register your Facebook OAuth2 ApplicationHow to Register your Google Ads OAuth2 ApplicationHow to Register your MetaAds OAuth2 applicationHow To Request & Write Raw Integration DataHow to Retrieve Microsoft Dynamics 365 Business Central CredentialsHow to set up a custom API URL with a CNAMEHow to Set Up a Google Meet Meeting Bot with UnifiedHow to set up a HiBob marketplace installHow to Set Up a Microsoft Teams Bot with UnifiedHow to Set Up a Microsoft Teams Meeting Bot with UnifiedHow to Set Up a Webex Meeting Bot with UnifiedHow to Set Up a Zoom Meeting Bot with UnifiedHow to set up and configure NotionHow to set up Google Business Profile API access and get OAuth 2 credentialsHow to Set Up LinkedIn Webhooks with UnifiedHow to set up native webhooks for QuickBooks Online with UnifiedHow to set up Slack webhooks using event subscriptionsHow to set up Telegram (bot) with Unified.toHow to set up your scopes in HubSpotHow to setup a Freshbooks developer appHow to setup a TikTok Shop applicationHow to Setup AWS Assume Role for AWS Secret ManagerHow to setup Oracle JD EdwardsHow to Setup Quickbooks DesktopHow to setup Sage 100 with Unified.toHow to test webhooks in the Synthetic Data (Sandbox) environmentHow to troubleshoot unhealthy connectionsHow to troubleshoot unhealthy webhooksHow to Use Decision Models with the Unified GenAI APIHow to use SCIM with the Unified APIHow to use the Passthrough APIHow to Use Unified.to's Generative AI API with OpenAI and ClaudeHow to use User Provisioning and Verification with UnifiedHow virtual webhook retry and recovery worksIntegration set-up guide for LeverManaging custom validation rules in SalesforceNetSuite Authentication Setup for UnifiedNotice of Deprecation of Fields and Objects (Nov 2025)Oracle HCM / Taleo OAuth Credentials GuideSalesForce (External Client Apps) on Multiple OrganizationsSAML Single-Sign-OnScaling MCP Tools with Anthropic's (& OpenAI's) Defer LoadingScaling MCP Tools with Anthropic's Programmatic Tool CallingSet Environments for your Unified.to WorkspaceSetting up a Slack Bot Connection with Unified.toSetting up OAuth 2 Credentials for Greenhouse's APIsTrello Connection Guide in UnifiedUnderstanding OAuth2 Authorization flowsUnderstanding Response Time Headers in the Unified APIUnified Assessment API: Embed Assessments Inside ATS PlatformsUnified's MCP ServerUnified MCP Server with LangChain and LangGraphUnlock real-time data with virtual webhooksUse Unified to sign in your users into your applicationVincere OAuth Setup Guide for UnifiedWhy you can't use Unified's OAuth2 credentials to authorize your end users on ProductionWorkable: Creating candidates and attaching them to jobsWorkday vs Workday Legacy — Why Unified.to Supports BothWorking with hierarchical tree data in Storage, Messaging, and KMS APIs
Are we missing anything? Let us know
Was this page helpful?