agent-memory
Skill33 starsChanged 22 days agoMITView on GitHub
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and preventing memory from becoming stale. Trigger on "agent forgets everything between sessions", "agent keeps retrying the same failed approach". Do not use for trimming the current context window — see the context-engineering skill; for human-written project instructions, see the agent-instructions skill.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 31 edited versions we read keep these.
2
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
- Distinctive: line 55
Do not persist the conversation.
- Distinctive: line 103
If a memory file exceeds a couple of hundred lines, it has stopped being memory and become a document.
“Common” is measured: kept by at least 6 in 10 of the 31 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.
Files
Agent Memory
Purpose
Give an agent state that outlives its context window. Anything the agent must not forget belongs in a file it can re-read — not in a conversation history that will be compacted away.
When to Use
- A task that spans more turns than the context window holds.
- Work that continues across sessions.
- An agent that repeatedly rediscovers the same fact or repeats the same failed approach.
- Accumulating knowledge about a codebase or a domain over time.
Capabilities
- Deciding what deserves persistence.
- File-based memory the agent reads and writes.
- Structuring notes for retrieval rather than for narrative.
- Staleness detection and pruning.
Inputs
- The task and its expected duration.
- What has been learned that would be expensive to rediscover.
- What has been tried and failed.
Outputs
- A memory file that survives compaction and session end.
- Notes structured so that the relevant part is findable.
- A pruning discipline so the memory does not become a stale swamp.
Workflow
- Write down what would be expensive to rediscover — File locations, API shapes, the reason an approach was abandoned, a constraint the user stated once. Not the narrative of how you got there.
- Write it as facts, not as a story — "The auth middleware is in
src/mw/auth.tsand it does not run on/health." Not "I looked for the auth middleware and eventually found it." - Record failures explicitly — "Tried X. It does not work because Y." This is the highest-value memory content, because without it the agent will try X again.
- Re-read at the start of each session — Memory that is not read is not memory.
- Prune what is stale — A note that was true three refactors ago is now a trap. Date the entries and check them.
- Keep it small — This file is loaded every session. It competes with the actual work for context.
Best Practices
- The most valuable memory is a record of what failed and why. Without it, an agent will confidently repeat a failed approach in a new session.
- Structure the file so the agent can find the relevant section without reading all of it. Headings, not prose.
- Do not persist the conversation. Persist the conclusions.
- A memory file that grows monotonically will eventually be mostly wrong. Pruning is part of the discipline, not an afterthought.
- Distinguish stable facts (architecture, conventions) from working state (what I am doing now). They have different lifetimes and belong in different sections or different files.
- Date the entries. A fact from six months ago about a fast-moving codebase is a hypothesis.
Examples
A memory file structured for retrieval:
# Working memory — orders service migration
_Last updated: 2026-06-14_
## Stable facts (verified, unlikely to change)
- Auth middleware: `src/middleware/auth.ts`. Runs on every route EXCEPT
`/health` and `/metrics` (see the exclusion list at line 22).
- Money is `Money` (integer minor units) throughout. There is no float money
anywhere and there must not be.
- The migration runner is `pnpm db:migrate`. It does NOT run automatically on
deploy — this is deliberate; migrations are run manually before the deploy.
## Current task
Strangling `legacy/billing` into `src/features/billing`.
Done: invoice generation, proration.
Next: refunds.
Not started: dunning, tax.
## Tried and failed — do not repeat
- 2026-06-02: Tried to run the two billing paths in parallel and diff the
outputs. Abandoned: the legacy path writes to the ledger as a side effect,
so running both double-writes. Shadow mode requires a read-only ledger
adapter, which does not exist yet.
- 2026-06-09: Tried extracting `PricingEngine` first. It depends on
`LegacyCustomer`, which depends on half the legacy module. The dependency
runs the wrong way; extract `Customer` first.
## Open questions for the user
- Should refunds issued before the migration remain visible in the new UI?
(Asked 2026-06-11, not yet answered.)The "tried and failed" section is what stops the next session from spending two hours rediscovering that shadow mode double-writes the ledger.
Notes
- Without a memory of failed approaches, an agent starting a fresh session will reason its way to the same plausible-but-wrong approach it already abandoned. This is the most common and most wasteful memory failure.
- Memory and context compaction serve the same goal from different directions: compaction summarizes what happened, memory records what was concluded. Both are needed.
- If a memory file exceeds a couple of hundred lines, it has stopped being memory and become a document. Prune it or split it.
Other versions36 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 36
- tigerless-labs/agent-memory★ 4.3ksame name
- databricks/app-templates★ 217same name
- OpenHands/extensions★ 167same name
- JKHeadley/instar★ 85same name
- VoDaiLocz/kilo-kit-mcp★ 28same name
- jayzeng/agentmemory★ 24same name
- komluk/scaffolding★ 15same name
- xChuCx/agent-memory★ 11same name
- t4sh/skills4sh★ 5same name
- GPTtang/skill-atlas★ 4same name
26 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use data-analysis, webapp-testing and 4 more.
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.
shanggqmSkilldata-analysis
数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。
Also in 3 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 4 projects that use this
OpenAISkillexecuting-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Also in 3 projects that use this
OpenAISkillsubagent-driven-development
Use when executing implementation plans with independent tasks in the current session
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 6 projects that use this
- +1 more from openai
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

