Automatic memory
Memory that waits to be asked is memory that never gets written. On hosts with hooks, Memoose runs itself, and every automatic part is a convenience over the tools rather than a replacement for one.
| When | What happens | Cost |
|---|---|---|
| You submit a prompt | If the agent has declared its position in a procedure, the transitions from there are injected; then memory is searched locally and a short hint is injected if something matches | ~ms, no model |
| A session starts | Standing rules, preferences and recent lessons are put in front of the agent | ~ms, no model |
| A turn ends, or before compaction | A background job on a small model stores what was learned, writing through the CLI | Small model, off your critical path |
| A session starts, at most once a day | The upkeep pass (memoose maintain) is offered when the store has work waiting | ~ms, no model |
Hints before each prompt
An agent only recalls when it thinks to, and it usually does not think to. So the
UserPromptSubmit hook reads each incoming prompt, searches the local index, and when
something genuinely matches it hands the agent a hint before the agent starts thinking: what
memory already holds, and the recall query that would fetch the rest.
The hint is cheap by design: BM25 over the local index, a relevance floor
(MEMOOSE_HINT_MIN_SCORE, default 0.5), a hard cap on how much it injects
(MEMOOSE_HINT_COUNT, default 4), and silence when nothing matches. No model,
a few milliseconds, so it can run on every prompt without anyone noticing. The agent keeps full
control over whether to follow the hint.
Before that lexical hint, the hook asks a different question: not what the user said, but where
the agent is. When the agent has declared its position on an open session
(memoose session turn <id> --at "run the test suite"), that step’s outgoing
transitions are injected two hops out, grouped as Next and Then, each with its
condition, advice and pitfall and how past sessions that took it ended. Outgoing only: what precedes
the step is what the agent has already done. This follows Procedural Graphs (Lu et al., 2026),
whose ablation showed the local subgraph beating the whole graph and whole-graph injection lowering
task success, so the block is small. Memory never guesses the position: with no declared position
there is no guidance, because a wrong steer is worse than silence.
Standing context at session start
The SessionStart hook loads what should hold for the whole session before you type
anything: the rules, goals and preferences stored as session context sections, plus recent lessons.
It is the same material session_start returns, delivered without anyone calling it.
Background capture
The Stop and PreCompact hooks run capture asynchronously: a turn that
taught something durable gets extracted and stored by a small model, so what the turn established is
not lost to compaction. Two guards keep it cheap. It runs
after your turn, never during it, and it skips turns shorter than
MEMOOSE_CAPTURE_MIN_CHARS (default 400) rather than spending anything on
small talk.
The hooks Memoose registers
| Hook | Script | Mode |
|---|---|---|
UserPromptSubmit | harness/hooks/recommend.py | Blocking, 10 s timeout |
SessionStart | harness/hooks/session_start.py | Blocking, 10 s timeout |
Stop | harness/hooks/capture.py | Async |
PreCompact | harness/hooks/capture.py | Async |
They are wired through the plugin manifest, so on a host that runs plugin hooks they are active as soon as the plugin is installed, which today means Claude Code. Memoose never writes hooks into your global configuration on its own.
On a host that does not run them
You lose the automation and keep every capability. The skills route the
same work to the memory-keeper subagent, which needs no hooks: it runs on a small model,
holds only the Memoose tools, and reports back in one line. Explicit tool calls keep working
everywhere; they are just no longer the only path.
Onboarding: what is actually live here
Memoose cannot see how your machine is configured, so the memoose-onboard skill walks
it with you instead of assuming. Ask the agent to onboard Memoose, or say that automatic memory is not
working, and it will check each capability against this host:
| Capability | How it is checked | If missing |
|---|---|---|
| Memory tools | list_datasets returns | The MCP server is not connected. Re-run install and restart the host |
| Hints on each prompt | You see a “Memoose already holds memory…” line before answers | Hooks are not running on this host |
| Standing context at session start | The agent has your rules and preferences without asking | Hooks are not running on this host |
| Background capture | New facts appear without anyone calling remember | Hooks are not running, or capture is switched off |
When hooks are not firing, the likely causes in order are: the host does not run plugin hooks (fall
back to memory-keeper), the host was not restarted after installing, or the switches were
turned off.
Automatic capture writes facts nobody explicitly asked for. The onboarding skill is
required to be plain about that: where the SQLite file is, that
recall shows what is remembered and history shows who stored it and when,
and that forget removes an entity, a fact, or a whole dataset. It asks before enabling
capture on a project that contains anything sensitive. The switches are on the
Configuration page.