Long-term memory primitive for Ryu. Part of Ryu.
ryu-memory owns the durable, cross-conversation facts an agent recalls (spec unit U11). It is the SQLite-backed, encryption-at-rest MemoryStore plus the multi-level scope model, category/importance/tags metadata, and scoped recall/CRUD. Long-term memory is opt-in (privacy-by-default): nothing is recorded or recalled unless the request enables it. Short-term memory (recent turns of the current conversation) is derived from the conversation store and needs no storage here.
Extracted from apps/core/src/server/memory.rs as an in-process capability crate (mirrors ryu-crypto / ryu-search). Compiled into Core as a non-optional path dependency — the chat auto-recall loop reaches it unconditionally. ZERO dependency on apps/core.
Swap-seam / inversion: the two Core couplings — the ~/.ryu default db path and the bind-time owner backfill's org/account resolution — invert through plain constructor injection: MemoryStore::open(path, node_bound, owner). The Core wiring lives in apps/core/src/memory_host.rs.
MemoryStore— SQLite store; rows encrypted with the sharedryu-cryptomaster key.MemoryScope— multi-level scoping:User(visible everywhere) /Node(this machine) /Project(one working folder,scope_id= folder path). Which levels an agent may read is governed Core-side by itsMemorySlot.read_levels.MemoryCategory,importance,when_to_usehint, free-formtags— all editable metadata.MemoryVisibility— caller/tenancy filter derived fromryu-kernel-contractsResourceKey.
Placement (CLAUDE.md §1): durable facts are what runs (orchestration context), so Core.
cargo build -p ryu-memory
cargo test -p ryu-memoryApache-2.0; see LICENSE. © 2026 A Major Pte. Ltd.
