AI Foundations for Developers COURSE·LESSON 39 OF 410 completed

Capstone: Design a Grounded Support Assistant

The product contract

Build a miniature Acorn policy assistant. A user asks a question; the application retrieves authorized passages and shows traceable evidence. When a question has no matching evidence, it abstains. The core lab runs locally with Python's standard library and requires no model download, external service, or API key.

This first implementation is a deterministic retrieval baseline. It is not a real language model or a substitute for semantic search. Building the baseline first lets you evaluate evidence selection and access boundaries before introducing nondeterministic generation.

The small source collection

Use three public policies and one staff-only document. Each record has a stable ID, title, audience, version, and text. Public sources cover refunds, password recovery, and exports. The staff source exists specifically to verify that an ordinary user never receives it.

text
refund-v2 / public
Standard purchases qualify for refunds within 14 days.
Custom orders are excluded.

account-v1 / public
Use the password reset link to recover an account.
Support never asks for your password.

export-v1 / public
Workspace owners can download CSV exports from settings.

staff-v1 / staff
Internal incident-response contact information.

Architecture

Rendering diagram…
flowchart TD
  A[Question and authenticated audience] --> B[Validate input]
  B --> C[Filter authorized documents]
  C --> D[Rank lexical matches]
  D --> E{Relevant evidence found?}
  E -->|No| F[Explicit abstention]
  E -->|Yes| G[Return source excerpts]
  G --> H[Optional model adapter]
  H --> I[Validate citations and claims]
  I --> J[Answer or review]

Acceptance cases

  1. “Refund policy” returns the refund source and preserves the custom-order exclusion.
  2. “Reset password” returns the account source.
  3. “Download CSV exports” returns the export source.
  4. A public user asking for internal incident information cannot retrieve the staff source.
  5. A question about lunar weather abstains.
  6. Empty or excessively long input fails validation.

These are initial fixtures, not enough evidence to claim production readiness. Add paraphrases, mixed topics, misspellings, language differences, and adversarial inputs before trusting a larger system.

Design decisions to write down

Keep retrieval deterministic and return excerpts verbatim. Do not infer whether an individual purchase qualifies without verified purchase details. Do not issue refunds. Distinguish permission to read a document from relevance to the question. Make source version changes visible.

Checkpoint with answers

Why include a staff-only document in a tiny lab? To make the authorization boundary observable and testable.

Does a lexical match answer every question containing the word refund? No. It selects possibly relevant evidence. A question about an unstated exception still needs abstention or review.

What improves after adding a model? Potentially paraphrase handling and explanation quality. The source-access rules and evidence checks remain application responsibilities.

Learn at your own pace0 / 41 lessons complete