AI support agent that escalates

A two-tier agent on the Anthropic API: a fast model routes, a larger model reasons only when needed, answers are grounded in real help content, and clear rules hand off to a person.

Problem

Support questions ranged from quick lookups to multi-step account problems. Running one large model for everything was slow and expensive, and a chatbot that guesses is worse than no chatbot.

What I built

A two-tier agent on the Anthropic API.

  • A small, fast model reads each message and routes it.
  • A larger model handles the reasoning only when it is needed.
  • Retrieval grounds answers in the real help content, so the agent cites actual policy instead of inventing it.
  • Tool calls handle account lookups against the storefront API.
  • Clear handoff rules pass the conversation to a person when the agent is not confident.

Delivered with a full-stack demo storefront (React, FastAPI, SQLite) and an Intercom-style embedded chat widget so the whole flow could be exercised end to end.

Why no framework

Built directly on the API with no framework layer, which keeps it easy to debug and cheap to run. Every prompt, tool schema and retry decision is visible, so a bad answer traces back to a concrete request.

Outcome

In production. Client work, so the code is private. I’m happy to walk through the architecture on a call.