Enterprise knowledge: think like a staff engineer
- Source
- From the Staff AI System Design course
- By
- Sourav Banerjee
- Last updated
- 8 Nov 2026
Production Signals and Failure Diagnosis
Measure source-cursor lag, oldest ingestion-job age, parser failures, index publication lag, version mismatches, deletion lag, policy freshness, rejected context, empty authorised results, and per-query relevance. Separate “not ingested,” “not relevant,” and “not allowed” internally while keeping external error messages from revealing restricted document existence. Join source/version, job ID, and request ID in protected metadata traces.
If Alice receives an old policy, inspect the connector cursor, published version, and the final context citation before blaming generation. If the object exists but is not published, inspect the failed ingestion attempt; do not point readers to it manually. If new access rules are unavailable, apply the stated freshness/fail-closed policy. Never use a stale search copy as the sole authority for immediate revocation.
Limit ingestion file size, parse time, context tokens, and query length in the real API adapter. The fixture bounds source characters and final result count but does not implement production upload security, distributed storage, source authentication, or a tokeniser. A real search-service migration needs versioned indexes, alias/pointer cutover, deletion/ACL reconciliation, and rollback that does not revive restricted data. T18.7 will expand governance rather than retell this retrieval baseline.
Interview 1: Why Not Start With Vector Search?
Prompt: The corpus contains supplier IDs and explicit policy wording. Defend lexical retrieval first.
Spoken answer: “Exact identifiers and rule terms are valuable signals here. A lexical index gives us a simple, inspectable baseline with no embedding dependency. I would build an authorised relevance set and inspect paraphrase misses before adding semantic candidates. Hybrid retrieval can help recall, but it adds representation versions, fusion tuning, cost, and another operational path. None of those choices removes tenant or current-policy checks.”
Trade-off: Simplicity may miss reworded queries. Changed constraint: How would multilingual paraphrases change the evaluation and rollout plan?
Interview 2: What Is an Ingestion Success?
Prompt: Object storage succeeded but chunk publication failed.
Spoken answer: “Preserving bytes is not publishing a usable document. I keep the prior visible generation and fail or retry the durable job for safe processing. The orphan object is evidence and can be cleaned under policy later. Publication must establish a coherent chunk set and current pointer. A distributed object/search system needs explicit cutover and reconciliation; the local fixture’s database transaction is not proof of cross-service atomicity.”
Trade-off: Consistent visibility delays freshness. Changed constraint: When would partial per-page publication be acceptable, and how would the API identify it?
Interview 3: Where Do Permissions Apply?
Prompt: A result was permitted when retrieved but revoked before generation.
Spoken answer: “I recheck current trusted policy and version before constructing provider context, loading stored text rather than trusting a supplied hit body. Revoked material is removed. That protects the observed local policy boundary; it cannot guarantee awareness of an upstream revocation the connector has not delivered. I need a source freshness contract and a fail-closed policy for unavailable authority.”
Trade-off: Live policy checks add latency/availability dependence. Changed constraint: Explain how you would bound revocation delay if the source only supports hourly polling.
Interview 4: Can Citations Prove Correctness?
Prompt: Every generated sentence has a source ID. Is the answer trustworthy?
Spoken answer: “Source IDs provide traceability, not entailment. The chosen passage may be irrelevant, stale, incomplete, or misrepresented. I verify version/access before context leaves the app, evaluate retrieval separately from grounded answer quality, and preserve citations that resolve to the exact source generation. A missing authorised passage should produce a refusal rather than a fabricated policy answer.”
Trade-off: Conservative refusals reduce coverage. Changed constraint: If several readable policies disagree, what metadata and response behaviour would you require?
Key Takeaways
- Separate "not ingested", "not relevant" and "not allowed" internally, but keep external errors from revealing that a restricted document exists.
- If Alice gets an old policy, inspect the connector cursor, the published version and the final context citation before blaming generation. Never use a stale search copy as the sole authority for immediate revocation.
- Preserving bytes is not publishing. When chunk publication fails, keep the prior visible generation, fail or retry the durable job, and clean up the orphan object later under policy.
- Source IDs give traceability, not entailment. A cited passage can still be irrelevant, stale or misrepresented, so evaluate retrieval separately from grounded answer quality and refuse when no authorised passage exists.