Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Multi-agent capability - using agents as tools for other agents #13821

Open
1 task done
brycecf opened this issue May 30, 2024 · 2 comments
Open
1 task done
Labels
question Further information is requested

Comments

@brycecf
Copy link
Contributor

brycecf commented May 30, 2024

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

Is there an existing interface that permits readily exposing agents as tools for other agents, thereby establishing a readily available multi-agent capability? Or, would it requiring defining a new ToolSpec?

FWIW, it appears AutoGen is poised to address this in the near future for LlamaIndex.

@brycecf brycecf added the question Further information is requested label May 30, 2024
Copy link

dosubot bot commented May 30, 2024

Yes, the create_llama_agent and create_llama_chat_agent functions in LlamaIndex permit readily exposing agents as tools for other agents, thereby establishing a readily available multi-agent capability. These functions utilize the LlamaToolkit to initialize and load agent executors, which can be used to create and manage multiple agents. The create_llama_agent function allows for various agent types such as zero-shot-react-description, react-docstore, self-ask-with-search, and more, while the create_llama_chat_agent function specifically sets up a conversational agent using the CONVERSATIONAL_REACT_DESCRIPTION type.

Additionally, LlamaIndex offers a robust framework for defining and using tools within agents. Tools can be created using FunctionTool to wrap any user-defined function or QueryEngineTool to wrap existing query engines. These tools can be bundled into ToolSpecs for comprehensive service interfaces, such as Gmail, and utility tools like OnDemandLoaderTool and LoadAndSearchToolSpec to handle large data volumes. This framework allows for flexible and powerful multi-agent capabilities by enabling agents to use and expose a variety of tools seamlessly.

Moreover, the MultiDocumentAgentsPack class in LlamaIndex provides a structured way to build a multi-agent architecture over a set of documents. This class sets up individual document agents capable of QA and summarization and then establishes a top-level agent over these document agents. Each document agent is equipped with tools like QueryEngineTool for specific and holistic queries about the document. The top-level agent can use these document agents as tools, thereby creating a comprehensive multi-agent system. This setup allows for efficient handling of queries across multiple documents by leveraging specialized agents for each document [1][2][3][4][5].

To continue talking to Dosu, mention @dosu.

@logan-markewich
Copy link
Collaborator

@brycecf maybe I'm missing something, but it should be as simple as wrapping an agent into a function tool?

Of course, there could always be a helper for this too, agent.as_tool() oe something, but setting up a function tool is also straightforward and easy to customize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants