Skip to content

Handoffs / sub-agent delegation #1978

@DouweM

Description

@DouweM

Tools and output functions can be used to do agent handoff, but still require you to define a wrapper function around agent.run that handles the input, output, and handling errors (possibly by bubbling them up to the top-level agent). There's also no way to easily get all of the messages in a multi-agent conversation, as top-level agent currently doesn't any have knowledge of other agents that are called from tools or output functions, so the AgentRunResult will only contain the top-level agent messages.

It would be nice to support Agent(..., handoff=[agent_one, agent_two]), similar to how OpenAI does it but of course with a Pydantic AI spin on it.

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions