Skip to content
Pages of the documentation

Memory

What the agent remembers, what each turn carries, how it finds the rest, and how a finished conversation becomes an episode.

Nestor keeps memories, lasting facts (“Léa is vegetarian”), and episodes, what each past conversation was about, both rebuilt from the journal.

Memories, by person and for the whole householdMemories, by person and for the whole household

What a turn carries

MemoriesLasting facts and preferences, dated, about someone or the household.
EpisodesOne per past conversation, seen only by its participants.
The journalEvery word, as said and heard.
Household layer, cached
  • The latest 150 memories
Turn layer, for whoever speaks
  • Beyond them, up to 12 the words find
  • Their 3 latest conversations
  • Up to 4 older ones the words find
On demand, through tools
  • recall finds memories by words and meaning
  • recall finds conversations, between two dates if asked
  • read_conversation rereads one, word for word
Figure 1Where a turn's memory comes from: the latest memories in the cached household layer, what the speaker's words find in the turn layer, the rest through tools.

Memories are dated: of two that disagree, the model keeps the later. Episodes are seen only by their participants. Tools reach the rest:

Tool Does
recall searches memories and past conversations, between two dates if asked
read_conversation rereads one conversation word for word
remember keeps a memory
correct_memory fixes one
forget drops one

Finding by words and by meaning

Figure 2By words, the choir comes first: it shares two words with the question. By meaning, the diet does. Fused, the memory in both lists leads. Without an embedding model, words alone.

Words go through SQLite’s full-text index (accents ignored), meaning through an embedding model and sqlite-vec. Search by meaning is optional: point memory.embedder at an embedding model.

models:
  embed:
    type: embedding
    provider: openai-compatible
    base_url: https://openrouter.ai/api/v1
    api_key: ${MODEL_API_KEY}
    model: openai/text-embedding-3-small
memory:
  embedder: embed

Any OpenAI-compatible embeddings server works, such as llama-server --embeddings. Vectors are recomputed in the background after a model change.

When a conversation is over

The conversation
18:0218:0318:09
Then silenceLonger than every medium of the address allows: a question asked aloud may get a typed answer for four hours.
A small model reads itThe consolidation model, the background one by default. It knows what is already remembered.
An episodeTwo or three sentences and a few topics, for its participants. None if nothing is worth recalling.
FactsLasting facts the agent missed, kept as memories.
The summary, journaledmemory.episode
Figure 3Once a conversation is over, a small model reads it in the background. No one waits.

When a conversation ends, the consolidation model writes its episode and keeps the lasting facts the agent missed. After a stop, Nestor catches up at the next start.

Settings

Setting Default What it does
memory.strategy both recent: the latest only; search: only what the words find
memory.recent 150 memories in the household layer
memory.found 12 memories the words may add beyond them
memory.recent_episodes 3 latest conversations of whoever speaks
memory.found_episodes 4 older conversations their words may add
memory.embedder none the embedding model, for search by meaning
memory.query_timeout_s 1 seconds to embed a question before searching by words only
memory.consolidation agent.written the model that writes episodes