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

Production5 min readFirst readTools & Routinginterrupt(): Approval Gates

After this section you can

  • Assemble tools, a router, an approval gate and a checkpointer into one runnable agent
  • Gate on the dangerous tool instead of on every turn
  • Name the four changes that take this example to production
06

Worked Example: Support Triage Agent

One file, sixty lines: two tools, a router that knows which of them is dangerous, an approval gate on the expensive one, and a checkpointer so the pause survives a restart.

THE CENTRAL IDEA

Gating every tool call trains reviewers to click approve. Gate on the tool, not on the turn: reads run free, writes stop. The router is the only place that knows the difference.

One router, two classes of tool — only the expensive one stops for a human
START agent picks a tool route gated tool? gate interrupt() ToolNode lookup + refund END issue_refund lookup_order no tool calls — the agent answered approve reject → back to the agent with a refusal result

Related

More in LLM & Agentic

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

Unlock Premium