Page 6 of 8~144 min topic

Capstone: support bot with RAG + tools

Instrument metrics and rollout decisions

Metrics for unauthorized_tool_calls == 0 and citation_rate ≥ 0.9 must distinguish bad input from component failure for customer asking where order A12 is without leaking other customers' orders.

~18 min this pageObservability

1Try it yourself

Playground

Support bot: RAG + tool

Retrieve policy text, optionally fetch live order status, then answer with citations.

User: Can I refund order #8821 on my annual plan?

  1. Retrieve FAQ chunk
  2. Call order lookup tool
  3. Generate cited reply

2Learn the idea

Read

Golden signals for this system

Instrument support API: versioned policy retrieval + scoped order tool + cited answer or escalate so customer asking where order A12 is without leaking other customers' orders can answer: demand, errors, latency/age, saturation. Emit fields needed by unauthorized_tool_calls == 0 and citation_rate ≥ 0.9 with bounded labels. Sample successful high-volume traces; keep errors and rollout transitions denser within policy.

Read

Alert path worth paging

Define at least one alert that would fire for CAP-SUPPORT-TOOL-09, with a for/pending window that survives deploy blips. Missing scrape or missing revision labels must not look like health. Include a trace/log example id format you will actually search.

Read

Implementation artifact

log.info("support_turn", { traceId, tool, allowed, citations: citations.length });

Read

Tests for telemetry

Add a unit/integration check that metrics increment on the happy path and on the model passes attacker order_id and tool executes branch. Store machine-readable output in CI artifacts when practical.

Read

Stage depth

Cardinality discipline: tenant and revision are usually enough; raw question text is not a label. Exemplars or trace links beat screenshots alone when debugging CAP-SUPPORT-TOOL-09. Define who owns alert fatigue review. If you export to a vendor, record retention and access. Synthetic probes should use non-sensitive fixtures and still exercise POST /v1/support/turn. Practice the query you will type at 2am once, while calm.

Read

Field notes for `capstone-support-bot` / `observability`

Document the exact PromQL or log query in the runbook stub for this service. Verify histograms have buckets around your SLO target. Add a canary synthetic check that exercises the oracle path every few minutes in staging. Confirm that PII redaction happens before export. Track build/version as a label on the golden signals. Delete noisy debug logs before they become accidental product dependencies. In this chapter the product is support API: versioned policy retrieval + scoped order tool + cited answer or escalate, the human stakeholder is customer asking where order A12 is without leaking other customers' orders, and the incident id you design against is CAP-SUPPORT-TOOL-09. Re-state the oracle in your notes — order lookup returns status+policy cite; cross-customer order_id → deny+escalate — and keep the invariant visible: tool args bind to session customer_id; refunds never auto-executed. Track unauthorized_tool_calls == 0 and citation_rate ≥ 0.9 as the scoreboard. Surface under change control: POST /v1/support/turn. If you only have forty minutes, finish the fixture for model passes attacker order_id and tool executes before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Go deeper

Before you start

Why this matters

Name the dashboard row or log line customer asking where order A12 is without leaking other customers' orders opens first during CAP-SUPPORT-TOOL-09. It must include a correlation id and a bounded label from unauthorized_tool_calls == 0 and citation_rate ≥ 0.9. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.

Capstone metrics (unauthorized_tool_calls == 0 and citation_rate ≥ 0.9) appear in the final evidence pack.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Can you jump from alert to CAP-SUPPORT-TOOL-09-class evidence?
2. Do labels stay low-cardinality?
3. Is missing telemetry treated as hold?

All responses are required.