# AI Customer Support Agent

> An AI support agent that grounds in your KB and CRM, then resolves, drafts, routes, or escalates — with confidence thresholds, refund caps, and human review.

- **Category:** Support & Triage
- **Difficulty:** Advanced
- **Setup time:** 45 min
- **Stacks:** Claude, LangGraph, OpenAI
- **Version:** 2.0.0 (updated 2026-06-20)
- **Source:** https://agent-kits.com/kit/support-triage-router

## Overview

Turns an inbound ticket into a grounded, auditable decision: AUTO_RESOLVE, DRAFT, ROUTE, or ESCALATE — never a silent guess.

Answers only from retrieved knowledge-base and CRM context, so it cannot invent policies, prices, dates, or account facts.

Enforces hard guardrails: identity verification before account actions, refund/credit caps, PII redaction, and explicit escalation triggers.

Cost-aware by design: a cheap model classifies and routes, the strong model only drafts customer-facing replies, and tool calls are capped per ticket.

## When to use it

- You have a high volume of repetitive tickets (password resets, how-tos, order status, billing questions) that drain agent time.
- You have a real knowledge base and CRM/order system the agent can retrieve from for grounded answers.
- You want automation that drafts or resolves the easy 60–70% while reliably escalating the rest with context.
- You need an auditable decision trail for every ticket for QA, compliance, and trust.
- You want to start in suggest-only mode and graduate specific intents to full auto-resolve as confidence is proven.

## When not to use it

- You have no structured knowledge base — the agent will have nothing to ground answers in and should not be deployed in auto mode.
- Your tickets are dominated by legal, medical, or regulated financial advice that requires a licensed human.
- You need real-time voice/phone support — this kit targets text channels (email, chat, web forms, helpdesk).
- You are unwilling to keep a human in the loop for refunds, account changes, or low-confidence cases.

## Architecture

- **Ingestion & normalization** — Webhook from the helpdesk (Zendesk/Intercom/Front/email) normalizes the ticket into a canonical schema: channel, customer ref, subject, body, attachments, and prior thread. Strips signatures and quoted history to reduce token cost.
- **Classification (cheap model)** — A fast, low-cost model labels intent, sentiment, urgency, and language, and produces an initial confidence. This gates whether the expensive path runs at all and which retrieval queries to issue.
- **Grounded retrieval (RAG)** — Hybrid search over the help center plus structured lookups in CRM/order systems. Only the top, relevance-filtered chunks and the specific account facts needed are passed forward — never the whole knowledge base.
- **Policy & decision engine** — The strong model applies the system-prompt decision policy: confidence thresholds, escalation triggers, identity gate, and financial caps. It emits a single structured decision object.
- **Guarded action layer** — A deterministic executor validates every proposed tool call against policy before running it: verifies identity for sensitive actions, enforces refund caps, redacts PII, and requires human approval where configured. Invalid actions are downgraded to ESCALATE.
- **Human-in-the-loop** — Drafts and escalations land in an agent's queue with the full reasoning, cited sources, and suggested actions. Approvals (and edits) flow back as labeled training signal.
- **Observability & feedback** — Every decision is logged with inputs, retrieved sources, confidence, action, and outcome. Knowledge gaps (low-confidence, no-source tickets) are logged to drive KB improvements and intent promotion to auto-resolve.

## Files in this bundle

- `system-prompt.md` — the agent's system prompt
- `tools.json` — tool/function definitions the agent expects
- `workflow.md` — step-by-step run loop
- `.env.example` — environment variables to fill in
- `kit.json` — full structured metadata
- `starters/` — minimal starter snippets
- `LICENSE` — Apache-2.0 (code, configuration, and schema)
- `LICENSE-CONTENT` — CC BY 4.0 (specification text and documentation)
- `NOTICE` — attribution and trademark notice
- `run.py` — **runnable demo**: real agent loop with mock tools (`pip install anthropic`, set `ANTHROPIC_API_KEY`, `python run.py`)
- `agentaz.json` / `agentaz.schema.json` — AgentAz™ governance spec + schema

