agentleFS
shali10shali10/awesome-agent-skills/skills/tiered-memory/SKILL.md

tiered-memory

Skill1 starsChanged 2 months agoMITView on GitHub

Use when designing or managing AI Agent persistent memory architectures to prevent context overflow while preserving durable facts.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use squad-commands and {skill-name}.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    squad-commands

    Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    {skill-name}

    {what this skill teaches agents}

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Saving transient task progress to L1 Core Memory: Never record PR numbers, bug fixes, or step counts to MEMORY.md.

    line 41
  2. Very specific:

    Imperative phrasing in memory: Write memories as declarative facts ("User prefers concise tables" ✓), not directives ("Always output …

    line 42
  3. Distinctive:

    Memory Sprawl: When L1 exceeds 70% capacity, trigger automatic consolidation: merge duplicates, prune obsolete entries, and offload …

    line 43

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tiered Memory Architecture for Autonomous Agents

Overview

A deterministic, layered memory engineering framework that replaces naive full-context injection. It organizes agent memory into 4 distinct tiers (Core Injected, Topic Notes, Searchable Session History, and Ephemeral Working Memory), ensuring high signal-to-noise ratio and zero context bloating.

When to Use & When NOT to Use

When to Use

  • Agent system design where memory exceeds 5,000 characters and causes context degradation.
  • Multi-session persistence: preserving stable user preferences and environmental facts across restarts.
  • Preventing memory drift and hallucinatory rule overrides.

When NOT to Use

  • Short, one-shot CLI tasks with no cross-session continuity requirements.
  • Raw logging or storing multi-megabyte datasets (store in database / file assets instead).

The 4-Tier Memory Hierarchy

TierNameStorage LocationInjected Every Turn?Capacity BudgetContents & Purpose
L1Core MemoryMEMORY.md & USER.md✅ Yes≤ 10,000 chars (15%)Durable user preferences, hard security redlines, production anchors
L2Topic Notesnotes/*.md❌ On-demandUncapped (file-based)Detailed architecture specs, server inventory, API docs read as needed
L3Session HistorySQLite state.db (FTS5)❌ Via searchMillions of messagesFTS5/Vector searchable past conversations and exact debug logs
L4Ephemeral ScratchpadSession context / /tmp🔄 Current turnCleared on exitIntermediate tool results, active plan steps, disposable data

Common Pitfalls

  1. Saving transient task progress to L1 Core Memory: Never record PR numbers, bug fixes, or step counts to MEMORY.md; they become stale in 7 days. Use session search instead.
  2. Imperative phrasing in memory: Write memories as declarative facts ("User prefers concise tables" ✓), not directives ("Always output tables" ✗), to avoid overriding runtime instructions.
  3. Memory Sprawl: When L1 exceeds 70% capacity, trigger automatic consolidation: merge duplicates, prune obsolete entries, and offload detailed guides to L2 notes.

Verification Checklist

  • L1 Core Memory is ≤ 70% of configured char budget.
  • No temporary TODO state or session logs exist in MEMORY.md.
  • Topic notes in notes/ contain structured YAML frontmatter.
  • Database FTS5 index is synchronized with message store.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.