Skip to content

feat: Tiered agent memory — hot/cold/wiki layers for context management #600

Closed as not planned

Description

@tamirdresher

Problem

Agent history.md files grow to 70KB+ (18K tokens). Agents load everything at spawn, burning context window on old noise. Current summarization (>12KB threshold) helps but doesn't distinguish between recent actionable context and archived knowledge.

Proposal

Three-tier memory architecture:

Layer File Loaded Content
Hot history.md Always at spawn Core Context + last ~20 entries + active-issue-tagged entries
Cold history-archive.md On demand Summarized old entries, preserved for reference
Durable GitHub Wiki Searchable by all agents Major findings, architecture patterns, test results

Scribe maintains the split: During regular maintenance, move old unstructured work reports to archive first (biggest bloat source). Keep issue-tagged entries in hot layer until issue closes.

Spawn template change: Agents read hot by default. Only read cold when task explicitly references historical context.

Measurements

  • Top agents: 34-74KB history files (8.8K-18.5K tokens)
  • 82-96% is old learnings/work reports
  • Realistic savings: 20-55% token reduction per spawn
  • Wiki provides cross-agent knowledge sharing without loading into each agent's context

Deliverables

  • Skill template: .squad/skills/tiered-history/SKILL.md
  • Scribe charter update: hot/cold maintenance rules
  • Wiki-write skill for durable knowledge
  • Spawn template: conditional cold-layer loading

Activity

  1. tamirdresher commented on Mar 24, 2026

    @tamirdresher
    CollaboratorAuthor

    Revision after checking main: The 12KB summarization threshold and history-archive.md pattern already exist. What's NEW in this proposal: (1) explicit hot/cold tier model with promotion/demotion logic (not just 'summarize at 12KB'), (2) wiki as a third durable layer for cross-agent knowledge sharing, (3) issue-tag-based retention (keep entries tagged with active issues in hot layer). The runtime tiered retrieval is the gap.

  2. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    📋 Assigned to Procedures (Prompt Engineer)

    Issue: #600 — feat: Tiered agent memory — hot/cold/wiki layers for context management

    Procedures will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    Procedures, work on issue #600

  3. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #600 — feat: Tiered agent memory — hot/cold/wiki layers for context management
    Assigned to: FIDO (Quality Owner)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: 🔴 Not suitable — issue involves work outside the coding agent's capability profile.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  4. bradygaster commented on Mar 26, 2026

    @bradygaster
    Collaborator

    Triage: Contributor-submitted feature (Tamir). Tiered memory architecture for agent context management. Assigned to Procedures (prompt architecture) for review.

  5. diberry commented on Mar 31, 2026

    @diberry
    Contributor

    🔄 Ralph status: Feature — 3-tier memory (hot/cold/wiki). Research done in #686. Superset of #595. No implementation PR yet.

  6. tamirdresher commented on Jun 6, 2026

    @tamirdresher
    CollaboratorAuthor

    The Warm/Cold distinction is sharper than what''s in #600 — temporal distance isn''t the right tier boundary. The actual one is access cost: Warm is cheap to load on detected relevance; Cold has a search latency cost. There''s a MemoryLoadGuidance: ON-DEMAND enum at memory/index.ts:12 that maps to exactly this; it just isn''t wired to anything yet. That''s a gap Seven and I both glossed over. The provenance/confidence point on Wiki entries is a genuine design contribution too: cross-agent wiki reads quietly become unreliable the moment you can''t weight entries by origin — "API timeout is 30s" from a passing integration test is not the same as a one-session observation with the same text. Treating them identically is a correctness problem, not just a trust signal nicety. Didn''t frame it that precisely in #600 and should have.

    What is shipped: the retention layer. TwoLayerBackend (state-backend.ts:922) with promoteNotes() at state-backend.ts:1005, called by the squad notes promote CLI and Ralph''s notes-promote heartbeat capability. The write side of Cold→Hot also exists: archive_on_close is parsed and honored at state-backend.ts:1042. What isn''t shipped: the relevance-triggered lift when an issue reopens or a Cold file gets touched — and spawn-time tiered loading entirely. spawn.ts:117 doesn''t inject history.md at all; reading history is an agent-side tool-call convention, not something the spawn layer handles. --include-cold doesn''t exist in the TypeScript. Your 4-tier model would land on an unfinished foundation — the loading side isn''t there yet.

    You''re not the only external voice arriving here independently: @idangutman filed #1184 around the same time with a parallel two-tier proposal — an always-loaded index plus on-demand per-topic files. Additive, not competing: his covers the Hot/Warm loading split cleanly; yours adds the Warm/Cold access-cost framing, Cold archive, and trust metadata on Wiki that his deliberately skips. Two independent designs converging on tiered memory makes the case for shipping the runtime.

    For tracking: Warm tier and Cold→Hot promotion fit here. Wiki provenance/confidence and cross-agent wiki sharing belong in #640 — I''ll add a comment there linking back to your point. Squad''s spawn API isn''t stable enough yet for a real handshake with AgentRelay''s model; when a spawn-API design doc materializes, I''ll drop a reference here.

  7. 9 remaining items

  8. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: Flight
    Reason: No module, routing, or role keyword match — routed to Lead/Architect
    Source: lead-fallback

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  9. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: Flight
    Reason: No module, routing, or role keyword match — routed to Lead/Architect
    Source: lead-fallback

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  10. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: Flight
    Reason: No module, routing, or role keyword match — routed to Lead/Architect
    Source: lead-fallback

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  11. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: Flight
    Reason: No module, routing, or role keyword match — routed to Lead/Architect
    Source: lead-fallback

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  12. github-actions commented on Sep 13, 2026

    @github-actions
    Contributor

    🔄 Ralph — Auto-Triage

    Assigned to: architect
    Reason: No module, routing, or role keyword match — routed to Lead/Architect
    Source: lead-fallback

    Ralph auto-triaged this issue using routing rules.
    To reassign, swap the squad:* label.

  13. added
    squad:state-storage-devAssigned to state-storage-dev (State & Storage Engineer)
    and removed
    squad:architectAssigned to architect (Lead Architect)
    on Sep 24, 2026
  14. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    📋 Assigned to state-storage-dev (State & Storage Engineer)

    Issue: #600 — feat: Tiered agent memory — hot/cold/wiki layers for context management

    state-storage-dev will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    state-storage-dev, work on issue #600

  15. bradygaster commented on Nov 5, 2026

    @bradygaster
    Collaborator

    Closing during 2.0 board triage (owner decision). The idea is evaluated, with prior art and an opinion, in the roll-up issue #2390. Original text remains here for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:state-storage-devAssigned to state-storage-dev (State & Storage Engineer)status:contributor-invitedA specific contributor has been invited to work on thistriagedIssue has been triagedtype:featureNew capabilitywave:3-laterWave 3 — backlog, future

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions