Skip to main content

Agent types

Pipecat Subagents provides three built-in agent types, each building on the previous:

BaseAgent

Every agent extends BaseAgent. 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

The AgentRunner 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
When you don’t provide a bus, the runner creates an 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 single BaseAgent running a complete voice pipeline:
This looks similar to a regular Pipecat pipeline — and that’s the point. A single agent wraps a standard pipeline with lifecycle management.

Running the agent

To run the agent, create a runner, add the agent, and call run():
The runner blocks until 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:
When the parent shuts down, children are shut down too. To get notified when a child agent is ready, use @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