What you add
Two agents share one call. The concierge books. The complaint specialist records complaints. Both read and write the sameCallState.
In the shared package, add the specialist’s tool, prompt and plan. Robin stays the name the caller hears.
salon/agent.py
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
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
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.
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.”- Robin says “I’m sorry to hear that. Let me take this down properly.” The caller cannot cut that line off.
- The specialist speaks next. It is still Robin to the caller.
- 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 ownAgentSpec, 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.