RAG Sources Overview
RAG (Retrieval-Augmented Generation) enrichment connects your agents to external knowledge bases. Before each LLM call, TARX queries your vector databases, retrieves the most semantically relevant text chunks, and injects them as context.
This turns your agents from "what the LLM was trained on" into "what the LLM was trained on plus your curated knowledge."
The Problem RAG Solves
LLMs have training data cutoffs and don't know about your internal:
- Product documentation
- Company policies
- Internal processes
- Domain-specific knowledge bases
- Research papers specific to your field
Without RAG, agents answer these questions from generic training — often wrong, always generic.
With RAG, agents retrieve the actual relevant sections from your indexed knowledge and answer with specificity and accuracy.
How Retrieval Works
- The agent's input text is embedded into a 1536-dimension vector
- The vector is compared against all indexed content using cosine similarity
- The top-K most similar chunks are returned
- Those chunks are prepended to the LLM's system prompt
- The LLM answers using both its training knowledge and the retrieved context
What RAG Sources Are
A RAG Source in TARX is a configuration object that tells TARX:
- Which vector database to query
- How to authenticate
- Which index/collection/namespace to use
- How to interpret the results
You create RAG sources in the RAG Sources section of your project, then assign them to agents in the Agent Editor.
Supported Providers
| Provider | Type | Notes |
|---|---|---|
| Azure AI Search | Cloud | Native Azure integration, recommended for Azure deployments |
| Pinecone | Cloud | Popular vector DB, serverless tier available, easy setup |
| Weaviate | Cloud or self-hosted | Open-source, strong filtering support |
| Qdrant | Cloud or self-hosted | Open-source, efficient for large indexes |
| Supabase Vector | Cloud | PostgreSQL-based (pgvector), great if you already use Supabase |
| Custom REST | Any | Any vector DB with a REST search API |
See Providers for detailed configuration for each.
Embedding Strategy
TARX provides free embeddings for RAG. You don't pay per query:
| Property | Value |
|---|---|
| Model | text-embedding-3-small (OpenAI) |
| Dimensions | 1536 |
| Index type | HNSW (Hierarchical Navigable Small World) |
| Search | Semantic similarity (cosine distance) |
| Cost to you | Free — TARX covers embedding API cost |
You don't need an OpenAI key for RAG. TARX covers the embedding API cost.
Data Flow for RAG
Document Indexing
TARX does not index your documents for you. You maintain your own vector database and TARX queries it. Your indexing pipeline is separate:
- Ingest documents (your own pipeline or vector DB tooling)
- Chunk them (typically 200-500 token chunks with 50-token overlap)
- Embed them (using
text-embedding-3-smallfor best compatibility with TARX) - Store in your vector DB with metadata (source URL, title, date, etc.)
- Configure the RAG source in TARX to query your indexed collection
You own the indexing pipeline — TARX connects to your already-populated vector store and queries it at runtime. Use your vector DB provider's own SDK or tooling to ingest and embed your documents.
Multiple RAG Sources per Agent
An agent can have multiple RAG sources. TARX queries all of them in parallel:
Agent: customer-support
RAG Sources:
- product-docs (Pinecone, top_k=3)
- company-policies (Azure AI Search, top_k=2)
- faq-database (Weaviate, top_k=3)
Before each LLM call, all 3 sources are queried simultaneously. The top-k results from each are combined and injected as context. Total chunks: up to 3+2+3 = 8 chunks.
RAG Source Scoping
RAG sources are project-scoped:
- Visible to all project members with appropriate roles
- Shareable across agents within the same project
- Not visible to other projects
Next Steps
- Adding a RAG Source — Step-by-step setup
- Providers — Detailed config for Azure AI Search, Pinecone, Weaviate, etc.
- Embedding Strategy — How TARX embeds your queries
- Testing RAG — Verifying your connection and troubleshooting