Skip to main content
Cognee keeps the current state of memory and records how it changed. Every node carries a version counter and created_at / updated_at timestamps. Conflict review keeps outdated facts in the graph and marks them superseded instead of deleting them. An opt-in provenance ledger records when, by whom and in which run each document was stored, and when it was deleted. Cognee does not keep old copies of nodes or documents, so to roll back to an earlier state, export a snapshot first.

What Cognee keeps

Version a memory you write yourself

A DataPoint has a version field that starts at 1. Cognee never increments it on its own. Call update_version() when a change should count as a new revision, then write the DataPoint back. update_version() adds 1 to version and sets updated_at to now. Writing a DataPoint with the same id updates the stored node in place. Here identity_fields derives the id from user and key, so a new value for the same preference updates the same node:
The example needs no LLM or embedding key, because graph_only=True skips embeddings. It prints:
After the second write, the node reads helix at version 2. The earlier value vim is gone: the version counter tells you the node changed, not what it was before. The provenance ledger wouldn’t keep it either: it records data items (documents), not node values, and a direct add_data_points() call outside a pipeline names no data item, so the ledger records nothing for it. To keep earlier values, export a COGX snapshot before changing them.

Update a document

When a document you added with remember() changes, use cognee.update(). It replaces the document under the same data_id, re-extracts what the edit touched and removes relationships that no longer hold. Adding the changed file with remember() again doesn’t create a second copy. If the dataset already holds a file from the same path (or an upload with the same filename) with different content, remember() raises DocumentUpdateRequiredError and points you to update(). Raw text has no file name, so changed text is always added as a new document, with no link to the old one. Adding the exact same content again is a no-op, since Cognee deduplicates documents by content hash.

Keep outdated facts instead of overwriting them

When new data contradicts what Cognee already knows, conflict review keeps both facts and records which one is current. It runs in every improve(), including the automatic one after remember(); set IMPROVE_REVIEW_CONFLICTS=false to turn it off. In 1.6.5 and earlier it is opt-in: run improve(review_conflicts=True) or set IMPROVE_REVIEW_CONFLICTS=true. The date that decides which fact is newer comes from the effective_date in the document’s metadata. Superseded facts stay in the graph and in recall() results. They are sorted after current facts and labelled, for example [superseded; as of 2025-03-01], so the LLM sees what changed and when. The exception is a conflict you settle yourself with resolve_conflict(): the facts you reject stay in the graph as superseded, but graph-completion and hybrid search drop them from their context and state the accepted fact instead. See Review Conflicting Facts for a walkthrough and Resolve Conflicting Facts for settling a conflict yourself.

Keep an audit trail of writes

For an audit trail of which documents were stored, when, by whom and in which run, enable the provenance ledger before the first cognify() or remember() call:
Cognee then records, in an append-only, hash-chained ledger, every data item that a pipeline stores output for: cognify() and remember(), chunk-level update(), and custom pipelines that run per data item. improve() stages run without a data item, so they add no rows. There is one row per data item, keyed "{dataset_id}:data_item:{data_id}", holding its content hash, the acting user’s id and the pipeline run. The nodes and edges the item produced are not in the ledger; the graph’s source refs link them to the item. When the item’s content hash changes, the ledger archives the previous row and versions the live one, instead of overwriting it. When the item is deleted with forget() (or a dataset delete), the ledger adds a tombstone instead of removing the row. revision_history() returns the versions oldest first, each with version, valid_from, valid_until and recorded_at, and verify_chain() checks that no row was edited or removed:
The same reads are available over HTTP under /api/v1/provenance/ and from cognee-cli provenance. Those surfaces need read access to the row’s dataset, and reading the whole ledger is superuser-only. See Provenance ledger for the routes, failure behavior and external anchoring.

What Cognee doesn’t keep

  • Previous node values. Writing a node again overwrites its properties in the graph and vector stores. The ledger records documents, not node values.
  • Previous document content. update() replaces the document’s content and file.
  • Point-in-time queries. recall() reads the current graph. There is no “as of” filter.
  • Deleted data. forget() deletes permanently. There is no soft delete. With the provenance ledger on, the deleted document’s row stays in the ledger with a tombstone, which records that it was deleted. The row doesn’t hold the deleted content.
To keep a restorable copy of a dataset at a point in time, export it as a COGX archive before making changes:

Next steps

DataPoints

Fields, identity and updating custom DataPoints

Review Conflicting Facts

Mark outdated facts as superseded

Update

Replace a document under the same id

Memory Provenance

See where each fact came from