https://retellai.com/?utm_source=discord&utm_medium=seo logo
How I can add Retell knowledge base in custom llm
# ❓・ai-evy-support
m
@AI Evy How I can add Retell knowledge base in custom llm?
a
Thanks for tagging me @Md. I'll look through relevant sources and get back to you shortly.
### Answer When using a Custom LLM with Retell AI, the knowledge base retrieval happens automatically on Retell's side before your LLM receives the context [(1) ]() . You don't need to manually integrate the knowledge base into your custom LLM implementation . Here's how it works: 1. Create a knowledge base through the Retell dashboard or API and add your sources (URLs, documents, or text) [(1) ]() [(2) ]() 2. Link the knowledge base to your agent in the agent settings [(1) ]() 3. When a call occurs, Retell automatically retrieves relevant chunks from the knowledge base and includes them in the LLM prompt under the header
## Related Knowledge Base Contexts
Your custom LLM will receive the retrieved knowledge base content as part of the prompt context, so you can simply process it like any other prompt content . The retrieval is triggered automatically for every response generation during the call . If you're using RAG (Retrieval-Augmented Generation) in your own implementation, consider using Retell's built-in knowledge base feature instead, as it's optimized for real-time conversational use with under 100ms latency impact [(1) ]() [(3) ]() . **
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) [[3] Custom LLM Best Practices](https://docs.retellai.com/integrate-llm/llm-best-practice) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
Will for custom llm I can't add directly from retell, I need to add just the KB ID to the custom llm right?
a
Thanks for the feedback, glad I was helpful.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
Thanks for the feedback, glad I was helpful.