Agents
Working with Multiple Agents
Learn how to coordinate multiple agents and pass data between them in Inferable.
Complex workflows often require multiple agents working together, each specialized for a specific task. This guide shows you how to effectively coordinate multiple agents and pass data between them.
Basic Agent Chaining
The most common pattern is to pass the result of one agent as input to another agent. Since agents use result schemas, you can safely type and validate the data being passed between them.
Parallel Agent Execution
Sometimes you need multiple agents to work independently on different aspects of a task. You can run agents in parallel using programming primitives.
Dynamic Agent Creation
You can also create agents dynamically based on previous agent results:
Best Practices
When working with multiple agents:
- Clear Responsibilities: Each agent should have a clear, focused responsibility.
- Type Safety: Use result schemas to ensure type safety when passing data between agents.
- Error Handling: Consider what happens if one agent fails in a chain of agents. These failure modes are covered in the workflow section.
Was this page helpful?