Goopa Snoops
01/27/2026, 9:25 PMAI Evy
01/27/2026, 9:25 PMAI Evy
01/27/2026, 9:25 PM{{previous_agent_state}} variable assignment specifically, ensure your transition descriptions and any conditional logic referencing this variable are written in English, even if the agent's spoken output is in Spanish.
If state transitions are still unreliable, you can try adding explicit, high-priority language in your prompt to ensure the transition function is called, such as treating it as a "make-or-break" action that must not be skipped or delayed. [(2) ]()
Check out these potentially useful sources:
- [Single/Multi Prompt Agent Overview]()
- [Update Retell LLM]()
Would you like me to provide a general answer on multilingual prompt engineering techniques?AI Evy
01/27/2026, 9:25 PMAI Evy
01/27/2026, 9:25 PMGoopa Snoops
01/27/2026, 9:27 PMAI Evy
01/27/2026, 9:27 PMAI Evy
01/27/2026, 9:27 PM{{previous_agent_state}} is passing the wrong value to your email formatting tool—is likely related to how state transitions are being triggered and tracked in your multi-prompt agent.
A few things to consider:
1. State transition reliability
Multi-prompt agents can sometimes have inconsistent state transitions, especially if the transition logic isn't explicitly emphasized in the prompt. Community experience suggests adding high-priority, explicit language to ensure the transition function is called reliably. For example, treating the transition as a "make-or-break" action that must not be skipped or delayed can help. [(1) ]()
2. Tool call timing
If your email tool is being called before the state transition completes, the {{previous_agent_state}} variable may still reflect an older state. Ensure that the state transition happens before the tool is invoked by structuring your prompt to confirm the transition first, then call the tool.
3. Prompt structure
In multi-prompt agents, each state has its own state_prompt and tools, and transitions are defined via edges with destination_state_name and description. [(2) ]() Make sure your transition descriptions are clear and unambiguous so the LLM correctly identifies when to transition.
4. Language considerations
Since you mentioned the English version works correctly, keep your transition logic and tool descriptions in English, even if the agent responds in Spanish. This can improve the LLM's ability to correctly interpret and execute state transitions and variable assignments.
If the issue persists, I'd recommend testing with logging to verify exactly when the state transition occurs relative to whenAI Evy
01/27/2026, 9:27 PMAI Evy
01/27/2026, 9:27 PM