https://retellai.com/?utm_source=discord&utm_medium=seo logo
I have multi prompt set up
# ❓・ai-evy-support
a
@AI Evy I have multi prompt set up . 1️⃣ Handling Global Transitions Between States I currently have around 8–9 conversation states. Let’s say the user is in one specific state, and during that interaction, they mention something that belongs to another state (for example, the booking agent asks for an email, and the user instead asks, “How do you guys operate?”). Do I need to explicitly define this transition logic in every individual state prompt, or is there a way to handle such “global” transitions more efficiently across all states? 2️⃣ Extracting Information in a Follow-Up (“Anything Else”) or any other State I’ve created an anything_else state that the user is routed to at the end of each conversation segment. For example, the AI asks, “Is there anything else you’d like to know?” If the user replies with something like, “I want a direct pin location SMS to ‘abc location,’” we can see that the message includes useful info for the Directions_Transport state. How can I capture the user’s last utterance in this case and extract all relevant information from it so that the correct state logic can process it?
a
Thanks for tagging me @atta0131. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[2] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[3] Discord message from @jrok1308 on 2025-10-18](https://discord.com/channels/1186424376300679209/1186462578310910112/1429218557765484544) [[4] Multi-Prompt Agent State Transition - LLM Prompt Mechanics](https://discord.com/channels/1186424376300679209/1395545946066129039) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Based on the available sources, here's what I can tell you about handling your multi-prompt setup: ## 1️⃣ Handling Global Transitions Between States For multi-prompt agents, you need to define state transition logic directly in your prompts [(1) ]() . The documentation shows you should write transition conditions like this:
Copy code
7. Ask if user is interested in an in person tour.
 - if yes, transition to schedule_tour.
 - if no or hesitant, call function end_call to hang up politely and say will reach out if any other interesting properties pop up.
Unfortunately, the sources don't explicitly describe a "global" transition mechanism that works across all states without defining the logic in each individual state prompt . Based on the multi-prompt structure, each state has its own focused prompt and transition logic [(2) ]() . Community members have found that adding more explicit language in prompts helps ensure reliable state transitions [(3) ]() . For example:
Copy code
Wait for the user response:
If positive response: Immediately and reliably initiate the transfer. You must invoke the transfer_call_six function at this point without fail. This is critical and non-negotiable. There must be no delay or hesitation.
## 2️⃣ Extracting Information Across States The sources indicate that when you transition to another state, the system "only grabs data that the llm received but does not have the prompt history from the last state" [(4) ]() . This means the conversation history carries over, but the state-specific prompts do not . However, the sources don't provide specific guidance on extracting information from a user's utterance in one state (like
anything_else
) and passing it to another state (like
Directions_Transport
) . ## Alternative Consideration If you're finding the multi-prompt approach challenging for complex flows with many states, some community members have reported that conversation flow can be more reliable for complex scenarios [(3) ]() . One user noted: "I tried a 400-line single-agent to multi prompt, and had challenges. It just felt quirkly... Then just went to conversation flow as it is much easier to see the flow and debug" . Check out these potentially useful sources: [Build a multi-prompt agent]() , [Conversation Flow Overview]() Would you like a general answer based on my knowledge instead?
a
@AI Evy I have this prompt ### Task: Answer FAQs and Reroute Specific Intents Your job is to use the Knowledge Base to answer general questions. If the user asks for a specific action that belongs to another state, you must transfer them immediately. ### Rules 1. Use Knowledge Base: Use the Knowledge Base to find and formulate answers. 2. Ask for More: After you answer a question, you MUST ask: "Can I help with anything else?" 3. Room Booking Reroute (CRITICAL): If the user asks to book a room, check room availability, or inquire about room prices, say: "Just a moment, let me check that for you. then transition to
{"state": "Check_Availability"}
4. Concierge/Transport Reroute (CRITICAL): If the user asks to book a restaurant table, arrange a taxi, schedule a tour, or requests any concierge service, say: "Got it, let's log that request." Immediately after speaking that line, DO NOT WAIT FOR A REPLY. The only subsequent output is the transition JSON:
{"state": "Restaurant_Concierge"}
. 5. Brevity Constraint (CRITICAL): All answers MUST be clear, concise, and direct. Limit responses to a single, complete sentence wherever possible. Never provide a list of options unless explicitly asked. Focus on the core answer only. 6. Answer Concisely: Provide direct, helpful answers to the user's non-booking questions. 7. Ending the Call (CRITICAL FIX): If the user indicates they are finished (e.g., says "no," "that's all," or "goodbye"), use the
end_call
function immediately. DO NOT transition to
Anything_Else_Triage
from this state. but it is not transting to Check_Availability it outputs this Just a moment, let me check that for you. {"state": "Check_Availability"}
a
Thanks for the follow-up, @atta0131. I'll get back to you soon.
### Answer Based on the available sources, the issue is that your prompt is instructing the LLM to output JSON directly, but multi-prompt agents don't work that way. The transition syntax you're using appears to be incorrect for multi-prompt agents [(1) ]() . For multi-prompt agents, you should define state transitions using natural language instructions in your prompt, not JSON output . The correct format should be:
Copy code
3. Room Booking Reroute (CRITICAL) : If the user asks to book a room, check room availability, or inquire about room prices, say: "Just a moment, let me check that for you."
   - Then transition to Check_Availability.
The documentation shows this pattern for defining transitions :
Copy code
7. Ask if user is interested in an in person tour.
 - if yes, transition to schedule_tour.
 - if no or hesitant, call function end_call to hang up politely and say will reach out if any other interesting properties pop up.
Remove the JSON syntax
{"state": "Check_Availability"}
from your prompt and replace it with simple transition instructions like
transition to Check_Availability
. The LLM interprets these natural language instructions to perform the state transition, rather than outputting JSON directly . Additionally, the prompt engineering guide emphasizes being explicit about when to call functions or transition states [(2) ]() . You may want to add more explicit trigger language to ensure reliable transitions . **
​ To learn more, see the sources I considered: [[1] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[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.
a
@User ### Task You are the FAQ specialist. Your job is to answer the user's questions about the resort. ### Rules .... 3. Room Booking Reroute (CRITICAL): If the user asks to book a room or check room availability/prices, say "Of course, I can help with rooms, let me check it ." and transition to Check_Availability state. ..... 7. If they are finished, end the call with the
end_call
function.n now i have this prompt and still see this Hello, thank you for calling Paphos Azure Resort. Για Ελληνικά, πατήστε ένα. For English, press two. Debug 2 How can I help you today? tell me more about this hetel Tool Invocation: transition_to_Handle_Faqs Paphos Azure Resort is a five-star beachfront hotel in Cyprus, offering luxury rooms, fine dining, a spa, pools, and direct access to the Mediterranean Sea. Can I help with anything else? waht if i want to book room or check prices Of course, I can help with rooms, let me check our calendar. it is stuck here