https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can I optimize by token usage in converstion f...
# ❓・ai-evy-support
s
@AI Evy How can I optimize by token usage in converstion flow agents
a
Thanks for tagging me @Sanjay. I'll look through relevant sources and get back to you shortly.
### Answer Here are some strategies to optimize token usage in conversation flow agents: 1. Keep prompts concise Avoid verbose prompts. One practitioner noted watching out for token usage when formatting prompts—sometimes pasting entire large prompts increases token consumption unnecessarily. [(1) ](

▾

) 2. Avoid excessive agent "yapping" If your agent talks too much, it increases tokens. You can add instructions like "no yapping" in your response guidelines to keep responses shorter. 3. Use LLM States / Conversation Flow nodes effectively Breaking conversations into distinct nodes with focused prompts helps reduce context drift and keeps each interaction's token footprint smaller. [(2) ]() 4. Knowledge base considerations Knowledge base retrieval may only incur token usage when actually called. You can configure
kb_config
parameters like
top_k
and
filter_score
to control how much data is retrieved:
Copy code
json
"kb_config": {
  "top_k": 3,
  "filter_score": 0.6
}
, [(3) ]() 5. Format knowledge base data efficiently Using markdown formatting and splitting knowledge base content into smaller, well-organized chunks (rather than large tables or PDFs) can help the LLM retrieve information more efficiently. [(4) ](

▾

) 6. Adjust model temperature Lower
model_temperature
values (closer to 0) can produce more deterministic, potentially shorter responses. [(2) ]() , [(3) ]()
​ To learn more, see the sources I considered: [[1] Part 1: BuildYour First Retell Voice Al Agent That Sells Cars](

https://www.youtube.com/watch?v=p0DusrDjfjA▾

) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) [[4] Master The Future of Voice AI - Conversation Design & Agent Persona](

https://www.youtube.com/watch?v=42V0bDQIsb0▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.