Could we let agent to choose best fit tool to use

I want to give agent many tool to use.
But it’s depend on the situation which tool should be use. I set two tools to my agent, but every time, the agent use both. Anyone try this before?

def supervisor_agent(llm):
return Agent(
llm=llm,
role=“Supervisor to choose tool to answer question”,
backstory=“You are a supervisor, and you have 2 tools you must choose the tool to answer the question. If the quesion metion more than two people you should choose discussion_Tool to answer question, or choose answer_tool when no mention how many people in the question”,
goal=“Use tool to find the result”,
tools = [discussion_Tool,rag_tool],
verbose=True,
debug=True)

Right now, You are defining two tools for a single agent, which could result in the agent using both tools at times even at times when it is not necessary.

Try defining two different tasks, calling an agent for a specific task, there by splitting the tool between two agents with almost same functionality.

1 Like