# Memory

Each repo accumulates **memory** — durable knowledge that makes successive runs
smarter, plus a deterministic ledger of what happened.

## What's stored

| Tag | Meaning | Source |
|---|---|---|
| **INVARIANT** | A rule that must always hold | you / agents |
| **PATTERN** | A recurring approach in this repo | you / agents |
| **LESSON** | Something learned (e.g. a gate quirk) | you / agents / system |
| **RUN** | A per‑run summary (the ledger) | system |
| *PROPOSAL* | Explore‑mode taste signal (internal) | system |

## How it's used

- At run start, agents read the **knowledge** memories (invariants, patterns,
  lessons) — but **not** the RUN ledger or internal taste, so durable knowledge
  isn't drowned out.
- The **RUN ledger** is written deterministically after every run (status, verify
  result, PR/branch), so a repo's history populates whether or not an agent chose
  to save anything. Old entries are pruned.
- When the [gate](/docs/verification-gate) hits an *environment* problem, AM
  records a one‑time lesson so the next run accounts for it.

## Add your own

In **Repo settings → Memories**, add an INVARIANT/PATTERN/LESSON to teach AM
something durable about the repo (e.g. *"INVARIANT: never edit generated files in
`/dist`"*).

## Related

- [Reading a run](/docs/reading-runs) · [Explore mode](/docs/explore-mode)
