Skip to content

[FEATURE] Pass Agent objects directly to other Agent objects #84

@awsarron

Description

@awsarron

Problem Statement

I would love to be able to pass Agent objects directly to another Agent's tool list, implementing the agents-as-tools supervisor multi-agent pattern with a simpler interface.

Currently I am able to implement this by wrapping an Agent in a function and decorating it with @tool, however that's a bit more effort for me.

Proposed Solution

  1. Add optional name and description parameters to the Agent class
  2. Allow objects of type Agent to be passed to another Agent's tools list
  3. When Agent objects are passed as tools, require name and description to be set
  4. Generate a tool specification for Agent objects that are passed as tools to another Agent:
    • Name: Agent.name
    • Description: Agent.description

Considerations:

  • Some modes could be useful, for example invoking the sub agent with just a reformatted query by adding a text input parameter to the generated tool specification, along with another mode that invokes the sub agent with the full context of the parent agent without rewriting any queries to the sub agent

Use Case

  • Agents as tools
  • Supervisor multi-agent pattern

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions