Tiered memory

From bradygaster/squad · View interactive version

Tiered memory is an AI agent skill from the GitHub repository bradygaster/squad. Three-tier agent memory model (hot/cold/wiki) for context reduction per spawn

How to use this skill

Skill file

Skill: Tiered Agent Memory

Status (v0.10.0): This skill describes a design proposal, not a shipped runtime. Skill files install via squad init/upgrade, but the underlying tier scaffolding (.squad/memory/hot/, cold/, wiki/), Scribe promotion logic, and spawn-template tier-aware reads are tracked in bradygaster/squad#1264. Until those land, agents continue to load full history.md + decisions.md on every spawn.

Overview

Squad agents today load their full context history on every spawn, which grows unboundedly across sessions. The Tiered Agent Memory model proposes a three-tier separation so agents only load the bytes that are actually relevant to the current task, with older context kept available on demand.


Memory Tiers

🔥 Hot Tier — Current Session Context

❄️ Cold Tier — Summarized Cross-Session History

📚 Wiki Tier — Durable Structured Knowledge


When to Load Each Tier

| Situation | Hot | Cold | Wiki |

|-----------|-----|------|------|

| New task, no prior context needed | ✅ | ❌ | ❌ |

| Resuming interrupted work | ✅ | ✅ | ❌ |

| Debugging a recurring issue | ✅ | ✅ | ❌ |

| Implementing against a spec/ADR | ✅ | ❌ | ✅ |

| Onboarding to unfamiliar subsystem | ✅ | ❌ | ✅ |

| Post-incident review | ✅ | ✅ | ✅ |


Spawn Template Pattern

The default spawn prompt should include Hot tier only:

## Memory Context

### Hot (current session)
{hot_context}

Add --include-cold when the task needs history:

## Memory Context

### Hot (current session)
{hot_context}

### Cold (summarized history — load on demand)
See: .squad/memory/cold/{agent-name}.md

Add --include-wiki when the task needs domain knowledge:

## Memory Context

### Hot (current session)
{hot_context}

### Wiki (durable reference)
See: .squad/memory/wiki/{topic}.md

Integration with Scribe Agent (design — not yet implemented)

Scribe is the proposed memory coordinator for this system. Once the runtime lands, Scribe will:

  1. End of session: Compress Hot → Cold summary (target: ~10% of session verbosity)
  2. Aged cold entries: Promote Cold → Wiki for decisions/facts that aged into stable knowledge
  3. On-demand wiki writes: Any agent can request Scribe to write a wiki entry mid-session

Until then, see the Scribe charter for current behavior: .squad/agents/scribe/charter.md


Implementation Checklist (tracked in #1264)


References


Spawn Template

Spawn Template: Agent with Tiered Memory

Use this template when spawning any Squad agent. By default it loads Hot tier only. Add optional sections as needed.


Task

{task_description}

WHY

{why_this_matters}

Success Criteria


Memory Context

🔥 Hot (always included)

Paste current session context here (~2–4KB target):

Current task: {task_description}
Active decisions: {decisions_this_session}
Last actions: {last_3_to_5_actions}
Blockers: {current_blockers_or_none}
Talking to: {current_interlocutor}

❄️ Cold (include when task needs history — add `--include-cold`)

Load on demand. Do not inline unless specifically needed.

Summarized cross-session history is at:

.squad/memory/cold/{agent-name}.md

Include when:

To load cold memory, add this section and fetch the file before spawning:

## Cold Memory Summary
{contents_of_.squad/memory/cold/{agent-name}.md}

📚 Wiki (include when task needs domain knowledge — add `--include-wiki`)

Load on demand. Reference specific wiki docs by path.

Wiki entries are at: .squad/memory/wiki/

Include when:

To load wiki, add this section and reference the specific doc:

## Wiki Reference
{contents_of_.squad/memory/wiki/{topic}.md}

Escalation

If blocked or uncertain:


Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.