Add support-agent example: mock customer-support agent
Demonstrates two harness surfaces the previous examples skipped: - SkillProvider: KB articles in examples/support-agent/kb/ are exposed via runtime.SkillProvider. The runtime auto-registers load_skill and inlines a compact article index into the static (cacheable) system prompt; full bodies load on demand. - PermissionChecker: tickets_update and escalate_to_human are gated on a 'supervisor' flag. FilterToolDefs hides the gated tools from the LLM tool list in non-supervisor mode so it doesn't waste turns inventing calls that would just be denied. Five concrete tools (kb_search, tickets_get, tickets_create, tickets_update, escalate_to_human) plus the auto-registered load_skill. Five seed KB articles cover refund policy, escalation matrix, account recovery, password reset, and API rate limits — chosen to exercise the common support patterns each tool involves. In-memory ticket store (examples/support-agent/store.go) seeded with four tickets in different states. Webhook delivery for escalations is optional via SUPPORT_AGENT_WEBHOOK; when unset the tool prints the escalation banner to stdout, so the demo runs with only ANTHROPIC_API_KEY set. Tests (support_test.go) cover store CRUD, defensive copying, the permission checker's read/write split, and KB indexing/search — all offline, no API needed.
This commit is contained in:
1 parent
152f653dd7
commit
8ed38d7b66
12 files changed
+1368
-2
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# Escalation Matrix
|
||||
|
||||
Use `escalate_to_human` (supervisor mode only) when one of the
|
||||
following thresholds is hit. The agent should still file a ticket
|
||||
first so the human has context on landing.
|
||||
|
||||
| Trigger | Priority | Route to |
|
||||
|----------------------------------------------------------|----------|-----------------|
|
||||
| Account compromise / suspicious logins | urgent | Security |
|
||||
| Chargeback threat or legal language ("lawyer", "sue") | urgent | Billing + Legal |
|
||||
| Reported data loss or accidental deletion | urgent | On-call SRE |
|
||||
| Service downtime claim with customer impact > 1 hour | high | On-call SRE |
|
||||
| Refund request > $100 outside the discretionary window | high | Billing |
|
||||
| Customer explicitly asks to speak to a manager / human | high | Senior support |
|
||||
| Repeated (3rd+) ticket for the same root cause | medium | Tier 2 |
|
||||
|
||||
## Escalation note conventions
|
||||
|
||||
When escalating, add an internal note that includes:
|
||||
|
||||
1. **One-sentence summary** of what the customer wants.
|
||||
2. **What you've already tried / verified** (e.g. "confirmed propagation
|
||||
delay via /status endpoint at 14:32 UTC").
|
||||
3. **The KB article(s)** you cited.
|
||||
4. **Anything the customer was promised** ("told them we'd respond
|
||||
within 30 min").
|
||||
|
||||
Format: `ESCALATION: <one-line summary> | did: <…> | promised: <…>`
|
||||
Reference in new issue
Block a user