How to update a RAG when documents change: synchronization and deletion

Published on 2026-11-16 by ArduBot

Guide to keeping a RAG index up to date using hashes, incremental synchronization, versioning, deletions, and idempotency.

A RAG system doesn't fail only because it searches poorly: it also fails when it finds information that should no longer exist. Document changes make synchronization a central part of the product, not secondary maintenance.

The problem of outdated versions

Suppose a company changes its return policy on Monday. The system extracts the new PDF, but keeps the fragments from the previous one. When asked about the deadline, the search may return both. The model could even combine them and create a rule that never existed.

The correct update requires identifying which document changed, which fragments belong to its previous version, and which version is currently in force. The index must be able to answer which source originated each fragment.

Minimum identifiers and states

Each source needs a stable source_id, type (PDF, URL, CMS), version or hash, last check date, status, and owner. Each fragment should refer to its source_id and version_id.

A simple flow:

Detectar cambio -> comparar hash/version
  -> si no cambió: terminar
  -> extraer y validar contenido nuevo
  -> indexar nueva versión en borrador
  -> comprobar calidad
  -> activar nueva versión y retirar la anterior
This mechanism prevents a processing error from deleting a useful version before the new one is ready. At small volumes this can be resolved with transactional operations or well-defined states; at larger scales, reconciliation between storage, queues, and index is needed.

Four different events

Add: a new document appears and its origin is registered.

Modification: they change title, text, or permissions. What is affected must be updated; permissions may require changes even if the text is identical.

Deletion: content and related indexes are removed according to the retention policy. It is not enough to delete the panel row.

Temporary failure: a website returns 503 or an integration loses access. It should not be automatically interpreted as “the document was deleted”.

For external connectors, separate “I could not read it” from “the owner deleted it”. The second case may require a confirmed deletion signal.

The hidden cost of reindexing everything

If two documents change out of ten thousand, reprocessing them all multiplies OCR, embedding generation, and storage work. An incremental synchronization with hashes can save operations, although cases where the extractor or the embedding model changes must be managed: those changes can indeed justify a general reindexing.

Plan an index migration procedure and a way to roll back if search gets worse.

How to verify that it is up to date

Keep automated tests: one question whose answer changed, another about a withdrawn version, and another about a document with new permissions. Check that citations point to the active version. Add metrics for “time from edit to query availability”, synchronization errors, and pending documents.

Proposal under study: an automatic RAG for ArduMaker would make sense if it handles not only the initial load, but also this synchronization. Does your content change daily or once a month? Explain it in ArduMaker.

Sources: Azure AI Search and RAG · Knowledge Bases de AWS.

  • RAG
  • sincronización
  • indexación
  • documentos
  • versionado

Keep reading

All articles · VPS plans