Retrieval and RAGAccess, completeness and answerabilityStaff
What can an assistant conclude when a SQL replica reports zero incidents but search finds incident notes?
By Amit Kumar3 min readWorked answer includedReviewed 27 Sept 2026
The question
Interview question
An approved SQL replica returns zero severity-one incidents for account A this morning. Search finds two accessible notes that may describe incidents. Explain what is known now, investigate identity, classification and freshness on both paths, and define evidence needed for a positive or complete negative answer. What changes if the notes are restricted?
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
It can say the sources disagree, with their cutoffs and scope, and avoid an unqualified “no incidents.” A zero from SQL is a statement about the rows visible to that query under its filters at one point in time. It is not proof that the real-world set was empty. A search hit is evidence that a note exists, not proof the note describes a qualifying severity-one incident for this account. The note could be a drill, a duplicate, an incident later downgraded, or a page mentioning account A as background.
I would inspect both paths at the decision boundary. For SQL: primary or replica, last replayed source position, transaction snapshot, tenant and ACL filters, severity definition, account mapping and event-time range. A replica can lag behind the primary even if its query finishes quickly. For search: source document ID, incident ID if present, revision, source event time, ingest and refresh status, and whether the note is accessible to this manager. PostgreSQL documents WAL replay positions on standbys, and Elasticsearch documents that indexing and search visibility have a refresh boundary. Neither timestamp by itself establishes that both systems contain the same incidents.
The next move is to reconcile identities and meaning, preferably through the authoritative incident system or an API with a defined completeness watermark. Do the notes correspond to incident IDs that should exist in the SQL population? Were they created after the SQL replica's replay cutoff? Did the SQL query exclude a linked account or a severity transition? Were the notes indexed before the structured incident was committed? If I can confirm a qualifying incident in the authority, say so and cite its record. If I can confirm the notes are drafts or drills and SQL is complete through the requested interval, explain why they do not count. Until then the precise answer is that zero is not established, with the two candidate notes described as unverified rather than silently counted.
A useful contract for negative answers has more than a successful query. It specifies the population, predicate, access scope and a completeness boundary that covers the requested time. If the source cannot attest completeness through this morning, phrase the result as “no qualifying rows visible through [cutoff]” and do not turn that into “none occurred.” For a high-stakes operational decision, route the disagreement to an incident owner instead of letting the model choose the source that sounds most confident.
What if the manager only has permission to see the SQL records and the notes are restricted? The assistant must not leak the notes or even a sensitive incident's existence through the explanation. It can give the authorized result with its coverage limit and follow a permitted escalation path for the inconsistency. RAG found five rows. Can it answer how many accounts breached a limit? asks why five retrieved notes cannot count a complete population. Here we have an explicit contradiction between two serving views, so the important skill is reconciling a negative claim against positive but not yet verified evidence.
Related questions
- How should retrieval find authorized evidence when the strongest global hits are restricted?Staff
- What may an assistant claim when a required policy source times out but other searches return results?Principal
- Why can filtered approximate vector search miss permitted results, and how would you fix it?Principal
Keep practising retrieval and rag
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux