agent-memory now uses a state + history + checkpoint model.
The source of truth is no longer just one generated markdown layer. The canonical system is:
/.agent-memory/state.json/.agent-memory/history/events.jsonl/.agent-memory/history/checkpoints/*.json/.agent-memory/archive//.agent-memory/sources.json/.agent-memory/config.json
This is the active canonical memory state.
It stores:
schemaVersiongeneratorVersionprovidergeneratedAtbundleHashbundlemaintenance
The active memory payload:
projectprojectMapcurrentFocusgotchasnextStepsvalidationCommands
Operational metadata for the memory system:
lastRecalledAtlastRecalledEventIdlatestCheckpointIdhistoryEventCountimportSourceCountrecallCursors
This is the active event stream.
Each event is normalized into one of two kinds:
tool_runimported_session
Each event carries:
idsourceIdcreatedAtcontentHashsummarysignalssourceRef
signals is the durable extraction layer used by recall and query. It includes:
decisionsgotchasnextStepHintskeyPathsvalidationObservations
Retention can later archive older recalled events out of the active log. Archived events do not participate in active retrieval or consolidation.
Each checkpoint stores a snapshot of the canonical bundle after a meaningful write.
This gives the system:
- a stable diff baseline for
recall - a baseline for
statuscheckpoint drift summaries - a retrievable memory layer for
query - a structural integrity target for
validate
Retention can later archive older checkpoints out of the active checkpoint set while always preserving the latest checkpoint and the configured recent tail.
This is the archive-first retention layer.
Each batch lives under:
/.agent-memory/archive/prune-<timestamp>/manifest.json/.agent-memory/archive/prune-<timestamp>/events.jsonl/.agent-memory/archive/prune-<timestamp>/checkpoints/*.json
Archive batches are written by automation-only pruning.
Archived data:
- is copied out of the active history/checkpoint store first
- does not participate in active
query,recall, orstatus - can later expire from the archive on a longer window
This is the import source registry.
Each source records:
idtypepathcreatedAtupdatedAtlastSyncedAtlastSyncStatuslastSyncErrorlastImportedCount
This is the project-level recall and maintenance configuration.
The config now covers recall, retrieval, automation, and retention:
recall.defaultSectionrecall.defaultSourcerecall.policyrecall.backlogWarnThresholdrecall.preview.showDiffByDefaultquery.defaultOutputquery.templates.*.instructionsautomation.intervalMinutesautomation.providerautomation.importSyncBeforeRecallautomation.autoRecallretention.enabledretention.history.maxAgeDaysretention.checkpoints.maxAgeDaysretention.checkpoints.keepRecentretention.archive.expireAfterDays
CLI flags can still override these defaults for a single command run.
These are generated from the current canonical bundle:
docs/agent-memory/README.mddocs/agent-memory/project-map.mddocs/agent-memory/current-focus.mddocs/agent-memory/gotchas.mddocs/agent-memory/next-steps.md
Each file starts with a versioned projection marker containing the active bundleHash.
The top-level repository entry file contains a versioned project-memory block:
<!-- agent-memory:entry version=3 bundleHash=<sha256> start -->
...
<!-- agent-memory:entry end -->This lets validate confirm that contributors still have the correct top-level path into the memory system.
The current schema is intentionally breaking.
- old state files are not read
- old projection markers are not preserved
- there is no migration path
Re-run:
npx agent-memory initto rebuild a repository into the current model.