Skip to main content

Crate walrus_memory

Crate walrus_memory 

Source
Expand description

Memory backends for Walrus agents.

Defines the Memory trait, Embedder trait, and concrete implementations: InMemory (volatile) and SqliteMemory (persistent with FTS5 + vector recall).

Memory is not chat history. It is structured knowledge — extracted facts, user preferences, agent persona — that gets compiled into the system prompt.

All SQL lives in sql/*.sql files, loaded via include_str!.

Structs§

InMemory
In-memory store backed by Mutex<Vec<(String, String)>>.
MemoryEntry
A structured memory entry with metadata and optional embedding.
NoEmbedder
A no-op embedder that always returns an empty vector.
RecallOptions
Options controlling memory recall behavior.
SqliteMemory
SQLite-backed memory store with optional embedding support.

Traits§

Embedder
Converts text into a dense vector embedding.
Memory
Structured knowledge memory for LLM agents.

Functions§

cosine_similarity
Cosine similarity between two float vectors.
with_memory
Apply memory to an agent config — appends compiled memory to the system prompt.