Skip to main content

Crate codync_mem

Crate codync_mem 

Source
Expand description

Memory for coding-agent bots.

The crate decides; the caller acts. It starts no processes, opens no network connections, calls no models and spawns no threads. It reads and writes its own tables on the caller’s SQLite connection, inside the caller’s transaction, so a memory change and whatever the caller records with it commit together.

Re-exports§

pub use rusqlite;

Modules§

check
The hard checks every write except the user’s own edits passes: deterministic code, not a model’s judgment.
compaction
When to compact a conversation, or roll it over into a new one that starts from a handoff.
dream
Dreaming: between turns a model reads the latest conversations and proposes changes to memory’s files; deterministic rules decide which survive. It adds and takes out lines of MEMORY.md and appends to notes (it never rewrites a note), each change cites the user’s own words, and every run is logged. When a MEMORY.md is nearly full (full) it also tidies it, moving lines word for word into the notes of their topics.
evidence
What counts as the user’s own words.
files
Memory is Markdown files, in a folder per layer (the shared one, and each bot’s own): MEMORY.md, one short fact per line, which every session opens with in full, and notes on one topic each, read when it comes up.
legacy
The memory entries Codync kept before memory became files (2.18 to 2.20): read once to move them into each layer’s MEMORY.md, then dropped.
opening
The memory a session opens with: each layer’s MEMORY.md the bot sees, in full.
schema
The crate’s own tables and their migrations, versioned apart from the caller’s schema.
store
What memory keeps beside its files: tombstones of what the user had the bot forget, marks dreaming leaves for itself, and the crate’s error type.
tokens
Token estimates for the memory caps.