Skip to main content
Back to how-to guides Use this pattern when the target agent needs the reason for the handoff, but not the full conversation.

Concept

SUMMARY is text that you write in the route. It is not a summary that the platform generates. The runtime fills the {{variables}} in your text with the calling agent’s values and sends the result to the target as _handoff_summary. The target model reads it as context. The summary and the history setting work together. HISTORY decides whether the target also gets raw messages. See Choose the right history strategy for handoff. Write the summary for a reader who has not seen the conversation. State who the customer is, what they want, and what is already done.

Minimal working example

A billing router gathers the account number and the disputed amount. It sends a one-line brief and no raw history. The specialists are short stand-ins in the same project. Replace them with your real agents. agents/billing-hub.agent.abl
agents/dispute-agent.agent.abl
agents/payment-plan-agent.agent.abl
Variable sources:
  • account_id and disputed_amount are GATHER fields of the router. PASS copies them. The summary text reads the same router values.
  • dispute_reason and installments are gathered by the specialists.

How it works

  1. The router selects a route.
  2. The runtime replaces each {{variable}} in the summary with the router value. A variable with no value becomes an empty string. No error occurs.
  3. The runtime stores the result as _handoff_summary in the target context and authorizes it for the target prompt.
  4. The runtime applies the HISTORY setting. With summary_only or none, the target gets no raw messages.
Rules that apply to the summary:
  • A routing model cannot supply _handoff_summary. Only the SUMMARY text in the route sets it.
  • The summary is a template. It does not change between conversations except through its variables.
  • The shorthand SUMMARY: takes a one-line quoted string. For several lines, use summary: | inside a CONTEXT: block, as the payment plan route does.
  • In a DELEGATE, SUMMARY is a synonym for PURPOSE. A delegate does not use it as a history summary.
How HISTORY: auto decides:
  • If the route has a non-empty SUMMARY and the target runs on a model, the runtime sends the summary only.
  • If the target does not run on a model, the runtime sends the last 5 messages.
  • If a pipeline short-circuit triggers the handoff, the runtime sends the last 5 messages even when a summary exists.

Common variations

Summary with a bounded window of messages

Keep the summary and add the last few messages when the target needs the customer’s exact words.
This is a section snippet. It needs the router GATHER fields from the minimal example. last_5 and the block form mode: last_n with count are equivalent.

Summary on a returnable handoff

A child that returns control also gets the summary. Use it to state the one job the child must finish. See Transfer control to another agent and return later.

Summary that carries a fixed instruction

A summary can hold fixed text and no variables, as in “Identity is already verified in this session.” Use this for facts the router knows from its own flow. Do not use the summary to grant permissions or skip checks. The target must verify any fact that affects authorization.

Verification

  1. Run the validator. Expect no errors and no warnings.
  2. Send “I want to dispute a charge” and answer the router questions.
  3. Expect a handoff trace event with to: Dispute_Agent.
  4. Expect the target context to include _handoff_summary with the account number and amount filled in.
  5. Expect Dispute_Agent to ask only for the dispute reason.
  6. Send a payment plan request. Expect the history: auto route to send the summary and no raw messages, because Payment_Plan_Agent runs on a model.
  7. Remove SUMMARY from the first route. Expect the warning HANDOFF_SUMMARY_ONLY_WITHOUT_SUMMARY.

Production readiness checklist

  • Each route that uses summary_only or auto has a SUMMARY.
  • Each variable in the summary exists in the calling agent.
  • The summary holds no data that the target must not see. See Minimize context for privacy and compliance.
  • The target does not depend on facts that only the raw conversation held.
  • Tests cover a filled summary and a summary with a missing variable.
  • Trace checks confirm the summary text on each handoff.

Common mistakes

Troubleshooting

Related articles: