Memory System

Holon is designed for long-lived agents. Memory preserves what matters across turns without replaying the entire conversation history. The runtime derives memory from durable evidence rather than relying on free-form model summaries.

Memory Indexing

Holon indexes memory asynchronously at startup. The index build runs in the background and does not block daemon startup. New events continue to be indexed as they are written to the durable ledger.

During the initial index build, search results may be incomplete. The runtime prioritizes newly written events so recent memory is always findable, even while the background build catches up on historical records.

Memory Layers

Holon's context memory has four layers, each with a distinct role:

Durable Ledger  ──── append-only audit trail (messages, briefs, tool calls, tasks)
     │
     ▼
Current Work Context ─ current WorkItem, todo state, waits, and refs
     │
     ▼
Episode Memory  ──── archived records of completed work chunks
     │
     ▼
Context Assembly ──── budgeted prompt sections selected from all layers

Durable Ledger

The append-only source of truth. Every runtime event is recorded:

The ledger is not prompt-bounded. It grows indefinitely as the audit trail. The model-visible projection is a compressed selection, not a full replay.

Current Work Context

Current work context is the compact runtime-owned projection that answers:

The prompt-facing authority is the current WorkItemRecord plus its runtime-derived work_refs. Work refs are extracted at turn closure from trusted runtime evidence such as current input source refs and tool execution records. The model does not author them directly.

Current work context is not free-form summary. It is a structured projection of the runtime's own records: current WorkItem state, active todo list, blockers, waiting conditions, and refs back to retrievable evidence.

Episode Memory

Episode memory archives completed work. While work is in progress, an active episode builder accumulates:

When a meaningful boundary is reached (work item completed, task finished), the runtime finalizes the builder into an immutable episode record and stores it.

Archived episodes are selected into prompt context by relevance and budget, not rendered in full by default. Default prompt assembly treats episodes as a mid-term archive: it excludes episodes that overlap the recent_turns window so recent turn evidence is not duplicated by a summary of the same turns.

Context Assembly

Each turn assembles a prompt from budgeted memory sections:

This assembly keeps prompt size bounded while preserving continuity. Slow-changing memory sections keep provider cache identity stable. For a user-facing walkthrough of how these sections fit together, see Context Continuity.

Memory vs Agent Home Files

Memory and agent home files serve different purposes:

AspectRuntime MemoryAgent Home Files
What it storesCurrent state, episodes, evidenceRole contract, notes, references
Who writes itRuntime (automatic)Agent or operator (manual)
DurabilityAppend-only ledger + snapshotsPersistent files
SearchIndexed via MemorySearchOrdinary file read
LoadedBudgeted prompt assemblyAGENTS.md always loaded

agent_home/AGENTS.md is loaded guidance — the agent's long-lived role contract. Runtime memory is automatically derived evidence. They coexist without overlapping.

MemorySearch and MemoryGet

Holon exposes two memory tools for indexed retrieval:

These tools let the agent pull relevant past context on demand without rendering every archived episode into every prompt.

Agent Memory Auto-Load

Holon automatically injects a compact slice of the agent's curated memory files into every turn's system prompt. This gives the agent persistent self-knowledge and operator preferences without manual recall or search.

Two files participate in auto-load:

FilePurposeWho writes it
agent_home/memory/operator.mdOperator preferences, standing instructionsOperator
agent_home/memory/self.mdAgent self-knowledge, role factsAgent

At turn assembly, each file is read and a compact slice is injected under a fixed per-file character budget (default 1500 characters). If the file exceeds the budget, the injected slice is truncated and the agent receives a note that the remainder is retrievable via MemoryGet. If the file is empty, the agent receives a note that curated content is not yet present.

The auto-loaded sections appear in the prompt as:

These sections sit between AGENTS.md guidance and the workspace scope in the prompt hierarchy. They carry lower authority than workspace or turn-scoped instructions but provide persistent facts that survive context compaction.

When to use each file

Notes Catalog

In addition to curated memory files, Holon can inject a metadata catalog of the agent's notes/ directory into the prompt. The notes catalog acts as a bounded reference index, not as instruction content.

The catalog is rendered from each Markdown file in agent_home/notes/ and includes:

The catalog is bounded: at most 20 entries and 2000 total characters. Note bodies are never injected — the catalog is a metadata index only. The agent can retrieve full note content by reading the referenced file.

Notes are treated as reference material, not as instructions. They do not override operator input, AGENTS.md guidance, or the current WorkItem objective.

Memory and Work Items

Memory is tightly coupled to work items:

This means Holon can remember what it did for a previous issue without re-reading the entire transcript of that work.

Memory Boundaries

Holon separates memory by identity scope:

These boundaries prevent session transcripts from becoming the only memory surface and let shared workspaces accumulate knowledge across multiple agents.

See Also