Expand description
Durable memory: facts worth keeping across agent sessions and harnesses.
A Provider keeps memories in four scopes (user, host, project,
session) and finds them again by words. The daemon serves the
memory.* API through whichever provider the settings name; this
crate holds the interface, the deterministic full-text ranking every
provider can share (search), and the providers: Files, one
markdown file per memory plus a MEMORY.md index, the layout Claude
Code’s memory uses; Sqlite, one SQLite database per user with
memories, their links as edges with valid times, vectors, collector
rows, and session summaries; and, with the kosmonaut feature,
Kosmonaut, the same kept on a Kosmonaut server over gRPC.
transfer copies memories from one provider to another. See
docs/memory.md.
Headless: no GUI, and no model unless an embed embedder is
configured. Calls do blocking I/O; the daemon runs them off its event
loop. Only the Kosmonaut server client runs an async runtime, a small
one of its own.
Modules§
- embed
- Embedders: text to vectors, for a provider that can recall by meaning as well as by words. None is used unless the settings name one.
- search
- Full-text ranking without a model: the same query over the same memories always gives the same order.
Structs§
- Change
- A change to a memory:
Nonekeeps what is there. - Collector
Row - A row a collector kept: what the daemon’s collectors write when a database provider keeps memory, so rows can be found next to the memories, panes, and sessions they came from.
- Context
- Who is asking: what the project and session scopes are resolved from.
- Files
- Found
- Memories, and what could not be read on the way.
- Memory
- One memory.
- Moved
- What
transfercopied, and what it could not read on the way. - New
- A new memory.
- Problem
- A stored memory that could not be read. It is left alone and skipped.
- Sqlite
- Summary
- What an agent session came to: one per session, replaced on each write.
Enums§
Constants§
- DEFAULT_
LIMIT - Default and largest number of memories recall returns.
- INDEX_
BYTES - The index’s size at most, in bytes.
- INDEX_
HEAD - What the index says before its lines.
- INDEX_
LINES - Memories the index lists at most.
- MAX_
LIMIT
Traits§
- Provider
- A memory store. Every method resolves the project and session scopes
from
cx;scope: Nonemeans every scopecxreaches. Providers keep no cache that could go stale against their store.
Functions§
- index
- The index of
items(in the order given, newest first), orNonewhen there are none. At mostINDEX_LINESlines andINDEX_BYTESbytes; the rest are counted in a last line. - project_
root - The project a working directory belongs to: the nearest directory at
or above it that holds
.dreamer/memoryor.git, else the directory itself. - reach
- The scopes
cxreaches: user and host always, project with a working directory, session with a session id. - transfer
- Copy every memory
fromholds inscope(every scopecxreaches whenNone) intoto, keeping ids, kinds, text, links, and times. A memorytoalready holds under the same id is replaced; nothing is removed from either side. Import fromfilesand export back to it are this, with the providers swapped.