1:1 mentoring with Big Tech AI engineers
LLM & Agentic

Worked Example: Support Triage Agent

A complete runnable LangGraph agent in sixty lines: two tools, a router that knows which is dangerous, an approval gate on refunds, and a checkpointer so the pause survives a restart.

Last updated

Production11 min readFirst readTools & Routinginterrupt(): Approval Gates

After this section you can

  • Assemble tools, a router, a review node and a checkpointer into one runnable agent
  • Gate on the dangerous tool instead of on every turn, and keep every tool_use answered
  • List the changes that take the example to production and why each is needed
39

Worked Example: Support Triage Agent

One file, about sixty lines: two tools, a router that knows which one moves money, a review node that pauses for a person, and a checkpointer so the pause survives a restart. Built from the pieces in the last four sections.

Key idea

Gate the one tool that moves money. Lookups run free and refunds wait for a person, so reviewers see only the decisions that matter. The router is the one place that knows the difference, and the review node turns a person’s verdict into the next edge.

One router, two classes of tool: only the one that moves money stops for a person
START agent claude-opus-5 route review interrupt() tools ToolNode END issue_refund lookup no call approve edit or reject: a ToolMessage that says what the reviewer did tool results go back to the agent reads run free, money waits for a person

Related

More in LLM & Agentic

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium