Memory
Graph-based persistent memory service — entities, relations, and journals backed by LanceDB.
The memory service (walrus-memory) provides graph-based persistent memory for agents. It runs as a WHS hook service — the daemon routes memory tool calls to it and receives identity data at agent startup.
Configuration
[services.memory]
kind = "hook"
command = "walrus-memory"
enabled = true
config = { entities = ["project"], relations = ["implements"], connections = 30 }| Config field | Type | Description | Default |
|---|---|---|---|
entities | string[] | Additional entity types | [] |
relations | string[] | Additional relation types | [] |
connections | usize | Default limit for graph traversal | 20 (max 100) |
Tools
The memory service registers six tools:
| Tool | Description |
|---|---|
remember | Store a typed entity (upserts by composite key) |
recall | Search entities by full-text query, optionally filtered by type |
relate | Create a directed edge between two entities |
connections | Traverse the graph one hop from an entity |
compact | Trigger context compaction with journal storage |
distill | Search past journal entries by semantic similarity |
See memory concepts for detailed tool schemas and usage.
Capabilities
The memory service declares four WHS capabilities:
- Tools — the six memory tools above
- BuildAgent — injects identity traits, user profile, and recent journals into the system prompt at agent creation
- Compact — enriches the compaction prompt with memory context
- EventObserver — observes agent events for knowledge extraction
Entity types
Seven built-in types: fact, preference, person, event, concept, identity, profile. Extend via the entities config field.
Relation types
Seven built-in types: knows, prefers, related_to, caused_by, part_of, depends_on, tagged_with. Extend via the relations config field.
What's next
- Memory concepts — storage architecture, tool schemas, identity injection
- WHS services — how hook services work
- Context compaction — how
compactanddistillwork together