Why an old document can be worse than no search result

RAG is often described as a short chain: load documents, split them into chunks, create embeddings, retrieve relevant passages, and ask a model to answer with citations. But between “the document was added” and “the answer really uses the current approved revision” lies another engineering task: knowledge lifecycle management.

Imagine a shared folder containing “Policy_final.docx,” “final_2.docx,” and a newly approved version. All three texts are semantically close. Vector search may choose the old procedure because it matches the wording of the question more precisely. The model will cite the retrieved passage neatly—and be just as neatly wrong.

This is not only a generation-quality problem. Even a stronger model cannot fix the fact that an old revision entered the index while the new one did not, or failed to replace it. RAG should therefore be designed not only as search, but as a managed pipeline for updating sources.

What research and documentation tell us

Li and colleagues’ paper, “Language Modeling with Editable External Knowledge,” studies an approach in which new information is not merely added: older knowledge-base entries can also be incrementally rewritten or deleted. On two datasets involving streams of news articles and conversations, the authors report accuracy improvements over conventional RAG on particular experimental models. This supports the idea that knowledge-base updates are an engineering problem in their own right, not a secondary admin-console button. It does not promise the same gain on a company corpus; it must be tested on target data and questions.

A practical example appears in Azure AI Search documentation. During incremental indexing, the service uses a marker for the last processed record and a change-detection mechanism. Deletion detection is separate: in the documented scenario, the indexer does not track an object’s deletion on its own, so cleaning the index requires a soft-delete policy. Details depend on the chosen storage and search stack, but the broader lesson is simple: “we index on a schedule” does not yet mean “stale content disappears.”

A minimal document model

For each source, keep a small set of fields in search metadata, a catalog table, or a separate registry:

  • `document_id` — a stable ID for the logical document, independent of filename or URL.
  • `source_id` — the source system and path, so an owner can be found and processing can be recovered.
  • `revision` or `content_hash` — a version or content fingerprint. A hash helps detect changes, but does not prove a revision was approved.
  • `status` — for example, `active`, `superseded`, `deleted`, or `processing`.
  • `valid_from` and `valid_to` — the period during which a revision applies, if the document has an effective date.
  • `updated_at` and `indexed_at` — when the source changed and when it was successfully processed.
  • `parser_version` and `embedding_model` — versions of the components used to create chunks and vectors.

Each chunk should point to a `document_id` and a specific `revision`. A file link alone is not enough: after its contents change, the link may point to different text than the passage that was retrieved. Add an owner, department, and access classification if needed. Authorization, however, is a separate mandatory control: ranking metadata does not replace access checks.

Three events: add, change, delete

The pipeline becomes more reliable when each event has explicit behavior.

A new document

1. Register a stable ID and source.
2. Validate the format, extract text, and record parser errors.
3. Split the text into chunks sharing the document and revision IDs.
4. Write chunks and vectors, then mark the revision active.
5. Run a control query and confirm that it cites the new revision.

A changed document

Keep revisions if the source supports them. Process the new revision separately and switch its status only after successful indexing. This avoids leaving users without an answer if the parser or embedding model fails temporarily.

Two replacement patterns are straightforward:

  • **Prepare, then switch.** Index new chunks as `processing`. After validation, mark the new revision `active` and the old one `superseded`. Search filters for active revisions.
  • **Delete old and rebuild.** Delete all chunks for the `document_id`, process the new revision, and put it back in the index. This is simpler, but a failure creates a window when the document is unavailable.

For a small corpus, the first pattern is often more convenient. A simple prototype may use the second if the owner understands and accepts possible downtime. The key is not to mix half of the old revision with half of the new one. Make switching atomic at the status or ID-set level.

A deleted document

Deletion from the source folder should create an explicit deletion event. Remove all related chunks, vectors, search records, and caches, or mark them deleted so queries cannot return them. If a document expires, a soft status may be enough, but search must still exclude the record.

Do not rely only on a file’s physical absence. An incremental loader may see new and changed records yet fail to learn that a file disappeared if the connector does not send a tombstone or deletion flag. Update the search index first, then physically remove the original if that is what the synchronization mechanism requires.

A synchronization pattern for a small company

Not every business needs complex event streaming. A controlled process is enough to start:

1. **Registry.** A scheduled job lists documents in a selected folder or system and compares IDs, modification dates, and hashes with the index catalog.
2. **Processing queue.** New, changed, and deleted sources receive separate states. One file’s failure should not cancel the entire synchronization run.
3. **Revision processing.** Extraction and chunking happen in a temporary set. Store the name, revision, language, date, and parser-validation result.
4. **Publication.** Only a successfully processed version becomes searchable. Old chunks are deactivated or removed.
5. **Reconciliation.** Daily or weekly, compare the actual source inventory with the registry. This catches missed items, manual deletions, and schedule failures.
6. **Exception report.** The owner sees what did not update, when it happened, and which step failed.

If a system has an API, change events are convenient. Without one, compare lists and hashes every few hours. Choose frequency based on how quickly the knowledge changes: a price list or support procedure needs a short delay; an archival guide may be indexed daily.

Set a maximum lag separately—for example, an approved change should appear in answers no later than two hours later. This is not a universal norm; it is an internal SLA to agree with the process owner.

Checks before a user finds the issue

Prepare a small set of control documents and questions:

  • after changing a test figure in a procedure, a question should return the new value;
  • after deleting a document, search should find none of its old revisions;
  • after a failed processing run, the state should be visible and behavior should match the policy: keep the old revision or temporarily abstain;
  • after changing a parser or embedding model, new and old indexes should not be mixed;
  • after restoring a document, check whether it is reindexed and whether the owner allows it.

Metrics should reflect freshness, not only response speed: time from approval to search availability, synchronization errors, documents stuck in `processing` too long, chunks without an active parent, and the share of test answers citing an outdated revision.

Caching needs the same discipline. A cache key should include the document ID and revision, or the cache must be invalidated when a source changes. Otherwise, the index may be current while the user still receives yesterday’s result—a small time machine that management never approved.

Risks and economics

Versioning and deletion add components: a registry, statuses, an error queue, and checks. They require team time. But for internal procedures, the cost of a stale answer can be higher: an incorrect price, outdated warranty term, or cancelled process may cause rework, refunds, or a customer dispute.

There is no need to build a universal knowledge-management platform immediately. Choose one frequently changing source set and measure:

  • how many sources it contains and how often they change or are deleted;
  • what synchronization lag the owner can accept;
  • what happens if the new revision fails to parse;
  • whether the source and revision can be traced from an answer;
  • how much manual work regular reconciliation takes.

If there are few documents, a scheduled job and revision table may be enough. If changes are frequent, sources are numerous, and answers affect money or commitments, event-based synchronization and separate quality checks may pay off. Choose architecture based on the cost of a stale answer, not the number of fashionable components.

Where to start

Choose one process, such as the sales team’s instructions or a service team’s knowledge base. Record the currently approved revision, select three questions with verifiable answers, and make a test change to a document. Then inspect the entire path: source, queue, parser, index, retrieval, answer, and revision link.

The first pilot should answer not “How smart is our bot?” but the more practical question: “How quickly does it stop citing a cancelled procedure—and can we prove it?” If the robot intern carries archive folders back to the user again, the usual culprit is not the intern’s enthusiasm but a forgotten procedure for withdrawing old revisions from search.