When memories become searchable
A memory passes through up to three stages after an agent writes it. What each stage makes possible depends on the memory type and the backend.
| Stage | What happens | What it makes possible |
|---|---|---|
| Written | mm_remember returns. |
Commitments: everything, straight away. Other memories: the writing agent can find them by keyword. |
| Consolidated | Consolidation moves queued memories into the store and rebuilds the compiled memory file. | Every agent allowed to see the memory can find it. It appears in MEMORY.md. |
| Embedded (Postgres) | The embedding worker computes a vector for the memory. | Semantic search: matching by meaning, not only by words. |
Commitments are written straight to the store
Section titled “Commitments are written straight to the store”A commitment is stored when the agent writes it. The response says so:
**Remembered** — `c9f737d32b583106`
**Pipeline state:** stored in ledger. Keyword search returns immediately via `mm_search`; …There is no waiting for a promise to show up in mm_due_commitments. See Commitments.
Other memories are queued
Section titled “Other memories are queued”Facts, observations and other memories go into a queue in the agent’s workspace (the .mm-journal/ directory) and wait for consolidation. The response says that too:
**Queued** (mem_id: `176a23ffa0e957c0`) — pending journal drain.While a memory is queued, the agent that wrote it can already find it. mm_search checks the queue as well as the store, so an agent that learns something and asks about it a minute later gets it back. Two limits apply until consolidation runs:
- The query must appear in the memory’s text as written. “prefers invoices” finds Acme prefers invoices in EUR; “Acme invoices” does not.
- The memory is not yet in the compiled memory file, and on Postgres it is not yet visible to other agents.
To see where one memory is in the pipeline:
mm_queue_status({"mem_id": "176a23ffa0e957c0"})**Stage:** JOURNAL_READYMemory queued in journal `ready/` directory, awaiting next consolidation drain …Consolidation moves the queue into the store
Section titled “Consolidation moves the queue into the store”Consolidation runs on the schedule you set. The Quickstart schedules it nightly:
MM_BACKEND=file meaning-memory consolidate --agent-id support-bot --drain-only \ --workspace /srv/support-bot-mm --config-dir /srv/support-bot-mmAfterwards the memory is in the store, and search finds it. It reaches the compiled MEMORY.md only when the file is next rebuilt and the memory earns a place in its budget; a drain rebuilds the file only when it brings in something that matters (see When it is rebuilt). How often to run it is a trade-off: more often means shared memories reach other agents sooner; less often means fewer runs. Running it more often than nightly is fine.
How search matches, by backend
Section titled “How search matches, by backend”File backend. Search is keyword only, and matches the query as one phrase. “Zephyr” or “prefers invoices” finds Zephyr Logistics prefers invoices in EUR; “Zephyr invoices” does not, because those words are not next to each other. Tell agents on the file backend to search with one or two distinctive words. The file backend has no semantic search.
Postgres. Once a memory is consolidated, keyword search matches the words in any order: “Zephyr invoices” and “invoices Zephyr” both find it. Postgres also runs semantic search, which finds memories by meaning (“which currency does Zephyr pay in”), once the embedding worker has processed the memory. That usually takes from a few seconds to a few minutes after consolidation; mm_queue_status shows whether a memory is still waiting:
**Stage:** QUEUEDMemory `31d2fc5e7dcc6652` is queued for embedding. Waiting for embedding worker to claim it.On the file backend the same call reports that the memory is in the store and that semantic search does not apply:
**Stage:** NOT_APPLICABLEMemory `176a23ffa0e957c0` exists in the ledger, but this backend has no async embedding queue. …Summary
Section titled “Summary”| You want | File backend | Postgres |
|---|---|---|
| A promise listed as due | At once | At once |
| The writing agent to find a new fact | At once, exact phrase | At once, exact phrase |
The fact in MEMORY.md |
After consolidation | After consolidation |
| Other agents to find it | Same workspace: at once | After consolidation, if their access policy allows |
| Words in any order | Not supported | After consolidation |
| Search by meaning | Not supported | After consolidation and embedding |