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

# Versioning

> Let memory change over time without manually cleaning up old facts.

MemContext is built for information that changes.

If you save a newer fact that replaces an older one, search can return the newer
memory while keeping the previous version available through the history endpoint.

## Example

Earlier memory:

```text theme={null}
User prefers long-form LinkedIn posts.
```

Later memory:

```text theme={null}
User now prefers short hook-first LinkedIn posts.
```

When you search for the user's LinkedIn preference, MemContext should return the
newer memory. You do not need to manually delete the older statement first.

## Inspect History

Use the history endpoint when you need to see how a memory changed.

```bash theme={null}
curl https://api.memcontext.in/api/memories/a1b2c3d4-.../history \
  -H "X-API-Key: mc_your_key"
```

Response:

```json theme={null}
{
  "current": {
    "id": "e5f6g7h8-...",
    "content": "User now prefers short hook-first LinkedIn posts.",
    "version": 2,
    "createdAt": "2026-04-10T00:00:00Z"
  },
  "history": [
    {
      "id": "a1b2c3d4-...",
      "content": "User prefers long-form LinkedIn posts.",
      "version": 1,
      "createdAt": "2026-03-15T00:00:00Z"
    }
  ]
}
```

## Delete Memories

Use delete when a memory should no longer appear in search.

```bash theme={null}
curl -X DELETE https://api.memcontext.in/api/memories/a1b2c3d4-... \
  -H "X-API-Key: mc_your_key"
```

Deleted memories are excluded from future retrieval.
