Storage
Memory is backed by ChromaDB, an embedded vector database with a SQLite backend, stored on your device. The agent’s memory manager wraps it and manages two collections:The memory store is initialized when the agent starts. If ChromaDB fails to initialize, the
agent exits with a clear error in its logs rather than hanging during startup.
The retrieval loop
- On each
/chat,memory.get_context(query)runs a semantic search over stored facts. - The most relevant facts are injected into the LLM system prompt.
- After responding, a background task asks the LLM to extract new facts from the exchange and writes them back to the vector store.
Why vector search
Fuzzy recall
“What’s my sister’s birthday?” matches a stored fact phrased entirely differently.
Scales quietly
Facts accumulate over time; only the top matches enter the prompt, keeping it small.
Related services
LongTermMemory: higher-level memory orchestration.WorkflowContext: the per-workflow shared variable context used for step-to-step$variablesubstitution (distinct from long-term memory).