# Archivist

> What the MMW archivist does after every write — graph links, staleness marks and refinements — and what it never does.

The archivist is an MMW background process. After every `remember` it looks at how the new record relates to recent ones and tidies up: it links records, marks outdated ones and lowers confidence. It never deletes anything.

On this page you will learn:

1. what the archivist does to the new record and its neighbours;
2. what data it sends to a language model;
3. how it behaves in organizations and where it does not run.

Running example: a month ago the agent saved "staging is deployed manually with scp", and today "staging is deployed through the `app-staging` systemd unit".

## How it works

```text
  remember(new record)
        │  record saved, the agent already has its reply
        ▼
  archivist (background)
        │  takes up to 5 of the most recent records in the same workspace
        │  and project that the new record's author can read
        ▼
  a language model decides: CREATE / MERGE / INVALIDATE + links
        ▼
  updates: graph links, stale status, confidence, fact_key
```

The analysis is asynchronous: `remember` replies immediately, and links and marks show up a little later. If the model is unavailable, the archivist skips the record — it is saved as usual, just without enrichment.

## What it does

| Model decision | What changes |
| --- | --- |
| **CREATE** — a new fact | Only links and, if needed, a service `fact_key` on the new record. |
| **MERGE** — the new record refines or extends an older one | The older record's confidence is lowered to 0.4 (if it was higher). |
| **INVALIDATE** — the new record contradicts an older one | The older record gets the `stale` status and its confidence is lowered to 0.1. |

In addition:

- **Graph links.** The archivist creates weighted `relates_to`, `fixes_issue` and `supersedes` links. They appear in `graph_relations` in `search` results and on the relationship map in your account.
- **Service fact_key.** If you did not set a `fact_key`, the archivist assigns one of the form `archivist:shelf:short-summary`. It never changes a key you set.
- **Candidates only.** It can change only the records it was given for comparison. If the model names any other record, the decision is discarded.

In the example, the archivist will most likely choose INVALIDATE: the `scp` record becomes `stale` with confidence 0.1, and the new record gets a `supersedes` link to it. The agent sees both in search — and can tell which is current.

## What it never does

- **Delete.** A contradicted record stays visible and searchable. Only `forget`, called by you or your agent, removes data.
- **Change the text** of the new or the older record.
- **Raise confidence** — it only lowers it.
- **Step outside** the new record's project and workspace.

An archivist mark is a model's judgement, not a rule, and it can be wrong. If a record was marked `stale` by mistake, save the fact again: the new record will be `unverified`. The strict rules — `fact_key` conflicts and source hash comparison — work independently of the archivist.

## What data goes to the model

The model receives the text of the new record and the beginning (up to 140 characters) of each candidate record, with their IDs. By then secrets have already been replaced with placeholders — [Memory Guard](/memory/memory-guard/) runs before saving. The model's reply is also scrubbed for secrets before it can end up in a `fact_key`.

## In organizations

The archivist follows the same visibility rules as search: it picks candidates only from records that the **author of the new record** can read. A colleague's draft ("author only") or another department's record never enters the comparison, the links or the marks. See [Visibility](/organizations/visibility/).

## Where it does not run

For records written through the ChatGPT connection (OAuth connector, beta), `remember` is a purely additive write: the archivist does not run and the record text is not sent to a model. Such records are not analyzed when they are saved.

## Where next
