Parallel tool calling in Langgraph

Hello,
I have a simple graph that gets the user input, decides if the agent should call a tool, calls it, and then repeat if necessary.

Sometimes, the user input can determine the agent to call multiple tools at the same time
Example: Find the country id of Georgia and the account name of ABCDEFGHIJ

This fails. But if i send 2 separate requests, it will work.

I am using create_openai_tools_agent(llm=model, tools=tools, prompt=prompt)
model= gpt 4.o

How will i make possible that the agent will be able to call multiple tools at the same time based on the user request, without the need of separate calls?

Hi @rdeneva,

Please take a look at the agent quickstart documentation in LangGraph. create_openai_tools_agent is an older implementation of an agent using LangChain. It does not use LangGraph. We recommend that users swap to LangGraph for newer agents.

Eugene

Is there another option besides the react agent? i had some problems with it in the past due to complex tasks. And another question would be if react agent handles multi tool calling from a single input.

thx

Of course, with LangGraph you can build artbirary workflows, you’re not limited to looping agents. You can use the prebuilt ToolNode in a custom workflow. It’ll help you execute tools in either sync or async and will handle parallel tool calling as well.