Routing Agents for Specific Functions - Multi-agent supervisor Concept #27628
Replies: 2 comments 2 replies
-
You can define and route these agents by creating instances of an # Create agent instances
math_agent = Agent.from_llm_and_tools(llm, math_tools, callback_manager, output_parser)
science_agent = Agent.from_llm_and_tools(llm, science_tools, callback_manager, output_parser)
research_agent = Agent.from_llm_and_tools(llm, research_tools, callback_manager, output_parser)
# Supervisor logic to decide which agent to use
def route_question(user_input):
if user_input == 'math':
action = math_agent.plan(intermediate_steps, callbacks, **kwargs)
elif user_input == 'science':
action = science_agent.plan(intermediate_steps, callbacks, **kwargs)
elif user_input == 'research':
action = research_agent.plan(intermediate_steps, callbacks, **kwargs)
return action In this example, |
Beta Was this translation helpful? Give feedback.
-
It is woking fine. However, if I switch from math to science right away, it is confusing and giving wrong answer or not able to see science tools. Is there way I initialize between these switches? Thoughts? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am referring to the concept described in this link, and I find it to be a brilliant idea. In my use case, I have three agents, each responsible for a different type of function. One agent handles 'math', another focuses on 'science', and the third specializes in 'research'.
My question is: How can I define these agents or provide them with specific information so that a supervisor can determine which agent to send a question to, instead of simply passing the question along? Any thoughts or suggestions would be greatly appreciated.
Link to the concept
Beta Was this translation helpful? Give feedback.
All reactions