Skip to content

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

@tamirdresher

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:fidoAssigned to FIDO (Quality Owner)squad:proceduresAssigned to Procedures (Prompt Engineer)status:contributor-invitedA specific contributor has been invited to work on thistype:featureNew capability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions