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)>>. - Memory
Entry - A structured memory entry with metadata and optional embedding.
- NoEmbedder
- A no-op embedder that always returns an empty vector.
- Recall
Options - Options controlling memory recall behavior.
- Sqlite
Memory - 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.