agentleFS
edenbuildsedenbuilds/agentloop/.agents/skills/persistent-memory/SKILL.md

persistent-memory

Skill0 starsChanged 4 months agoMITView on GitHub

Native local-first persistent memory for agentloop. Extract, store, supersede, contradict, and retrieve durable knowledge via .agentloop/memory and scripts/memory.sh. Use across sessions; integrate with handoff and context-surgeon. Cloud sync is reserved for later — do not call external memory APIs.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not store: transcripts, secrets, ephemeral debug, green-CI fantasies.

    line 48
  2. Distinctive:

    When knowledge changes, do not silently edit history.

    line 66
  3. Distinctive:

    When two active memories conflict and both must remain visible:

    line 80
  4. Distinctive:

    Prefer memory keys + DIGEST over chat archaeology

    line 101
  5. Distinctive:

    Never drop current failing gate logs into memory as “facts”

    line 103

“Common” is measured: kept by at least 6 in 10 of the 7 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

Persistent Memory (native, local-first)

Session handoffs (.agentloop/handoff.md) are short-term continuity.
.agentloop/memory/ is durable knowledge that survives new chats.

Inspired by Supermemory’s extract → store → update → retrieve loop — implemented fully offline with files + scripts/memory.sh.

Store layout

.agentloop/memory/
  index.json
  DIGEST.md
  entries/<key>.md

Init if missing: scripts/memory.sh init

Loop (do this explicitly)

1. Retrieve (session start / before plan)

scripts/memory.sh session-brief
# or
scripts/memory.sh session-brief "keyword"
scripts/memory.sh search "keyword"
scripts/memory.sh get some.key

Cite what you loaded in one short block. Honor constraint and preference entries.

2. Extract (what is worth remembering?)

Store only if it should survive a cold start:

  • Architectural decision
  • User preference / constraint (“never X”, “always Y”)
  • Stable system map
  • Lesson from a failed approach
  • Durable fact about this repo

Do not store: transcripts, secrets, ephemeral debug, green-CI fantasies.

3. Store / upsert

scripts/memory.sh upsert \
  --key conductor.plan-gate \
  --kind decision \
  --title "Conductor approval gate" \
  --summary "Multi-step work requires /plan approval before Execute." \
  --tags harness,plan \
  --pointers skills/conductor-plan/SKILL.md,commands/plan.md

Kinds: decision | preference | constraint | map | lesson | fact

4. Update / supersede

When knowledge changes, do not silently edit history. Supersede:

scripts/memory.sh supersede old.key \
  --key new.key \
  --kind decision \
  --summary "New truth..." \
  --tags harness

Old entry → status: superseded + superseded_by. New entry → active + supersedes.

5. Contradictions

When two active memories conflict and both must remain visible:

scripts/memory.sh contradict a.key --with b.key --note "why they conflict"

Both become contradicted and cross-link. Resolve later by superseding one or both with a unifying decision.

6. Handoff integration

On every meaningful run end / slice boundary:

  1. Refresh .agentloop/handoff.md
  2. Upsert durable facts discovered this run
  3. Set memory_keys: [keys...] on the handoff
  4. scripts/memory.sh digest

7. Context-surgeon integration

When compacting:

  • Prefer memory keys + DIGEST over chat archaeology
  • Promote durable conclusions with upsert/supersede before dropping chat detail
  • Never drop current failing gate logs into memory as “facts”

Cloud (future only)

Entries include cloud_sync: local_only. Do not integrate Supermemory or other cloud APIs now. A future adapter may flip pending → synced.

Agent checklist

  • session-brief at cold start
  • Upsert after durable decisions
  • Supersede on knowledge updates
  • List memory_keys on handoff
  • No secrets in entries

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.