> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorpro.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Corrections

> How EDN updates memory when a user corrects a fact, while keeping the history traceable.

Users change their minds and facts change: "Actually, Tom manages the website
project now." EDN updates memory so your model uses the new fact, and keeps the
old one in the history instead of overwriting it.

## Corrections happen automatically

When you save a conversation with `memory/ingest`, EDN checks the user's
message:

* **A new fact** ("Sara manages the website project.") is saved as a
  `USER_STATED` record.
* **A correction** ("Actually, Tom manages it now.") is saved as a new
  `USER_STATED` record and, where it matches an earlier fact, **replaces** it.

So in most integrations, **you don't need to do anything extra**: corrections
in normal conversation are handled when you save each turn.

EDN uses a language model to decide whether a message states a fact or a
correction. Building the SIP uses no model.

## What gets replaced

| The earlier fact came from | What happens |
| - | - |
| The user, in a conversation (`USER_STATED`) | **Replaced.** The new fact is used from now on; the old one stays in the history with `superseded_by` pointing to the new one |
| A document (`DOCUMENT_VERIFIED`) | **Not replaced.** A chat message never overwrites a document. Both are kept, and EDN records the conflict |
| A user confirmation (`USER_CONFIRMED`) | **Not replaced automatically.** Both are kept, and EDN records the conflict |

EDN only replaces a fact when the new statement clearly refers to the same
thing. If it is unsure, it keeps both.

**Example:**

1. The user says "Sara manages the website project." EDN saves record A
   (`USER_STATED`).
2. Later: "Actually, Tom manages the website project now." EDN saves record B
   (`USER_STATED`), and A gets `superseded_by: B`.
3. A SIP for "Who manages the website project?" now contains only B. Record A
   is still listed, so you can see what changed.

## Seeing what changed

The `memory/ingest` response tells you when a message replaced a fact. In the
example above, saving step 2 returns:

```json Response theme={"theme":"github-light"}
{
  "record_id": "53c7483b-1238-4129-8dcf-411beea0473a",
  "fact": {
    "record_id": "B",
    "replaces": "A"
  }
}
```

`fact.replaces` is `null` when the new fact didn't replace anything, including
when EDN kept both because it was unsure. Use
`GET /api/v1/memory/records/{record_id}/history` to see every version of a
fact.

## Next steps

> [card] [Memory records](https://docs.tensorpro.ai/concepts/memory-records.md)
>
> How replaced records appear.

> [card] [Provenance](https://docs.tensorpro.ai/concepts/provenance.md)
>
> What each source label means.

> [card] [The SIP](https://docs.tensorpro.ai/concepts/sip.md)
>
> Why replaced records never reach your model.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.