Skip to content

Memory

q15’s memory is not a single blob of context. It is structured into layers, each with a different purpose, persistence model, and injection strategy.

Layer Path Purpose Auto-injected?
Core /memory/core/ Agent identity, personality, self-model Yes, every turn
Working /memory/working/WORKING_MEMORY.md Bounded active state — priorities, tasks, recent progress Yes, every turn
Semantic /memory/semantic/ Durable extracted knowledge — facts, preferences, projects No (tool-fetched)
History /memory/history/ Episodic transcript — completed turns as JSON files No (replayed)
Cognition /memory/cognition/ System-owned control, indexing, background maintenance No (system-owned)

Files under /memory/core/ define who the agent is. Typical files:

  • AGENT.md — role and behavioral protocol
  • USER.md — user identity, preferences, communication norms
  • SOUL.md — voice, teaching style, working principles

These are always in the prompt. They are the agent’s durable identity.

/memory/working/WORKING_MEMORY.md is the canonical prompt-visible working-memory artifact. It holds bounded active state: current priorities, active tasks, open threads, recent progress, pending checks, and temporary context.

Other files under /memory/working/ are not implicitly prompt-visible. Only WORKING_MEMORY.md is auto-injected.

Canonical semantic files:

  • facts.md — confirmed facts and grounded inferences
  • preferences.md — user preferences and collaboration preferences
  • projects.md — active projects and durable project knowledge

Semantic memory is not auto-injected. The agent fetches it on demand when relevant.

Completed turns are stored as JSON files under /memory/history/turns/YYYY/MM/DD/. Transcript sequence metadata lives at /memory/history/state/head.json.

The current format is schema_version: 2 with canonical ordered messages[].parts[] entries of type text, reasoning, tool_call, and tool_result.

On startup, existing history is eagerly upgraded in place. Unreadable turn files are moved to /memory/history/quarantine/.

/memory/notes/ contains the auxiliary zettelkasten notebook:

  • notes/inbox/ — incoming notes
  • notes/zettel/ — atomic knowledge notes
  • notes/maps/ — structure maps and indexes

These are not prompt-visible. They are durable knowledge infrastructure that the agent can search and reference.