Agentic Handoff Orchestration: How to achieve this in Pega

Handoff Orchestration is an important type of orchestration for complex business processes where the need for the correct expertise only emerges mid-process.

Let’s take an example of a case where a customer is complaining about a slow internet connection to the conversational agent. After a few messages it turns out to be the billing hold that throttled the line. The conversational agent cannot handle the issue and now it needs to be handed off to another agent for resolution.

Many service cases work this way. The right specialist isn’t known when the case opens and the problem shifts as details come in. With handoff orchestration, an agent can either resolve the case or pass it to a better-suited agent, one at a time until someone can close it.

Handoff Orchestration Pattern in Brief

You could also find the description of the handoff orchestration here.

As it is described by Microsoft, it is a ‘dynamic delegation of tasks between specialised agents’. This orchestration is also called routing, triage, transfer, dispatch or delegation.

In this orchestration, only one agent is active at a time. Agents do not run in parallel and full control moves from one agent to the next. Each agent decides for itself. It can resolve the task, or it can hand off when it reaches the limit of what it can do. The path through the agents isn’t fixed in advance. A human is the last stop. When no agent can help but the problem still matters, the case goes to a human support agent.

How this can be achieved in Pega?

Let’s take the same example of a Telecom customer support request.

Customer is having a conversation with the triage agent which handles common problems directly. When it is unable to find find resolution, it hands the case to a network, billing or account access specialist agents. Any specialist can hand on again and any can send the case to a human support agent. Case has the same objective from start to finish hence the customer sees one conversation and the case history records the transfers happening between different agents.

Orchestration Component Pega Building Block What it does?
Specialist Agents One stage per specialist agent (Triage, Network, Billing and Account), each with a GenAI Agent Step and its own tools Each agent sees only the tools for its domain, such as diagnostics, the billing API or the customer profile
Handoff decision Structured output from each agent. (e.g. ‘HandoffTarget’ a Pega text property) Returns the next specialist, or case is sent to resolve.
Routing Guard Decision table on ‘HandoffTarget’ Checks the agent’s choice against business rules and can override it
Transfer of Control Change Stage shape gives the case to the next specialist’s stage
Loop Guard ‘HandoffCount’ property Caps the number of transfers per case
Human escalation Assignment to the Customer support work queue The last stop when no agent can resolve the case

Below are the 3 stages (workflows) of how this can appear in a Pega case.

  1. Every stage opens with a utility step and reads the HandoffSummary, the short brief left by the previous agent.
  2. The stage’s Step Agent works the problem using its own tools. E.g. in the billing stage, the agent can only access billing related APIs and account history.
  3. A utility step stores the agent’s structured output in HandoffTarget and also updates HandoffSummary
  4. A decision shape checks HandoffTarget and decides whether the case needs closing or needs to be handed off to the next specialised agent.
  5. Utility step after that updates the number of times this handoff has taken place and a deterministic rule checks if this has crossed the limit.
  6. If the cap for the handoff has been crossed, the task is assigned to a human reviewer. If the cap has not been crossed, control is moved to the specialist agent.

Classifier or Handoff?

While this pattern is useful, it should be clear when this pattern should be used, because if it is clear which agent should work on the problem from the beginning, there is no need for hand-off and a simple classifier would do as well.

Event Use Classifier? Use Handoff?
Is the right specialist clear at intake? Yes, from the request type or channel No, it emerges during the conversation
Can the problem change mid-case? Rarely, then use classifier Often, then use hand off
What does a wrong route cost? Not much with classifier Tokens and processing at the specialist agent

Key Takeaways

  1. Use hand off orchestration when the right specialist only becomes clear as the case unfolds, and one specialist works at a time.
  2. Start with these guardrails – hand off cap, a short handoff summary and human assignment as the last stop. If most requests route correctly at intake, use a classifier instead.
3 Likes