Agents in a chain not starting
I really need some guidance with a chain of agents I have in my project. I have 3 in a row asking a number of survey questions ( had to split them up as there are too many questions and one couldn't handle saving that many variables)
Each agent asks a set of questions and hands off to the next agent. I've spent ages on the prompts and formatting but it's really inconsistent.
Sometimes the 2nd and 3rd agents start fine when the path leads to them, and sometimes they don't say anything at all even though I can see they are highlighted on the canvas. Can anyone lend a hand?
3 Replies
Hey! A few things you can try that normally fix “silent” hand-offs between chained Agent steps:
1. Give each Agent step something to react to
Every time the conversation enters an Agent step the model waits for a new user turn. If you jump straight from Agent-1 to Agent-2 without inserting any new message, Agent-2 can look “highlighted” on the canvas but still return no text. Add either:
• a Message (Talk) step that asks the next survey question and then connects to Agent-2, or
• write that first question inside the assistant message field of Agent-2. Docs: Agent step – Basic usage & “Multiple Agent Steps” (https://docs.voiceflow.com/docs/agents) 2. Keep the context small Each Agent call re-sends the prior chat history plus your prompt. Three large prompts + dozens of captured variables can exceed the model’s token window and the model may respond with an empty string. Reduce size by: • moving shared instructions to the Knowledge Base or a pinned system message,
• trimming / clearing variables you no longer need before the hand-off,
• or, when possible, combine several questions inside one Agent step instead of three. 3. Check the paths Confirm that every exit from Agent-1 really reaches Agent-2 (including the default path). A guard condition that is never met will light up the step but skip the "respond" trace. 4. Add a <no_response> fallback Create a fallback path on Agent-2 and Agent-3 that triggers when the model returns an empty answer. This surfaces silent failures and lets you retry or route somewhere safe. 5. Consider deterministic steps for surveys If the goal is to capture a fixed set of answers, Capture/Logic steps are more predictable than chaining multiple Agent steps; then call a single Agent at the end only if you need open-ended reasoning (ref: deterministic steps – https://docs.voiceflow.com/docs/logic-1). Try those adjustments and the second/third Agent should speak every time. Let me know how it goes!
• write that first question inside the assistant message field of Agent-2. Docs: Agent step – Basic usage & “Multiple Agent Steps” (https://docs.voiceflow.com/docs/agents) 2. Keep the context small Each Agent call re-sends the prior chat history plus your prompt. Three large prompts + dozens of captured variables can exceed the model’s token window and the model may respond with an empty string. Reduce size by: • moving shared instructions to the Knowledge Base or a pinned system message,
• trimming / clearing variables you no longer need before the hand-off,
• or, when possible, combine several questions inside one Agent step instead of three. 3. Check the paths Confirm that every exit from Agent-1 really reaches Agent-2 (including the default path). A guard condition that is never met will light up the step but skip the "respond" trace. 4. Add a <no_response> fallback Create a fallback path on Agent-2 and Agent-3 that triggers when the model returns an empty answer. This surfaces silent failures and lets you retry or route somewhere safe. 5. Consider deterministic steps for surveys If the goal is to capture a fixed set of answers, Capture/Logic steps are more predictable than chaining multiple Agent steps; then call a single Agent at the end only if you need open-ended reasoning (ref: deterministic steps – https://docs.voiceflow.com/docs/logic-1). Try those adjustments and the second/third Agent should speak every time. Let me know how it goes!
send me the VF file
Thanks Michael! I'll send that on now - what's the best way, email or paste into the chat?