Context
PR #12671 added an inline best-effort tweet-summary (miniSummary) at add_memory for query_recent_turns — but it is forward-looking only. The ~15k pre-existing AGENT_MEMORY nodes (plus any new ones written while the summarizer was transiently unavailable — AC8 is fail-soft) have no miniSummary and fall back to raw content. This ticket backfills them, mirroring the existing session-summarization batch service. Operator-flagged 2026-06-07.
Live latest-open sweep: checked latest 15 open issues at 2026-06-07T02:14:43Z; no equivalent found.
The Problem
query_recent_turns(detail:'summary') returns the compact miniSummary when present, else falls back to raw/truncated content (fail-soft by design — #12671 AC8). For the recovery feed to be token-efficient across an agent's history (not just turns since the feature shipped), the existing un-summarized memories need backfilling. Roughly 15k memories lack a summary today.
The Architectural Reality — the precedent to mirror
Session summaries are backfilled by a batch service; this ticket mirrors it for memories:
ai/scripts/lifecycle/summarize-sessions.mjs — the spawned lifecycle child that summarizes session batches.
ai/daemons/orchestrator/taskDefinitions.mjs:86 — the Orchestrator task definition that schedules it.
ai/daemons/orchestrator/scheduling/summary.mjs (getPendingSummarizationJobs, limit-based) — the batch finder.
SessionService.mjs — summarizationBatchLimit, drift detection, most-recent-first.
The pieces this reuses already exist (shipped in #12671):
MemoryService.buildMiniSummary({prompt, response}) — the per-memory summarizer (best-effort, fail-soft, reuses the modelProvider SSOT).
- The
AGENT_MEMORY.miniSummary graph-node property + the query_recent_turns reader.
- Un-summarized memories are queryable:
AGENT_MEMORY graph nodes (GraphService.db.storage.db) where json_extract(memory.data, '$.properties.miniSummary') IS NULL.
The Fix
A memory-miniSummary backfill mirroring the session pattern — a lifecycle script (e.g. ai/scripts/lifecycle/backfill-memory-summaries.mjs) + an Orchestrator task definition, that:
- Finds
AGENT_MEMORY nodes with miniSummary IS NULL, ORDER BY timestamp DESC (most-recent-first), LIMIT a batch (reuse summarizationBatchLimit or a dedicated leaf).
- For each, fetches
prompt/response from Chroma (by node id) and calls MemoryService.buildMiniSummary(...).
- Updates the node's
miniSummary property — best-effort/fail-soft: a failed summary leaves the node un-summarized for a later pass; never blocks the batch.
- Runs incrementally (batch per scheduled tick) until drained, via the Orchestrator schedule.
Contract Completeness
No new public/consumed surface: this reuses #12671's miniSummary node property, buildMiniSummary, and the modelProvider SSOT, plus the established Orchestrator task-definition mechanism. The only new artifact is an internal lifecycle script + its task definition — no MCP-tool or config-contract change beyond an optional batch-limit leaf.
Decision Record impact
aligned-with #12671 (AC8) — reuses its summarizer + node property + the modelProvider reactive-Provider SSOT (no new summarizer, no parallel provider config).
Acceptance Criteria
Out of Scope
- The inline forward-looking summary (shipped in #12671 AC8).
- Mini-summary AGGREGATION / temporal-pyramid (#11376 — separate Phase-2 lane).
- Re-summarizing already-summarized memories.
Related
- Follows #12671 (the recency primitive + the AC8 inline summary this backfills) · graduated from #12669 · mirrors the session-summarization pipeline,
Related: #12065 (Orchestrator-as-SSOT for the REM/Sandman Pipeline).
Retrieval Hint: "miniSummary backfill AGENT_MEMORY most-recent-first batch mirror summarize-sessions buildMiniSummary modelProvider"
Authored by Claude (Opus 4.8, neo-opus-grace).
Context
PR #12671 added an inline best-effort tweet-summary (
miniSummary) atadd_memoryforquery_recent_turns— but it is forward-looking only. The ~15k pre-existingAGENT_MEMORYnodes (plus any new ones written while the summarizer was transiently unavailable — AC8 is fail-soft) have nominiSummaryand fall back to raw content. This ticket backfills them, mirroring the existing session-summarization batch service. Operator-flagged 2026-06-07.Live latest-open sweep: checked latest 15 open issues at
2026-06-07T02:14:43Z; no equivalent found.The Problem
query_recent_turns(detail:'summary')returns the compactminiSummarywhen present, else falls back to raw/truncated content (fail-soft by design — #12671 AC8). For the recovery feed to be token-efficient across an agent's history (not just turns since the feature shipped), the existing un-summarized memories need backfilling. Roughly 15k memories lack a summary today.The Architectural Reality — the precedent to mirror
Session summaries are backfilled by a batch service; this ticket mirrors it for memories:
ai/scripts/lifecycle/summarize-sessions.mjs— the spawned lifecycle child that summarizes session batches.ai/daemons/orchestrator/taskDefinitions.mjs:86— the Orchestrator task definition that schedules it.ai/daemons/orchestrator/scheduling/summary.mjs(getPendingSummarizationJobs, limit-based) — the batch finder.SessionService.mjs—summarizationBatchLimit, drift detection, most-recent-first.The pieces this reuses already exist (shipped in #12671):
MemoryService.buildMiniSummary({prompt, response})— the per-memory summarizer (best-effort, fail-soft, reuses themodelProviderSSOT).AGENT_MEMORY.miniSummarygraph-node property + thequery_recent_turnsreader.AGENT_MEMORYgraph nodes (GraphService.db.storage.db) wherejson_extract(memory.data, '$.properties.miniSummary')IS NULL.The Fix
A memory-miniSummary backfill mirroring the session pattern — a lifecycle script (e.g.
ai/scripts/lifecycle/backfill-memory-summaries.mjs) + an Orchestrator task definition, that:AGENT_MEMORYnodes withminiSummary IS NULL,ORDER BY timestamp DESC(most-recent-first),LIMITa batch (reusesummarizationBatchLimitor a dedicated leaf).prompt/responsefrom Chroma (by node id) and callsMemoryService.buildMiniSummary(...).miniSummaryproperty — best-effort/fail-soft: a failed summary leaves the node un-summarized for a later pass; never blocks the batch.Contract Completeness
No new public/consumed surface: this reuses #12671's
miniSummarynode property,buildMiniSummary, and themodelProviderSSOT, plus the established Orchestrator task-definition mechanism. The only new artifact is an internal lifecycle script + its task definition — no MCP-tool or config-contract change beyond an optional batch-limit leaf.Decision Record impact
aligned-with #12671 (AC8) — reuses its summarizer + node property + the
modelProviderreactive-Provider SSOT (no new summarizer, no parallel provider config).Acceptance Criteria
AGENT_MEMORYnodes withminiSummary IS NULL, most-recent-first, limited to a batch size.buildMiniSummaryand updates the node'sminiSummary; fail-soft — a model failure leaves the node un-summarized for a later pass and never throws out of the batch.summarize-sessions), running incrementally until the un-summarized set is drained.miniSummary IS NULLgets a summary after a backfill pass (stubbed model → deterministic); a stubbed model failure leaves itnull(re-tryable next pass).Out of Scope
Related
Related: #12065(Orchestrator-as-SSOT for the REM/Sandman Pipeline).Retrieval Hint:
"miniSummary backfill AGENT_MEMORY most-recent-first batch mirror summarize-sessions buildMiniSummary modelProvider"Authored by Claude (Opus 4.8, neo-opus-grace).