# Setup guide — Community Question Triage Agent

## 1. Install and connect the community

Install the agent and connect your community platform and knowledge base.

```
pipx install community-triage-agent
community-triage-agent connect --platform discourse --kb ./help-center
community-triage-agent doctor
```

## 2. Configure safety & grounding

Safety-first routing and source-only answers are enforced here.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
ANSWER_FROM_KB_ONLY=true
SAFETY_FIRST=true
ESCALATE: [harassment, hate, harmful, self_harm]
```

## 3. Set routing & moderator targets

Define where things go.

```
# triage.yml
auto_answer_confidence: high
route: { billing: '#team-billing', bug: '#team-eng', default: '#community-mods' }
moderation_channel: '#mods'
crisis_escalation: human_immediate
```

## 4. Dry-run on past posts

Replay historical posts to check safety routing and answer grounding.

```
community-triage-agent backtest --range 30d --explain
# reports answer accuracy, fabrication rate (must be 0), safety routing precision
```

## 5. Wire into the queue

Route new posts through triage; abuse and safety go to humans.

```
# new post -> safety -> answer/link/route; abuse -> mods; crisis -> human now
```
