Agent types
Pipecat Subagents provides three built-in agent types, each building on the previous:BaseAgent
Every agent extendsBaseAgent. It defines its own pipeline, manages its lifecycle, can hand off control to other agents, and can coordinate tasks with workers.
LLMAgent
LLMAgent extends BaseAgent with an LLM pipeline. You provide the LLM service and define tools via the @tool decorator — the framework handles the rest.
FlowsAgent
FlowsAgent extends LLMAgent with structured conversation flows via Pipecat Flows. You define nodes and transitions for deterministic conversation paths.
LLMAgent and FlowsAgent are covered in detail in the Fundamentals section. This guide focuses on BaseAgent and the overall system.The AgentRunner
TheAgentRunner is the entry point for every subagent system. It:
- Creates and manages the shared message bus
- Starts agent pipelines and manages their lifecycle
- Tracks agent readiness through a registry
- Coordinates graceful shutdown
AsyncQueueBus automatically — an in-process bus backed by asyncio queues. For distributed setups, you can pass a RedisBus instead.
Your first agent
Here’s the simplest possible subagent system — a singleBaseAgent running a complete voice pipeline:
Running the agent
To run the agent, create a runner, add the agent, and callrun():
end() or cancel() is called. In this case, the agent calls self.end() when the client disconnects.
Lifecycle hooks
BaseAgent provides hooks you can override to react to lifecycle events. Always call super() in your overrides:
Adding child agents
Agents can have child agents. This is how you build multi-agent systems — the main agent adds LLM agents as children:@agent_ready or call watch_agent() explicitly.
What’s next
A single agent works, but the real power comes when multiple agents coordinate. Next, let’s learn how agents transfer control to each other.Agent Handoff
Activation, deactivation, and seamless control transfer