Expand description
Long-term, cross-session memory.
Short-term context lives in crate::Context; the crate::Compactor
keeps it within budget within a single run. Long-term memory is what
survives across runs — the dataset that turns a generic assistant into a
personalised one. Per Harrison Chase / Sarah Wooders: memory is the
harness. To keep the framework’s “open harness” promise the memory layer
must be:
- owned by the operator (no provider-side stateful APIs),
- transferable (a swap to a different model must not lose memory),
- inspectable (plain on-disk format, no opaque tokens).
This module ships the trait + types. Concrete backends live in
[harness_context::FileMemory] (JSONL) and downstream crates.
§Wiring
- A
MemoryGuidefromharness-rs-loopcallsMemory::recallat the start of every session and injects the top-K matches into the system prompt. - A
MemoryWriterhook captures the final assistant text onEvent::TaskCompletedand callsMemory::write. - Tools may use the same
Arc<dyn Memory>to commit explicit facts mid-run.
Structs§
- Memory
Entry - One persisted memory record.
Enums§
Traits§
- Memory
- The open-memory primitive.