#how to configure ai agent to use custom RAG?
1 messages · Page 1 of 1 (latest)
AI-generated Answer for waterfallbay
Here’s how to configure an ElevenLabs agent to use RAG over your own knowledge base (your “custom RAG”):
Dashboard (no code)
- Add your sources: In the agent’s Knowledge Base, upload files or add URLs. Documents will be indexed automatically once RAG is enabled. (elevenlabs.io)
- Enable RAG: In Agent settings → Knowledge Base, toggle Use RAG. (elevenlabs.io)
- Optional tuning: In Advanced, set Embedding model, Maximum document chunks, and Maximum vector distance. (elevenlabs.io)
- Document usage mode: For each document choose Auto (retrieved when relevant) or Prompt (always in system prompt). Use Prompt sparingly to avoid context bloat. (elevenlabs.io)
- Notes/limits: Indexing may take a few minutes; documents <500 bytes can’t be RAG‑indexed; total indexed size is capped per plan; RAG adds ~500 ms latency. (elevenlabs.io)
API (configure programmatically)
- Create knowledge base items
- From URL: POST /v1/convai/knowledge-base/url
- From file: POST /v1/convai/knowledge-base/file (elevenlabs.io)
- Build the RAG index for each document
- POST /v1/convai/knowledge-base/:documentation_id/rag-index with model set to e5_mistral_7b_instruct or multilingual_e5_large_instruct; polling this endpoint returns status until indexing succeeds. (elevenlabs.io)
- You can also GET /v1/convai/knowledge-base/:documentation_id/rag-index to list indexes or DELETE …/rag-index/:rag_index_id to remove one. (elevenlabs.io)
- Enable RAG on the agent
- Fetch the agent config, set agent.prompt.rag.enabled = true and (optionally) set embedding_model and limits, then PATCH /v1/convai/agents/:agent_id with the updated conversation_config. The RAG guide shows a concrete example of these fields in use. (elevenlabs.io)
If by “custom RAG” you mean your own external retriever/vector DB:
- ElevenLabs doesn’t document plugging a third‑party vector DB directly into the built‑in RAG. Instead, expose your retriever via a Tool or an MCP server and attach it to the agent; the agent can call the tool to fetch context during conversations. Configure tool approval as needed. (elevenlabs.io)
Relevant docs:
- RAG overview, UI steps, limits, and API example. (elevenlabs.io)
- Create KB documents (URL/file). (elevenlabs.io)
- Compute/Get/Delete RAG index APIs. (elevenlabs.io)
- Update agent API. (elevenlabs.io)
how many RAG document is limited? I have 273 documents