Best approach implement cooperation between langchain agents

I would like to make two Langchain agents cooperate, the first one performs a search on a vector database that contains information about operating procedures (PDF file), the second one is pandas dataframe agent and performs queries on the data.
I would like depending on the user’s query to invoke the correct agent, someone can help me? thanks a lot!

Hey Claudio,

First off you don’t need langchain, IMO over complicates a simple task.
a simple outline design is as follows:

  1. user inputs query
  2. make API call to vector db, return top N results/chunks as context. (you may need to create an embedding of the query depending on the vector DB used) - same approach works for other APIs.
  3. invoke chat completion with prompt + question + context

There are more sophisticated variations of this but that’s the design, you can also consider if you even need the LLM to be called.
For example if this is an FAQ bot, if you get a near 100% confidence result back from the search, you can just give the answer. (i.e. exact question and answer found)

Hope that helps!