https://retellai.com/?utm_source=discord&utm_medium=seo logo
Whats the best configuration for the lowest amount...
# ❓・ai-evy-support
c
@AI Evy Whats the best configuration for the lowest amount of latency? I'm just wondering how I could potentially take the latency down
a
Thanks for tagging me @Ciaran. I'll look through relevant sources and get back to you shortly.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer To achieve the lowest latency in Retell AI, focus on these key configurations: 1. Check for High-Latency Features [(1) ]() Look for features marked with a turtle icon 🐢 in your configuration . If your estimated latency exceeds 1.5s, disable some features to reduce latency . 2. Optimize LLM Performance Your LLM latency should be in the 500ms - 900ms range . If it's consistently above 900ms, you should: - Use fast tier - Switch to an alternative LLM provider - Wait for your current provider to resolve performance issues 3. Consider Geographic Distance International phone calls introduce additional latency due to geographic distance . To minimize this: - Get a local phone number in the same region as your users - Use phone numbers geographically closer to your target audience for better performance 4. Monitor Your Latency Metrics [(2) ]() You can check actual latency through the dashboard or Get Call API . End-to-end latency measures the total time from when the user stops speaking until the AI agent begins responding, including processing time, network delays, and model inference time . Target Latency Benchmarks Retell AI typically achieves sub-800ms end-to-end latency [(3) ]() . The system is optimized for sub-500ms latency in production environments [(4) ]() . If your end-to-end latency P90 exceeds 3 seconds, check the [Status Page]() for any ongoing issues [(1) ]() . If problems persist after trying these optimizations, contact support with your call ID and current latency measurements .
​ To learn more, see the sources I considered: [[1] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[2] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) [[3] Speech Processing](https://www.retellai.com/glossary/speech-processing) [[4] Latency](https://www.retellai.com/glossary/latency) ​
c
@AI Evy What model is best for latency cost wise? I've been using gpt 4.1
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer For the best balance of latency and cost, consider GPT-4.1-mini or GPT-4.1-nano [(1) ]() [(2) ]() . These models are available in Retell AI and offer faster performance at lower cost compared to GPT-4.1. Model Options Available: -
gpt-4.1-mini
-
gpt-4.1-nano
-
gpt-5-mini
-
gpt-5-nano
Cost Comparison: [(3) ]() - GPT-4o: $0.00250 per 1,000 input tokens; $0.01000 per 1,000 output tokens - GPT-4o Mini: $0.000150 per 1,000 input tokens; $0.000600 per 1,000 output tokens Performance Trade-offs: [(4) ]() - GPT-3.5 is way cheaper and faster but the quality of conversation will be lesser (which means you have to tune the prompt more) and also complex tool calling might be hampered a bit - GPT-4o in theory should be similar generation quality but faster and cheaper - The Claude models are also good alternatives that sit between GPT-3.5 and GPT-4 Turbo If you're currently using GPT-4.1 and want to reduce both latency and cost, switching to gpt-4.1-mini or gpt-4.1-nano would give you faster response times at a fraction of the cost [(1) ]() [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[3] Choosing the Best LLM for Your AI Voice Agents | Retell AI](https://www.retellai.com/blog/choosing-the-best-llm-for-your-voice-ai-agents) [[4] Discord message from @njnisarg on 2024-05-29](https://discord.com/channels/1186424376300679209/1186462578310910112/1245394390139273277) ​
c
@AI Evy Awesome, now whats the difference between mini and nano?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Based on the available sources, here's what I found about the differences between mini and nano models: For GPT-4.1 models: [(1) ]() GPT-4.1 Mini: - Latency: Low (550ms) - Intelligence: High - Pricing: $0.016/min GPT-4.1 Nano: - Latency: Low (500ms) - Intelligence: Medium - Pricing: $0.004/min For GPT-5 models: GPT-5 Mini (minimal) : - Latency: Medium (800ms) - Intelligence: Highest in this group - Pricing: $0.012/min GPT-5 Nano (minimal) : - Latency: Medium (700ms) - Intelligence: High - Pricing: $0.003/min Key Differences: The nano variants are optimized for speed and cost - they offer the lowest latency and cheapest pricing but with reduced intelligence compared to mini variants. The mini variants provide higher intelligence at slightly higher latency and cost. Recommendation for your use case: Since you're focused on latency and cost, if your workflow is speed-sensitive and doesn't require deep reasoning, GPT-4.1 Mini would be a strong choice. If cost is the top priority, GPT-5 Nano offers the cheapest price while still maintaining high intelligence.
​ To learn more, see the sources I considered: [[1] Retell AI Launches GPT-5 for Voice Agents – Higher Intelligence, Smarter Conversations | Retell AI](https://www.retellai.com/blog/gpt-5-now-on-retell-smarter-ai-voice-agents-with-reasoning-power) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Opts for 4.1 mini (fast) based of that article. Seems like the most effective and low latency model (Y) Next thing is I want to get my token usage down, it's ~2700-3350 tokens. It says I should I utilise knowledge bases? How would you do this on a conversational flow?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Great choice on GPT-4.1 mini! Now for reducing token usage with knowledge bases in Conversation Flow: How Knowledge Bases Help Reduce Token Usage [(1) ]() Knowledge bases are especially useful when you have a lot of information that would otherwise bloat your prompts . Instead of putting everything in your prompt, the agent retrieves only relevant chunks during the conversation . Setting Up Knowledge Base in Conversation Flow Agent-Level Configuration: 1. Navigate to your dashboard 2. Select the "Knowledge Base" tab 3. Click "Add" and create your knowledge base (URLs, files, or text snippets) 4. Open your Conversation Flow agent editor 5. Locate the "Knowledge Base" section 6. Select the knowledge base items you want to use Node-Level Configuration: [(2) ]() You can also configure knowledge bases at the Conversation Node level for topic-specific context . This combines with your agent-level knowledge base : 1. Click the Conversation Node you want to configure 2. Configure node-level knowledge bases similar to agent-level setup 3. The node-level KB will combine with agent-level KB for more accurate context Optimizing Retrieval Settings [(1) ]() After connecting a knowledge base, configure: - **Chunks to retrieve**: Max number of chunks (range 1-10, default: 3) - **Similarity Threshold**: How strict matching is (default: 0.6) **Important note**: Increasing chunks gives more context but also increases prompt length . For most cases, the recommended settings are 3 chunks and 0.60 similarity threshold . Best Practices for Token Reduction - Prefer
.md
(Markdown) files over
.txt
for better chunking - Use clear, descriptive headings and keep sections focused
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) ​
- Group related information within the same section - Use the knowledge base for supporting information, not agent instructions (put instructions in the agent's prompt) How It Works The agent uses the transcript so far to find the most relevant chunks from the knowledge base and feeds them to the LLM as context . Retrieved content appears under the header ## Related Knowledge Base Contexts . This happens automatically for every response generation .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
c
@AI Evy Ok... I get what they are and how to use them. I basically use them as packages of information that my agent can refer to. Almost like a dictionary of information. So my agent is a pharmacy. It's handling 1. Return a prescription 2. Requesting their prescription 3. General Questions (Speak to a human, cancellation, complaints, how to order, missing items etc). These are just 1 conversation cells OR a component. How would you handle this? Would you create a knowledge base for all the general questions? Bare in mind, these general questions are Global nodes
a
& Request nodes**: No KB needed (keep instructions in prompts) - Global Nodes (General Questions) : Attach your general questions KB at the node level [(1) ]() [(2) ]() - **Agent-level**: Consider no KB, or only essential pharmacy-wide policies This approach keeps your token count low while ensuring relevant information is available exactly when needed.
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] Most of the times KB is invoked and the agent does not follow the node transitions](https://discord.com/channels/1186424376300679209/1407282116802252892) ​
### Answer For your pharmacy use case, here's how I'd recommend structuring knowledge bases with Global Nodes: Recommended Approach: 1. Create a Knowledge Base for General Questions Yes, create a dedicated knowledge base containing all your general Q&A content (speak to human procedures, cancellation policies, complaint handling, ordering instructions, missing items protocol) [(1) ]() . This keeps token usage down by not embedding all this information in every node's prompt. 2. Attach the Knowledge Base at the Global Node Level You can configure node-level knowledge bases on your Global Nodes [(1) ]() [(2) ]() . This means: - Your Global Nodes for "Speak to Human," "Cancellations," "Complaints," etc. each get the general questions KB attached - The KB is only retrieved when those specific Global Nodes are active - Your main prescription flow nodes stay lean without this extra context 3. Important Consideration About Knowledge Bases and Global Nodes Be aware that linking a knowledge base can sometimes cause the agent to pull info for every reply, which may override your structured conversation flow [(3) ]() . One community member noted that the agent was "retrieving always from the knowledge base and overlooking the node transitions" . Solution: In your general prompt, explicitly restrict when the knowledge base should be used . For example: "Only use the knowledge base when the user asks general questions about policies, procedures, or requests to speak to a human. Do not use it for prescription-specific workflows." 4. Structure for Your Use Case: - **Prescription Return
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy I think I understand... So you would create a MD file for the knowledge base
Copy code
# Compaints
When the user wants to complain, please gather the reason for the complaint...
...
And then a single conversation cell for this with the attached KB?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Almost, but with an important clarification about what goes in the knowledge base versus your node instructions: What Should Go in Your Markdown Knowledge Base File: [(1) ]() Your MD file should contain supporting information and facts, not agent instructions. For complaints, it would look like:
Copy code
markdown
# Complaints

## Complaint Process
Complaints are handled within 24-48 hours by our customer service team.

## Required Information
- Customer name and account number
- Date of incident
- Description of issue
- Desired resolution

## Escalation Policy
Unresolved complaints are escalated to management after 3 business days.
What Should Go in Your Conversation Node Instruction: [(2) ]() The node instruction is where you tell the agent what to do:
Copy code
When the user wants to complain, gather: their name, account number, date of incident, issue description, and desired resolution. Reference the knowledge base for complaint policies and timelines.
Best Practices: [(1) ]() - Use the knowledge base to supply supporting information, not agent instructions or prompts - Put instructions in the agent's prompt - Well-structured Markdown is chunked and retrieved more accurately - Use clear, descriptive headings and keep each section focused Node-Level KB Configuration: [(2) ]() Yes, you can attach the KB at the node level for your complaints conversation node . The node-level knowledge base will combine with agent-level knowledge base to provide more accurate context for that specific topic .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Ok, so put all the information about the issue (Ordering for example)
Copy code
# Ordering

## Process
1. You can request you prescriptions via:
  1. The app
  2. Requesting from your GP with a paperslip
  3. Online
  4. We can request it but some GP's don't accept us doing it but we can try.
2. GP Signs it off
3. It comes through the EPS system to us
4. We send it out

## Policies
We can only send out what gets sent to us. We cannot add anymore to your prescriptions other than what has been approved.
The Conversation cells would be...
Copy code
Prioritise the patient putting in their prescription to reduce workload on our side.

Tell the user how they can order. 

If the user is persistent that someone else must do it, then offer for us to do it

Reference Knowledge base for ordering process
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Exactly! You've got the right structure. Your approach correctly separates factual information (knowledge base) from agent behavior (node instructions) [(1) ]() . Your Knowledge Base MD is perfect because it contains: - Factual process steps - Policy information - Supporting details the agent can reference Your Conversation Node instruction is also correct because it: - Defines the agent's task and behavior - Guides conversation flow - References the KB for supporting facts One small refinement to your node instruction: Remove "Reference Knowledge base for ordering process" from your node instruction . The agent automatically retrieves from attached knowledge bases during every response generation . You don't need to explicitly tell it to reference the KB in the prompt. Simplified node instruction:
Copy code
Prioritise the patient putting in their prescription to reduce workload on our side.

Tell the user how they can order their prescription.

If the user is persistent that someone else must do it, then offer for us to request it on their behalf.
How it works: When this node is active and has your Ordering KB attached at the node level, the agent will automatically find relevant chunks from your KB and feed them to the LLM under the header "## Related Knowledge Base Contexts" . The retrieved content combines with your node instruction to generate accurate responses . This setup keeps your token usage low while ensuring the agent has access to detailed ordering information exactly when needed .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Would you prioritise putting Knowledge bases on at cell/node level instead of agent level? Agent level would be for things like opening times but node/cell level is this is how you handle complaints for example?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer Yes, your approach is exactly right! Here's the recommended strategy: Agent-Level Knowledge Base: [(1) ]() - General, always-relevant information like opening times, pharmacy location, contact details - Information that applies across all conversation flows - Pharmacy-wide policies that are universally applicable Node-Level Knowledge Base: [(1) ]() [(2) ]() - Topic-specific content like complaint handling procedures, ordering processes, return policies - Information relevant only to that particular conversation path - Detailed workflows for specific scenarios Why This Approach Works Better: 1. Lower Latency [(3) ]() - Node-level KBs narrow the search space, so the agent retrieves more accurate answers with lower latency 2. More Accurate Retrieval - The agent focuses on context-specific information rather than searching through everything 3. Reduced Token Usage - Agent-level KB chunks aren't retrieved during every node, only when relevant [(1) ]() 4. Better Flow Control - Helps prevent the agent from pulling irrelevant information that might override your structured conversation flow [(4) ]() Configuration: [(1) ]() [(2) ]() - Node-level knowledge bases combine with agent-level knowledge bases to provide more accurate context for specific topics - You can configure knowledge bases at both Conversation Node level and Subagent Node level - The recommended settings are 3 chunks and 0.60 similarity threshol
d for most cases For Your Pharmacy Use Case: - Agent-level: Opening hours, pharmacy address, general contact info - Node-level: Complaints KB on complaints node, Ordering KB on ordering node, Returns KB on returns node This keeps your token count low while ensuring relevant information is available exactly when needed.
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Subagent Node](https://docs.retellai.com/build/conversation-flow/subagent-node) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[4] Most of the times KB is invoked and the agent does not follow the node transitions](https://discord.com/channels/1186424376300679209/1407282116802252892) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy And how would you go about knowledge bases where it's a component? The component is a global node (this is for complaints). It gets the complaint, says its best to email us. If they will email us, end but if not, it gets the best number to contact them back on and when confirms it. WOuld you just do a knowledge base with this process and then a basic conversation cell/node
Copy code
Acknowledge the complaint, apologise for any inconvience

Refer to the knowledge base to figure out the process.
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer No, I'd recommend a different approach for components with Global Nodes. The Issue with Your Proposed Structure: Your approach would put the entire complaint handling workflow in the knowledge base, which goes against best practices [(1) ]() . Knowledge bases should contain supporting information, not agent instructions or workflow logic . Recommended Structure for Component with Global Node: Knowledge Base (MD file) :
Copy code
markdown
# Complaints

## Contact Methods
Email: complaints@pharmacy.com
Phone callback: Available Monday-Friday, 9am-5pm

## Response Times
- Email complaints: Responded to within 24-48 hours
- Phone callbacks: Scheduled within 1 business day

## Escalation
Unresolved complaints escalated to management after 3 business days.
Component Structure: Create multiple nodes within your component to handle the workflow: 1. Node 1 - Acknowledge & Gather:
Copy code
Acknowledge the complaint and apologize for any inconvenience.

Ask the user to briefly describe their complaint.
2. Node 2 - Suggest Email:
Copy code
Explain that emailing complaints@pharmacy.com is the best way to ensure their complaint is properly documented and handled.

Ask if they're willing to email their complaint.
3. Node 3a - Email Accepted (Transition) :
Copy code
Confirm they'll email and thank them. Provide the email address again.
4. Node 3b - Email Declined (Transition) :
Copy code
Offer a phone callback instead.

Collect their preferred contact number and best time to call.

Confirm the details back to them.
Why This Works Better: - Workflow logic stays in node instructions , not the KB - Supporting facts (email address, response times) come from the KB - Clearer conversation flow with proper node transitions [(2) ]() - Prevents the KB from overriding your structured flow [(3) ]() , which is a known issue when too much workflow logic is in the KB Important Note About Global Nodes in Components: Currently, there's a feature request for component nodes to support global node functionality [(4) ]() . This means global node capabilities within components may be limited or evolving. Bottom Line: Structure your component with multiple nodes for workflow steps, and use the KB only for factual information like contact details and policies [(1) ]() .
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[3] Most of the times KB is invoked and the agent does not follow the node transitions](https://discord.com/channels/1186424376300679209/1407282116802252892) [[4] Components Nodes as Global Nodes](https://community.retellai.com/t/components-nodes-as-global-nodes/223) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy And then attach the knowledge base to every node in the component? General rule of thumb is, if it's a component which is doing mutliple things, create the knowledge base and attach to all nodes?
a
Thanks for the follow-up, @Ciaran. I'll get back to you soon.
### Answer No, you don't need to attach the knowledge base to every node in the component. Recommended Approach: Attach the knowledge base only to nodes that actually need to reference that specific information [(1) ]() [(2) ]() . For your complaints component: - Node 1 (Acknowledge & Gather) : No KB needed - just acknowledgment and gathering complaint details - Node 2 (Suggest Email) : Attach KB here - needs email address and response time info - Node 3a (Email Accepted) : Attach KB here - needs to confirm email address - Node 3b (Email Declined) : Attach KB here - needs callback timing policies Why Selective Attachment is Better: 1. Lower latency - Narrower search space when KB is only attached where needed [(3) ]() 2. Reduced token usage - KB chunks aren't retrieved unnecessarily on nodes that don't need them 3. More accurate retrieval - Agent focuses only on relevant context for that specific node General Rule of Thumb: For components handling multiple things, create the knowledge base with all relevant supporting information, but attach it only to nodes that need to reference factual information from that KB [(1) ]() [(2) ]() . Don't attach it to nodes that are purely conversational or gathering user input. Node-level knowledge bases combine with agent-level knowledge bases to provide topic-specific context , so you get the benefit of both without unnecessary retrieval overhead.
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[2] Subagent Node](https://docs.retellai.com/build/conversation-flow/subagent-node) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.