https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> does associating a knowledg...
# ❓・ai-evy-support
c
@AI Evy does associating a knowledge bsase with an agent increase the latency of all communication or just when agent uses KB as a tool?
a
Thanks for tagging me @claytonfarr. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Knowledge Base]() * [Check estimated latency]() * [Troubleshoot high latency]() * [Step 1: Configure global settings]() -----------------------------
### Answer According to the Knowledge Base documentation, using a knowledge base with your agent will impact latency for all responses, not just when it's explicitly used as a tool. This is because the knowledge base is automatically used for every response generation. [(1)]() Specifically, the documentation states: "When a knowledge base is linked to an agent, the agent will always try to retrieve information from the knowledge base before responding. There's no need to change your prompt for it to trigger, as it will be done automatically, for every response generation." Regarding the latency impact, Retell has optimized Knowledge Base retrieval for real-time use cases, and it should generally add under 100ms of latency impact. In a Discord message, a user mentioned that using a vector database for knowledge retrieval would increase latency in conversations, resulting in "longer pauses between speaking." [(2)]() If you're experiencing high latency, you can check features marked with a turtle icon 🐢 in your configuration, as these increase latency. [(3)]() The Retell platform aims to achieve latency as low as 600ms (measured from when the user stops speaking to when the AI agent begins responding). [(4)]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Can you find any examples of implementing knowledge bases as a custom tool, instead of via Retell's built-in KB feature?
a
Thanks for the follow-up, @claytonfarr. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Knowledge Base]() * [Overview]() * [Integrate any system with custom function]() * [Integrate Function Calling]() -----------------------------
### Answer Based on the available information sources, there are no direct examples of implementing knowledge bases as a custom tool instead of using Retell's built-in KB feature. However, you could potentially implement this using Retell's custom function capabilities. Custom Function Approach You could create a custom function that retrieves information from your own knowledge base system. Here's how you might set it up: 1. Create a custom function in the dashboard by clicking "+ Add" in the tools section and selecting "Custom Function" [(1)]() 2. Configure the function with a name like
get_knowledge
and add an appropriate description 3. Define parameters for your knowledge retrieval function using JSON schema format:
Copy code
javascript
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "The search query to retrieve information from the knowledge base"
    }
  },
  "required": [
    "query"
  ]
}
4. Set up your endpoint URL where Retell will send the POST request to execute your custom knowledge retrieval function 5. Configure the speech behavior - you might want to enable "Speak during execution" so the agent can acknowledge it's looking up information Your server would need to handle the knowledge retrieval logic and return the relevant information when the function is called. The custom function approach gives you more control over when and how knowledge is retrieved, unlike the built-in KB feature which automatically retrieves information for every response. For implementation details on custom functions, you can refer to the documentation on integrating custom functions and function calling.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.