https://retellai.com/?utm_source=discord&utm_medium=seo logo
how long is too long when it comes to a prompt bef...
# ❓・ai-evy-support
s
@AI Evy how long is too long when it comes to a prompt before it sohuld be broken into pieces
a
Thanks for tagging me @Sam W. I'll look through relevant sources and get back to you shortly.
### Answer The maximum prompt token length when using Retell LLM is 32,768 tokens by default—prompts exceeding this will be rejected when creating or updating the LLM. [(1) ]() However, there are practical considerations before hitting that hard limit: - Prompts over 3,500 tokens incur extra charges. - Retell's engineers recommend keeping prompt size below 8,000 tokens for optimal performance, as larger prompts can reduce stability, increase latency, and raise costs. [(2) ]() If you need longer context, you can reach out to [support@retellai.com](support@retellai.com) to discuss options. [(1) ]()
​ To learn more, see the sources I considered: [[1] Understand concurrency & limits](https://docs.retellai.com/deploy/concurrency) [[2] Prompt exceeds the limit of 32768 tokens, please contact support if you need longer context.](https://discord.com/channels/1186424376300679209/1432544872421789789) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy should i break 2 actions up into 2 prompts that are if else or can i keep it in one
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer For 2 actions with if/else logic, you can typically keep it in a single prompt. [(1) ]() When a single prompt works well: - Simple, straightforward conversations - Agents with 1-3 functions - Linear conversation flows When to consider splitting into multi-prompt or Conversation Flow: - More than 3-4 conditional paths [(2) ]() - Using 5+ different functions/tools - Your single prompt exceeds 1000 words or uses more than 5 functions [(1) ]() - You're experiencing behavioral drift, unreliable tool usage, or context confusion For your 2-action scenario, a single prompt with clear conditional instructions should work. Structure it with explicit trigger conditions like:
Copy code
- If [condition A]:
  → Call function `action_one`
- If [condition B]:
  → Call function `action_two`
[(2) ]() If you find the agent behaves inconsistently with your if/else logic, that's when breaking into multi-prompt states or Conversation Flow becomes worthwhile. [(1) ]() , [(2) ]()
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy does the token costs charge even when it's in a second multi prompt?
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer Yes, token costs apply to multi-prompt agents, and the calculation is based on the system prompt plus the current node's tokens. [(1) ]() So as you move through different states/prompts in a multi-prompt agent, the token count will fluctuate up and down depending on which node you're currently in. What's included in the token calculation: - Global prompt - Functions (tool descriptions) - State/node prompt - Transcript between agent and user - Tool call history and results [(2) ]() If the combined tokens for the current state exceed 3,500, the LLM price scaling applies: - Scaling Factor = Prompt LLM Tokens ÷ 3,500 - Billed Duration = Original Duration × Scaling Factor (rounded up) So if your first prompt is under 3,500 tokens but your second prompt pushes it over, you'd only see the surcharge during the portion of the call spent in that second state.
​ To learn more, see the sources I considered: [[1] Question about Token-Based Pricing for Multi-Prompt Agents](https://discord.com/channels/1186424376300679209/1375213752743366727) [[2] Exceptions to Our Per-Minute Pricing](https://docs.retellai.com/accounts/billing-exceptions) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy so is it cheaper to add the other data to a second prompt or does it not matter
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer It can be cheaper depending on how your call flows. Since token costs are calculated as system prompt plus current node tokens, splitting data into a second prompt means you only pay for those extra tokens during the portion of the call spent in that state. [(1) ]() , [(2) ]() Practical example: - If your main prompt is 2,500 tokens and you add 2,000 tokens of data → total 4,500 tokens → surcharge applies for the entire call - If your main prompt stays at 2,500 tokens and the 2,000 tokens live in a second prompt → surcharge only applies while in that second state So if users only reach that second prompt some of the time (or spend less time there) , splitting can reduce costs. [(1) ]() , [(2) ]() If every call always goes through both prompts for similar durations, the total cost difference would be minimal.
​ To learn more, see the sources I considered: [[1] Exceptions to Our Per-Minute Pricing](https://docs.retellai.com/accounts/billing-exceptions) [[2] Question about Token-Based Pricing for Multi-Prompt Agents](https://discord.com/channels/1186424376300679209/1375213752743366727) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy when it switches prompts does it only count those prompts for the next prompt
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer ### Answer I don't have explicit documentation in my current sources that details exactly what's included in the token count when switching between prompts in a multi-prompt agent. Based on the thread context I provided earlier (from sources not in my current set) , the token calculation includes the system prompt + current node's tokens + transcript + tool call history. So when you switch prompts, the new prompt's tokens replace the previous prompt's tokens in the calculation—but the transcript and tool call history from the conversation so far would still be included. Check out these potentially useful sources for more details: - [Exceptions to Our Per-Minute Pricing]() - [Single/Multi Prompt Agent Overview]() Would you like me to try to answer more generally based on my knowledge?
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy how do I call my knowledge base in my prompot
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer You don't need to explicitly call the knowledge base in your prompt—it works automatically. [(1) ]() How it works: 1. Link your knowledge base to your agent in the agent editor under the "Knowledge Base" section 2. Once linked, the agent will automatically retrieve relevant information from the knowledge base before responding—no prompt changes required The retrieved content appears in the LLM prompt under the header
## Related Knowledge Base Contexts
. If you want to force the agent to only use knowledge base content, you can add this to your prompt:
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
Configuration options: - **Chunks to retrieve**: 1-10 (default: 3) - **Similarity Threshold**: Controls matching strictness (default: 0.6) For Conversation Flow agents, you can also configure node-level knowledge bases for specific topics.
​ 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.
s
@AI Evy give me a prompt example to call the knowledge base
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer As mentioned, you don't need to explicitly call the knowledge base—it retrieves automatically once linked. [(1) ]() However, if you want to restrict the agent to only use knowledge base content, here's the prompt example from the documentation:
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
This forces the agent to rely solely on what's retrieved from your knowledge base and prevents it from generating information outside of that context.
​ 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.
s
@AI Evy does the knowledg base count against my total tokens
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer ### Answer Yes, knowledge base tokens count against your total tokens. [(1) ]() The retrieved chunks from the knowledge base get appended to the LLM prompt under the header
## Related Knowledge Base Contexts
, which means they're included in the token calculation. [(2) ]() Knowledge base pricing: - $0.005 per minute of calls that have knowledge base enabled - This is a flat rate regardless of whether your agent uses 1 or many knowledge bases So you'll see two cost impacts: 1. The per-minute knowledge base surcharge ($0.005/min) 2. The retrieved chunks adding to your prompt token count (which could trigger the token-based pricing scaling if total tokens exceed 3,500)
​ To learn more, see the sources I considered: [[1] Will knowledge base use tokens?](https://discord.com/channels/1186424376300679209/1375421036291428452) [[2] 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.
s
@AI Evy You must try and schedule an appointment time at our clinic. If they are interested in scheduling an appointment, you will call node
Schedule_Appointment
to schedule them. is this prompt ok to schedule appointment node
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer Your prompt structure looks reasonable, but you'll want to refine the wording. In Conversation Flow, you don't "call a node"—instead, transitions happen based on conditions when the user finishes speaking. [(1) ]() Suggested improvement:
Copy code
You must try to schedule an appointment time at our clinic. If the user expresses interest in scheduling an appointment, transition to the Schedule_Appointment node.
Key considerations: - In Conversation Flow, transitions happen "when user is done speaking" from a Conversation Node - For appointment booking, you'd typically use a Function Node to call the actual booking function (like "Check Availability" and "Book Appointments") , not just transition to another conversation node [(2) ]() , [(3) ]() - The Function Node is "used to call a function, whether it's a pre-built function or a custom function" and "the function that associates with this node will be called when entering this node" Recommended flow: 1. Conversation Node: Gauge interest in scheduling 2. Function Node: Check availability (using pre-built Cal.com integration or custom function) 3. Function Node: Book the appointment 4. Conversation Node: Confirm the booking to the user [(2) ]() , [(3) ]() You may also want to define transition conditions more explicitly—for example, what happens if they say "no" or "maybe later." [(4) ]()
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[2] AI Appointment Scheduling with Voice AI Booking Assistant](https://www.retellai.com/features/book-appointments) [[3] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[4] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
@AI Evy does it work better with or with wtihout back ticks or quotatinos
a
Thanks for the follow-up, @Sam W. I'll get back to you soon.
### Answer --- I don't have explicit documentation in my current sources that specifies whether backticks or quotation marks improve transition reliability or node/state referencing in prompts. From the Discord thread on multi-prompt transitions, one user shared this example of effective transition language without backticks: > "If positive response: Immediately and reliably initiate the transfer. You must invoke the transfer_call_six function at this point without fail." [(1) ]() This suggests clear, direct language matters more than specific formatting. Check out these potentially useful sources: - [Single/Multi Prompt Agent Overview]() - [Function Node Overview]() Would you like me to try to answer more generally based on my knowledge?
​ To learn more, see the sources I considered: [[1] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.