Skip to main content
You have: a booking task and group, from Book step by step. The caller says a colour went wrong, and a specialist takes the complaint down.

What you add

Two agents share one call. The concierge books. The complaint specialist records complaints. Both read and write the same CallState. In the shared package, add the specialist’s tool, prompt and plan. Robin stays the name the caller hears.
salon/agent.py
Add record_complaint to the registry in tools(). It uses the same locked number and an announce line. ComplaintRecord is its answer’s model, in salon/store.py.
salon/agent.py
Then replace concierge_plan with agents. It returns both agents as AgentSpecs, the same on LiveKit and Pipecat. Their plans share one set of tools, and registry.only(...) gives each agent the tools it may use. Each agent names itself, so a handoff event shows which one holds the call.
salon/agent.py
The specialist reuses VERIFY_CUSTOMER, so a complaint is written down only for a verified customer. Both agents answer on the framework’s own LLM, so neither spec has a model. They hold nothing of one call, so you build them once. A spec whose model reads the call, like the SLNG router, is built per call, after the state. Now run the two agents. A handoff is a tool the model calls. It returns the next agent.
In entrypoint() and bot(), start Concierge(state) or salon_flows(...) in place of the single agent. Add to the concierge prompt: “A complaint or a refund goes to to_complaints.”

Try it

Start the agent as before and book a haircut. Then say “My last colour went wrong, I want to complain.”
  1. Robin says “I’m sorry to hear that. Let me take this down properly.” The caller cannot cut that line off.
  2. The specialist speaks next. It is still Robin to the caller.
  3. Describe the problem. The specialist verifies your number if needed, says “Let me get that written down”, and records it.

Why it works this way

Each agent is its own AgentSpec, with its own prompt and its own tools. The specialist cannot book, and the concierge cannot write a complaint. Both share one call state, so the number the caller confirmed is not asked for again. A plain handoff often lets the next agent hand the call straight back, or lets it start before the caller heard the line. Here the line plays first, and the next agent speaks first.

What you have now

Next: Know the time

Read today’s date and the caller’s number before the greeting.
Go deeper: Handoffs.