Hypothetical scenario. Northwind’s support assistant retrieves passages near an employee’s question. The answer sounds fluent. Priya asks whether each passage belongs to that employee’s permitted view and whether it supports the claims the response makes.
Dev: “The nearest passages look relevant.”
Maya: “Relevance is useful only after the evidence is eligible for this reader and this question.”
Combine bounded serving with a versioned, permission-aware evidence path. Keep ingestion, retrieval eligibility and supported output distinguishable. This optional case has explicit GenAI prerequisites and its own collection-sizing assumptions; crawler rates do not carry over.
Background for this lesson
Your outcome is a complete read-only assistant design from ingestion to eligible evidence and supported output. This optional page requires the serving design, GenAI vectors and similarity, and retrieval-augmented generation. Those GenAI prerequisites sit alongside the core permission and versioning lessons. The selected collection below is a new sizing exercise; crawler collection rates do not carry over.
This final case designs a bounded read-only assistant. It can retrieve, explain and cite; it cannot edit documents, send messages or make business commitments. Those action capabilities need separate authority and recovery contracts. The design combines the system-design course with the GenAI course's evidence and runtime lessons.
Define the initial product outcome as an answer supported by eligible source passages, or an explicit limitation when the available evidence is inadequate. Do not promise universal factual correctness, immediate synchronization from every source, or permission safety from a model instruction alone.
Which answer evidence belongs to this reader?
A vector index can select similar passages without establishing access, current version, deletion status or sufficient evidence. A model can then produce a persuasive answer from the wrong material. Improving similarity does not repair a missing authorization boundary.
Index ingestion also fails independently from query serving. A connector can miss updates, a parser can omit tables and an embedding change can mix incompatible vector spaces. The service needs source identity, versioned transformations and visibility into the freshness of each collection.
Connect source authority to answer evidence
Ingestion records source identity, version, access scope and deletion state before deriving chunks and embeddings. A complete index version identifies the parser, chunking policy and embedding space. Switch query routing only when the intended collection is ready and retain a supported rollback path.
Query handling authenticates the reader, establishes permitted scope, retrieves candidates and expands eligible source passages. Lexical retrieval can preserve exact identifiers while embeddings capture a different similarity signal. Combining their rankings requires a declared fusion and evaluation policy; raw scores from unrelated systems are not automatically comparable.
The generator receives a bounded evidence set with stable source references. Validate output structure, citation targets and claim support separately. A valid citation URL does not establish that the linked passage supports the claim. Preserve the selected versions for authorized investigation under an explicit retention policy.
Carry permission and source revision through every derived view
Hypothetical scenario. Source document D has revision 12 and ACL version 8. Chunk C names both D and its source span. Lexical and vector indexes, reranker inputs and answer evidence retain that provenance. A high similarity score proposes a chunk; the application still must establish current permission and applicability before disclosure.
| Record | Versioned fields | Disclosure role |
|---|---|---|
| Source D | revision 12, ACL version 8 | Authority |
| Chunk C | D, source span, revision, transform | Derived evidence |
| Index generation | source watermark, ACL coverage | Candidate discovery |
| Answer manifest | source refs, policy, caller scope | Reuse / audit evidence |
A replacement index can contain complete text but stale ACLs. Its publication conditions must cover source revisions, withdrawals and permission interpretation, or rely on a separate current authority check at every disclosure path. That includes cached answers and derived summaries; their text can reveal a revoked source even after the source chunk is hidden.
Use an answer-evidence manifest naming eligible source revisions and the policy under which they were selected. A later permission change can invalidate reuse of that manifest. Keep response-cache equivalence tied to caller scope and evidence, not merely normalized question text. A read-only assistant still has disclosure effects and needs an unavailable or unsupported-answer outcome when current evidence cannot be established.
Treat retrieval as a versioned, permissioned projection
Priya's policy assistant needs an answer that belongs to the current reader and points to current evidence. A vector index is a derived representation of source material. Embeddings, chunks, lexical indexes, reranker inputs and answer caches all carry consequences of source identity and access rules. A nearest-neighbor result is a candidate; it is not proof that the reader is entitled to see the document.
The answer request should carry the authenticated reader context through each evidence-producing step. Filter or validate eligibility at the appropriate serving boundary, then preserve source version and chunk identity in the supplied context and citations. A cache key that includes the question but omits the authorization and evidence identity can return a previously valid answer to the wrong reader. Revocation and deletion are serving events, not merely background indexing work.
Separate the intervention from its evaluation. A new embedding model changes the representation space; a new chunking policy changes what evidence can be retrieved; a new prompt changes how that evidence is used. Compare the affected failure slices and preserve a rollback route with compatible artifacts. The complete design includes ingestion, retrieval, permission checks, generation, citations, operational budgets and evidence of accepted outcomes, rather than treating a successful demonstration answer as a release decision.
Derive storage, context and request demand
Hypothetical scenario. Choose 10,000 documents averaging 2,000 tokens of extracted content: 10,000 × 2,000 = 20 million source tokens. A simple chosen split uses 500-token chunks with no overlap, giving four chunks per document and 40,000 chunks. Real boundaries and overlap change that count.
Choose 768 coordinates per embedding and four bytes per coordinate. Raw vector payload is 40,000 × 768 × 4 = 122,880,000 bytes, or 122.88 MB. This excludes text, metadata, graph structures, quantization choices, replicas and index overhead. It is not a complete vector-store sizing result.
For one answer, choose six selected chunks of 500 tokens each: 6 × 500 = 3,000 evidence tokens. Add a chosen 1,000 tokens for instructions, question and retained conversation, plus a 1,000-token output allowance. The planned total is 3,000 + 1,000 + 1,000 = 5,000 tokens, before any additional serialization or tool content. Tokenization must be measured with the selected model's actual representation.
At a chosen 20 logical questions per second, input demand under this plan is 20 × 4,000 = 80,000 tokens per second, and maximum reserved output demand is 20 × 1,000 = 20,000 tokens per second. These are request budgets, not measured generation throughput or current provider pricing. Retries and evaluation calls add demand.
For a hypothetical 100-case review set, suppose 20 cases lack required eligible evidence, ten have adequate evidence but unsupported answers, and 70 meet the full rubric. The outcome is 70 ÷ 100 = 0.7 on this constructed set. It is not a claim of population accuracy. Overlapping failure categories would require different accounting, so these categories are explicitly disjoint.
In the wild: metadata filtering is an explicit retrieval feature
Amazon Bedrock documents retrieval and generation configuration, including metadata filtering. Such a filter is a mechanism an application can use; it is not an automatic translation of source permissions. Northwind still needs authenticated scope, correct metadata, current eligibility and a fail-closed path when required authority cannot be established.
Freshness and permission are serving decisions
A revoked document can remain in an old index or cache. Define a freshness objective for permission changes and decide whether source eligibility must be rechecked before passage expansion and answer delivery. If the permission service is unavailable, returning cached content may violate the contract even when retrieval latency looks healthy.
A useful answer cache includes identity, permitted scope, source versions and model or prompt version as relevant to its correctness. Semantic similarity between questions does not establish equivalent answers or equivalent access. Prefer an explicit miss over cross-scope reuse.
Rebuilding an embedding space requires compatible query and document representations. Run the new collection alongside the old, compare retrieval failures and switch atomically at the collection-routing boundary. Do not mix old and new vectors and assume their numerical dimensions make them comparable.
A stale index survives a permission change
Hypothetical failure scenario. A policy document becomes restricted, but the connector misses the permission update. A previously cached answer contains its content. A new reader asks a similar question, and the cache returns the earlier answer without evaluating current scope.
The failure is an authorization and derived-state problem, not simply a hallucination. Recheck permission-relevant eligibility, invalidate affected derivatives and record index freshness. Avoid placing sensitive retrieved text in unrestricted telemetry while investigating the incident.
Measure denied retrievals, stale source observations, ingestion lag and answer limitations separately from generic request success. Maintain a supported deletion and reindex procedure. A successful connector poll does not prove every source event was included.
Bring advanced capabilities under the same contract
Self-hosted generation introduces weights, request state, batching and admission constraints. Budget those resources as taught in the runtime lessons; raw embedding payload says nothing about generation memory. Quantization and parallelism are candidate implementation choices requiring quality and serving evidence.
An optional agent loop would add durable task state, authorized tools, stopping budgets and uncertain-action recovery. This read-only design does not inherit those capabilities by calling retrieval a tool. Anthropic's Building effective agents distinguishes predefined workflows from dynamically directed agents; use the simpler path when it satisfies the task.
Evaluation separates eligible retrieval, source support, answer usefulness, refusal behavior and permission failures. A model judge is an imperfect measurement instrument; calibrate it against a written rubric and human-reviewed cases. A single blended score can hide a serious failure category.
A gateway can enforce identity, budgets and routing, but cannot make model outputs safe by labeling them checked. A fallback model changes answer behavior and may require another evaluation. A gateway cache needs the same source and permission boundary as the primary path.
An expanded employee copilot would cross more source and action authorities. Add one capability at a time with its own contract. Do not promise arbitrary editing, multimodal interpretation or enterprise-wide permission synchronization merely because the read-only assistant has a complete diagram.
Follow the complete learning path for this same assistant: define acceptance, bound candidate fusion and reranking, compare outcomes, choose safe answer reuse, and reserve serving resources. Add durable action state only if the scope expands beyond answering. Each link develops a separate architectural decision rather than another competing version of the course.
Defend the release and rollback plan
Release a baseline that returns ranked source excerpts before adding generation. Evaluate whether synthesis improves the defined task and where it introduces unsupported claims. Compare changes on held-out cases and explicit permission and missing-evidence tests rather than only attractive demonstrations.
Retain versioned prompts, model configuration and index routing for rollback. Rollback cannot undo content already disclosed, so permission failures require immediate containment and investigation as well as configuration reversal. Bound retained evidence and restrict access to it.
Reject autonomous editing in the initial scope, unlimited history, cross-tenant semantic reuse and a universal answer-quality percentage. Estimate operating cost from actual request counts, measured token usage and verified prices when selecting a deployment; no price estimate here is presented as a current vendor quote.
Limits of this model
The collection and change counts are illustrative. Retrieval quality, source access, revocation propagation, model behavior and artifact compatibility require separate evidence. Permission filtering alone does not establish answer correctness, and a successful answer demonstration cannot certify the operated workflow.
Challenge the proposed mechanism
D is revoked during an index switch while a cached answer still quotes it. Which path must fail the review?
Reveal the design reasoning
The cache disclosure path, unless the declared authority rule still permits that exact reuse. Invalidate or reauthorize all derived answers and summaries, not only index hits. Preserve source and ACL evidence in the cutover test.
Decision and reconsideration: Publish indexes and answer reuse under explicit source and permission contracts. Keep this optional module independent from the core course.
Check the design against changed conditions
The new system answers more questions but exposes one restricted passage. Does the mean approve release?
Reason through the consequence
No. Permission is a separate required boundary. Contain the disclosure, investigate candidate eligibility and retained artifacts, and retest that failure category independently of answer usefulness.
A new embedding model has the same dimension. May it search the old vectors interchangeably?
Reason through the consequence
Dimension alone does not establish compatible representations. Build and evaluate compatible artifacts, preserve version identity and switch routing deliberately.
The product asks the assistant to edit a policy. Is that just another output format?
Reason through the consequence
No. Editing introduces action authorization, expected-version checks, durable effect identity, approval where required and recovery from uncertain writes. The next page designs that authority separately.
The read-only assistant can explain supported information without changing external state. Page 63 adds tool actions, where a model proposal must cross a separate authorization and effect boundary.
Northwind decision log
Bind every derived evidence artifact to source identity and eligibility.
Return a limitation when permitted evidence cannot support the answer.
Next, separate model proposals from authorized durable actions.
Go deeper: Evidence selection in an application
- Book chapter: Building LLM Powered Applications: chapter: Embedding LLMs within Your Applications — Valentina Alto. Use this resource to examine data connections and retrieval within an application.
- Book chapter: Building LLM Powered Applications: chapter: Building Conversational Applications — Valentina Alto. Use this resource to examine conversation evidence and non-parametric knowledge.
- Video lecture: Composite Indexes and the Faiss Index Factory — James Briggs. Use this resource to examine index composition without confusing candidates with authorization.
- Primary document: Configure queries and response generation — AWS. Use this resource to examine metadata-filter behavior before designing permission enforcement.