docs menu · recalled memories

# how it works

Recalled memories

On each prompt, recall finds the stored memories that match the prompt. The gate decides which of them Monot injects.

On each prompt, Monot also looks for stored memories that match the prompt. This step is recall. Recall looks in three places:

  • The facts that Monot wrote for the repo, under ~/.monot/repos/<host>/<owner>/<repo>/.
  • Claude Code's built-in memory for the repo, in ~/.claude/projects/<slug>/memory/. Here <slug> is the folder name that Claude Code gives the project. Monot only reads these files, and it skips MEMORY.md.
  • Global memories, under ~/.monot/global/. A global memory belongs to no repo, so every repo may recall it.

Fact types

A fact is a memory that Monot writes itself. Each fact has one of five types:

  • decision records what someone decided, and why.
  • preference records how you want the work done.
  • pointer records where something lives in the repo, as a path and a symbol name.
  • state records the status or the next step of a ticket, PR or branch. A state fact expires 14 days after Monot writes or replaces it.
  • gotcha records surprising behavior that someone found.

The index

Recall searches all three places through the index, ~/.monot/index.db. The index is a cache of the Markdown files. Monot updates the index from the files on every prompt. You can delete the index at any time.

Recall reads a PR URL in the prompt as its PR number, such as 345 for https://github.com/acme/web-app/pull/345, when the number has 3 to 6 digits.

The gate

Recall gives each memory it finds a score. The score tells how well the memory matches the prompt. Then a rule, the gate, decides which memories Monot injects:

  • The gate allows at most 3 memories, about 400 tokens in all.
  • The gate allows a memory with a score of 1.50 or more. This number is the threshold.
  • The gate also allows a memory with a lower score when its file name, name or description shares a ticket ID, a PR number or a path with the prompt. This is the identifier rule.
  • The gate allows nothing while the index holds fewer than 10 memories. This count covers all repos together.

If no memory passes the gate, Monot injects nothing. Monot also does not inject a memory whose line only points at a path that the prompt already names. Such a memory is an echo.

The score does not grow when the index grows. So one threshold works at every index size.

Each injected memory is one line: - <type> <date> <address>: <text>. The address is a stable ID for the memory, such as github.com/acme/exporter/windows-runner-timeout. Claude can use the address to read the full memory. For a fact that Monot wrote, Claude can also use the address to forget it. An address that starts with builtin/ is a file of Claude Code's built-in memory, and forget refuses it: you edit or delete that file yourself. The text is the whole memory if it fits in the space that the other lines leave in the 400 tokens. If not, the text is the memory's description, cut to at most 200 characters. When those 200 characters leave room, the line ends with (also names: …): the paths, ticket IDs and other identifiers of the memory that the description lacks. This line is the recall line. A pick and a recall search show a memory in the same form.

The limits

These limits are not settings. They are constants in src/index.rs:

  • MAX_LINES is 3. It is the most memories that Monot injects on one prompt.
  • MAX_CHARS is 1040 characters, about 400 tokens.
  • GATE is 1.50, the threshold. The eval picked this number. The eval is the set of Python scripts in eval/ that measure how well recall works.
  • MIN_ROWS is 10. Below this index size, Monot injects nothing.

To change a limit, edit its constant in a clone of the Monot repo. Then reinstall from the clone:

[ sh ]
cargo install --locked --force --path . --root ~/.local

When Monot injects nothing

Monot does not inject a memory in these cases:

  • Monot already injected the memory in this context window. The context window is all the text that Claude sees at one time.
  • The same session wrote the memory.
  • The memory is a state fact, and its expires date is in the past.
  • The memory is a pointer, and the path that it cites no longer exists.
  • The memory is a pointer, and none of the source files that it cites still contains its code symbol. A code symbol is a name in backticks, such as snake_case, camelCase, Type::item or call().

Monot does no recall for these prompts:

  • A prompt of fewer than 4 words that holds no identifier.
  • A slash command with no arguments.
  • A task notification. Claude Code sends this message to itself when background work finishes.
  • A prompt inside a subagent. A subagent is a helper agent that Claude starts for one part of the work, with its own context window.