Memory Layers
Embedding & Vector Search
The structured memory store uses OpenAItext-embedding-3-small (1536 dimensions) for vector search. Two important behaviors:
- Non-OpenAI providers degrade to keyword-only. If no OpenAI key is configured the embedding provider defaults to
"none"and the store falls back to FTS5 keyword search. - Auto-disable on consecutive failures. After 3 consecutive embedding failures the store silently disables vectors for the process lifetime (keyword search continues). Restart to retry.
Write-Then-Compact Pattern
Before the context manager discards messages, it:- Asks the LLM to extract important facts from the conversation
- Stores facts in both
MEMORY.mdand the structured memory DB - Summarizes the conversation
- Replaces message history with: summary + last 4 messages
Cross-Session Memory
Facts saved withmemory_save are stored in both the workspace (daily log) and the structured SQLite database. After a reset or restart, memory_search retrieves them via hybrid search:
Memory Tools
Workspace Files
Each agent has a persistent workspace at/data/workspace/. The scaffold set (_SCAFFOLD_FILES) is six files: SOUL, INSTRUCTIONS, USER, MEMORY, INTERFACE, HEARTBEAT. AGENTS.md is symlinked from the engine root.
Direct writes to SOUL / INSTRUCTIONS / USER / MEMORY / INTERFACE / HEARTBEAT / AGENTS are blocked — agents must go through the
update_workspace tool, which enforces caps and emits HTTP 413 when exceeded. Workspace bootstrap injection is capped at 48K total chars across all files.