# Setup guide — AI Customer Support Agent

## 1. Download the starter and create an environment

Get this kit's bundle from its AgentKits page, then set up an isolated Python environment.

```
# Download this kit's bundle from its AgentKits page, then:
unzip support-triage-router.zip && cd support-triage-router
python -m venv .venv && source .venv/bin/activate
```

## 2. Install dependencies

LangGraph for orchestration, model SDKs, and a vector store for the knowledge base.

```
pip install langgraph langchain-anthropic langchain-openai chromadb pydantic httpx
```

## 3. Configure secrets and limits

Set model keys, helpdesk/CRM credentials, and the safety limits. The caps live in config, not in the prompt, so they cannot be argued away.

```
cp .env.example .env
# edit .env
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
HELPDESK_API_TOKEN=...
CRM_API_TOKEN=...
AUTO_REFUND_CAP_USD=50
MAX_TOOL_CALLS=6
AUTO_RESOLVE_CONFIDENCE=0.85
MODE=suggest   # suggest | auto
```

## 4. Ingest your knowledge base

Index your help center into the vector store so answers are grounded and citable. Re-run whenever docs change (or schedule it).

```
python ingest.py --source ./help-center --collection kb
# -> 'Indexed 412 articles into collection "kb"'
```

## 5. Run locally and test on real tickets

Start the agent in suggest-only mode and replay a few anonymized tickets to inspect decisions before going live.

```
langgraph dev
# in another shell:
python run.py --ticket samples/billing_double_charge.json --explain
```

## 6. Wire the helpdesk webhook

Point your helpdesk's 'ticket created' webhook at the agent endpoint. Keep MODE=suggest until QA on drafts/escalations looks good, then promote specific intents to auto.

```
# Zendesk example: Admin > Webhooks > new webhook
# POST https://your-host/agent/webhook  (HMAC-signed)
# Promote one intent at a time, e.g. password_reset, in config/intents.yml
```