## Implementation notes

- Keep the safety limits (refund cap, max tool calls, confidence threshold, mode) in config and enforce them in a deterministic executor — never rely on the model alone to honor a money limit.
- Run in suggest-only mode first. Measure draft acceptance rate per intent, and only promote an intent to auto-resolve once it clears a quality bar (e.g. >95% approved-without-edit over a few hundred tickets).
- Ground or escalate: if retrieval returns nothing relevant above a similarity threshold, force grounded=false and escalate. This single rule eliminates most hallucinated 'policy'.
- Log every decision with its retrieved sources and confidence. Tickets that escalate for 'no source' are your KB backlog — closing those gaps is what raises automation rate over time.
- Use model tiering aggressively: a small model for classification and routing, the strong model only for grounded, customer-facing drafting. This is where most of the cost savings come from.
- Treat human edits as gold labels. Periodically review the diffs between drafted and sent replies to tune tone and retrieval.

## Variations

- **Basic — Suggest-only triage:** Classification + grounded retrieval that drafts replies and sets tags/priority for human approval. No autonomous sending, no money movement. The safest way to start and to measure quality.
- **Advanced — Selective auto-resolve:** Promote proven low-risk intents (password reset, how-tos, order status) to full auto-resolve with confidence gating, while everything involving money, accounts, or low confidence still drafts or escalates.
- **Enterprise — Governed multi-queue deployment:** Adds per-segment policies (VIP/enterprise routing), incident-aware escalation, full audit logging and PII controls for compliance (GDPR/CCPA), SSO-gated approvals, and a feedback pipeline that retrains retrieval and promotes intents automatically.

## FAQ

**How does it avoid hallucinating policies or prices?**

It is only allowed to state facts that appear in the retrieved knowledge-base or CRM context for that ticket. If retrieval returns nothing relevant, it sets grounded=false and escalates rather than guessing. Cited source IDs are required in the internal note.

**Can it issue refunds on its own?**

Only within strict limits enforced outside the model: the amount must be at or below your configured cap and match a documented refund policy. By default even within-cap refunds are staged for one-click human approval; anything above the cap or outside policy is escalated.

**What stops it from doing something risky for an angry customer?**

Escalation triggers. Strong negative sentiment, churn threats, enterprise accounts, legal/security/privacy language, and ungroundable claims all force an escalation with a clean summary — the agent will not invent compensation or callback SLAs to placate.

**How do you control cost at volume?**

A cheap model handles classification and routing; the strong model only drafts customer-facing replies. Tool calls are capped per ticket, retrieval is filtered to the top chunks, and the agent never re-queries the same thing.

**How do we go live safely?**

Start in suggest-only mode, review drafts and escalations, and promote one intent at a time to auto-resolve once it clears a quality bar. The decision log and human edits give you the data to do this confidently.

**Which helpdesks and models does it work with?**

It is channel- and model-agnostic. The reference build uses LangGraph with Claude/OpenAI and a vector store, and connects to common helpdesks (Zendesk, Intercom, Front, email) via webhook plus your CRM/order system through read-only lookups.


---

© 2026 AgentKits · www.agent-kits.com

**Open source.** Code, configuration, and the AgentAz™ schema are licensed under
**Apache-2.0**; specification text and documentation under **CC BY 4.0** (with
attribution to AgentKits, link to https://www.agent-kits.com). See LICENSE, LICENSE-CONTENT,
and NOTICE in this bundle. "AgentAz" and "AgentKits" are trademarks of AgentKits.

**Flagship reference blueprint.** View the source, AgentAz™ spec, and frozen v1.0 schema
in the public registry: https://github.com/agent-kits/agentaz
Original: https://agent-kits.com/kit/support-triage-router
