Supervisor handoff

How do you guys prevent supervisor from repeatedly handing off to the same agent, or calling multiple agents in sequence? Prompts are not helping and we’ll have to add a separate state variable to track the number of times an agent is called.

2 Likes

I have ran into the same issue before and did not found a reliable solution yet.

What seemed to work was having a way larger prompt with more context (not per se about handoff policy). However, its pretty random so I would not count that towards a solid fix.

Did you try using a better model that is more suited for tool calling? I would be interested to see if that works for you.

Any updates on this?

I haven’t found a proper solution for this either. I asked the question again and got a working answer but it increases my latency by 3x.

I think it is reasoning that must take time

Do you mean that it is making multiple sub agent calls after one LLM call? You can try disabling parallel tool calling in the llm object.