AI Capstone: Governed RAG Support Copilot
Build a support copilot that ingests approved tenant documents, retrieves authorized evidence, drafts cited replies, abstains when evidence is insufficient, streams provisional progress, and routes uncertain or sensitive cases to humans. The capstone is complete only when quality, safety, cost, latency, isolation, deletion, and provider failure are measured.
What will you be able to demonstrate?
- govern document ingestion and vector lineage;
- retrieve tenant-safe hybrid evidence and validate citations;
- integrate models through typed gateways and budgets;
- evaluate offline, canary online, and roll back every behavior version;
- provide meaningful human review and feedback.
What are the required product behaviors?
- Authorized upload enters quarantine, scanning, parsing, chunking, embedding, evaluation, and publish states.
- Every chunk retains tenant, document/version, access, source locator, and processing versions.
- Query path uses lexical plus vector candidates, authorization filters, fusion/reranking, bounded context, and citation tokens.
- The model returns a typed draft with claims/citations, confidence category, and abstention reason.
- Unknown citations, unsupported claims, unsafe content, and insufficient evidence cannot become an approved answer.
- Long work returns an AI-run operation; clients can poll or use resumable SSE.
- Every run records version set, retrieval references, latency, usage/cost, outcome, trace, and review state.
- Users can edit/approve drafts, inspect sources, report errors, and request source deletion.
- Provider, vector search, Redis, and queue failures produce tested degraded behavior.
What must the evaluation suite contain?
At least 100 cases divided into:
- common supported questions;
- exact identifiers and lexical-heavy queries;
- paraphrases and multilingual inputs relevant to the product;
- insufficient, stale, or contradictory evidence;
- cross-tenant and role-restricted sources;
- direct and indirect prompt injection;
- malformed structured output and invalid citations;
- provider timeout/refusal/rate limit;
- source update and deletion freshness;
- long context, noisy documents, and near duplicates.
Measure retrieval recall/ranking, filter correctness, citation support, groundedness, completeness, abstention, review acceptance/edit, latency percentiles, tokens/cost, and failure categories. Set hard zero-tolerance invariants for cross-tenant disclosure and unauthorized effect.
What experiments are required?
- compare two chunking strategies;
- compare lexical, vector, and hybrid retrieval;
- compare baseline and reranked candidates;
- compare at least two qualified model routes or one route versus deterministic fallback;
- measure context-size quality/latency/cost tradeoff;
- deliberately introduce a worse prompt and prove the release gate rejects it;
- re-index under a new embedding version, shadow-evaluate, switch, and roll back;
- delete one source and prove every derived representation disappears or becomes inaccessible.
What should not be automated?
The copilot may create drafts, not send external replies or alter account/refund state. Human approval occurs after the reviewer sees cited evidence and before any future sending tool. The capstone isolates RAG quality from agentic effects.
AI Pair-Programmer Prompt
Rubric
Pass: at least 85%, with zero cross-tenant disclosure, fabricated citation acceptance, or unapproved external effect.
Knowledge check
- Why evaluate retrieval and answer generation separately?
- What is the source of authority for a citation?
- Why does deletion include embeddings and caches?
Answers
- It reveals whether ingestion/retrieval or generation caused the failure.
- An accessible, versioned source passage supplied to the run and validated afterward.
- They are derived representations that can continue exposing the deleted source.
Completion checklist
Primary references