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

# Incident copilot that has read every postmortem

> The last four times this broke, what fixed it, and who knew — surfaced while it is still broken.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/document_qa.py">document\_qa.py</a><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/time_travel.py">time\_travel.py</a></div>

## The scenario

It is 3am and the symptom is familiar. Somebody has seen this before. That
person is asleep, and the postmortem they wrote is in a folder nobody can search
under pressure.

The cost of not finding it is measured in minutes of downtime, which is the one
currency where a memory layer's value is uncontroversial.

## Step 1 — Load the postmortems, dated

```python theme={null}
client.upload_file(
    space_id="incidents",
    file="2026-08-08-pgbouncer-exhaustion.md",
    tags=["service:gateway", "severity:sev1"],
)
```

## Step 2 — Ask with the symptom, not the cause

```python theme={null}
print(client.reason(
    space_id="incidents",
    query="Gateway tasks failing to start, connection errors, database connections pinned at 21. Seen before?",
))
```

You do not know the cause yet — that is the situation. Describe what you can
see, which is exactly the query a semantic system handles and a keyword search
does not.

## Step 3 — Narrow to what happened recently

```python theme={null}
client.retrieve(
    space_id="incidents",
    query="connection pool exhaustion",
    occurred_after="2026-01-01T00:00:00Z",
    tags=["service:gateway"],
)
```

## Step 4 — Write the new one back

```python theme={null}
client.record(
    space_id="incidents",
    content="Recovery order matters: redeploy pgbouncer first, then the gateway. The reverse fails because new tasks cannot boot.",
    timestamp="2026-08-08T04:10:00Z",
    tags=["service:gateway"],
)
```

The loop only compounds if this step happens. A corpus that is read but never
written to decays into history.

## Evals

1. Take your last five incidents. For each, ask using only the symptoms visible
   in the first ten minutes.
2. Score whether the matching postmortem surfaced in the top three results.
3. Include one novel symptom. It must return nothing rather than the nearest
   familiar incident — a confident wrong match at 3am is worse than silence.
4. Re-run monthly. A falling score means the corpus is drifting from production.

## Guardrails

<Warning>
  **Do not let it run remediation.** This surfaces what happened last time; a
  human decides whether this time is the same. Past fixes applied to
  superficially similar symptoms are a well-known way to turn one incident into
  two.
</Warning>

* **Postmortems name people.** Write about decisions and systems, not blame —
  it is retrievable forever and reads worse out of context.
* **Set the incident's own timestamp.** A year of postmortems uploaded in one
  afternoon all happened that afternoon otherwise, and "has this been getting
  more frequent?" becomes unanswerable.
* **Tag by service.** Cross-service noise is what makes an incident search
  useless at the moment you need it.

## Built from

Both are complete, runnable scripts:
[`document_qa.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/document_qa.py),
[`time_travel.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/time_travel.py).
