Skip to content

Continuity and lineage

Two things keep a session’s history available. Checkpoints are short, bounded snapshots used to restore context after compaction or a restart. Transcripts are the retained conversation evidence that Dreaming reads. MEMORY.md is neither: it is a projection of the head Dreaming curates.

Session checkpoints (platform/daemon/src/sessions/checkpoints.ts) capture snapshots of session state for continuity recovery. Each one stores a digest of the session’s current focus, the prompt count, recent memory queries, and recent remembers.

Recovery context added to a session-start inject is historical background. It may come from an earlier session or an earlier point in the current session. Its prompts and instructions are not current user intent or authorization. Agents should follow the active session’s instructions and must not use checkpoint text alone to authorize actions.

Supported checkpoint triggers:

  • periodic: a timer or prompt-count interval
  • pre_compaction: the harness signals context compaction
  • session_end: the session closes
  • mid_session_extract: the mid-session checkpoint endpoint
  • agent and explicit: accepted labels with no current producer
  • ttl_expired: an idle session expires

Each row stores session_key, harness, project, project_normalized, trigger, digest, prompt_count, memory_queries and recent_remembers (JSON arrays), and structural context: focal entity IDs and names, active aspect IDs, a surfaced-constraint count, and a traversal-memory count.

Checkpoint digests and recent remembers are credential-redacted before storage.

queueCheckpointWrite buffers writes and flushes them after 2500 ms. When several writes for the same session land in one window:

  • queries and remembers are concatenated, keeping the latest 20 queries and 10 remembers, without deduplication;
  • prompt counts are summed;
  • focal entity and aspect lists are deduplicated;
  • constraint and traversal counts keep the larger value.

When a session exceeds maxCheckpointsPerSession, its oldest rows are deleted. pruneCheckpoints hard-deletes every checkpoint older than the retention window.

Digest formatters produce Markdown per trigger:

  • formatPeriodicDigest: project, prompt count, duration, recent prompts, memory activity
  • formatPreCompactionDigest: the same, plus optional session context
  • formatSessionEndDigest: the same, with the total prompt count

formatRecoveryDigest trims a stored checkpoint to the recovery budget for session-start injection.

Checkpoints are configured under memory.pipelineV2.continuity. Values outside the range are clamped.

Field Default Range Description
enabled true — Master switch
promptInterval 10 1–1000 Prompts between periodic checkpoints
timeIntervalMs 900000 60000–3600000 Time between periodic checkpoints (15 min)
maxCheckpointsPerSession 50 1–500 Per-session cap
retentionDays 7 1–90 Days before old checkpoints are pruned
recoveryBudgetChars 2000 200–10000 Character budget for the recovery digest; a [truncated] marker can be appended past it

See Pipeline configuration for the other pipeline controls.

Session capture stores the canonical conversation transcript as JSONL at $SIGNET_WORKSPACE/transcripts/{harness}/transcript.jsonl and indexes it in the agent-scoped session_transcripts table (migration 040). Normal capture does not create Markdown transcript copies.

The session-end, recovery, and TTL paths mark a transcript row complete directly; no summary worker is involved. A completed transcript row is the Dreaming input for that session. Dreaming reads a sanitized projection: tool calls become markers, tool outputs are omitted, and credentials are redacted. The stored row is not rewritten.

POST /api/memory/remember accepts an optional transcript field. On a remember that saves a new memory, a nonempty transcript with a sourceId (the session key) is written to session_transcripts inside the same transaction as the memory, replacing any content already stored for that session, so send the complete transcript each time. When the request is restricted to one project and the session’s existing transcript belongs to another project, the whole transaction rolls back and the route returns 409 with this session's transcript belongs to another project. The transcript is not written when the remember deduplicates to an existing memory, when oversized content is split into chunks, or when transcript admission skips the session (for example, after its transcript was deleted).

The legacy expand recall parameter is still accepted but does not attach whole transcripts to recalled memories. Ordinary recall can still return bounded transcript excerpts as separate results. To read a session’s conversation, use GET /api/sessions/:key/transcript.

MEMORY.md is not canonical history. It is a credential-redacted projection of the head that a Dreaming content pass curates and commits. It is not rendered from memory rows, and it has no fixed set of sections. See Dreaming and semantic writes for how the head is staged and committed.

Markdown transcript, summary, and compaction artifacts from earlier versions remain readable for provenance. The compaction-complete hook can still write a compaction artifact. The mid-session session-checkpoint-extract endpoint records a continuity checkpoint but does not create a summary job or deliver an intermediate transcript to Dreaming.