memory-manager
Skill52 starsChanged 8 months agoMITView on GitHub
Manage long-term AI R&D memory: retrieval, writeback, promotion, and shared export. TRIGGER when: run bootstrap, each new user turn, each execution batch, significant failure, replan, high-resource action, long-action resume, final report handoff, or compaction markers detected (Compact/压缩/Summary). DO NOT TRIGGER when: the exact same retrieval was just performed, freshness is still valid, and no new objective/stage/error signal appeared.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- wulaosiji/skillstheir own version, first seen Nov 1, 2026
- diegovasquez-ai/skills-apptheir own version, first seen Oct 25, 2026
- 2017java/super-agent-memory-managertheir own version, first seen Oct 20, 2026
- luolin-ai/openclawWeComzhtheir own version, first seen Oct 8, 2026
- chinkan/RustFoxtheir own version, first seen Sep 22, 2026
- jiawood2006/hermes-skillstheir own version, first seen Aug 24, 2026
Used with
Projects with it also use skill-creator.
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.
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 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- luolin-ai/openclawWeComzh★ 108same name
- GulajavaMinistudio/awesome-copilot-id★ 92same name
- 9thLevelSoftware/legion★ 76same name
- wulaosiji/skills★ 28same name
- kunwl123456/zeroclaw-skills-collection★ 27same name
- diegovasquez-ai/skills-app★ 14same name
- chinkan/RustFox★ 11same name
- claude-office-skills/claude-office-plugin★ 9same name
- claude-world/claude-agent★ 5same name
- jiawood2006/hermes-skills★ 2same name
1 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.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- deep-researchSkill
- experiment-executionSkill
- human-checkpointSkill
- paper-writingSkill
- project-contextSkill
- research-planSkill
- research-workflowSkill
- run-governorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
50 rules. 0 are common, 31 are distinctive, and 19 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
31
Distinctive
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 35
default retrieval layer before acting
- Distinctive: line 66
every new user turn
- Distinctive: line 67
every execution batch before acting
- Distinctive: line 69
every significant failure or new error signature
- Distinctive: line 70
every high-resource or irreversible action
- Distinctive: line 71
every long-action resume or post-poll decision
- Distinctive: line 72
before final answer or report handoff
- Very specific: line 73
when modifying memory-manager or another Memory-related skill/instruction
- Very specific: line 74
when compaction markers such as Compact, 压缩, or Summary appear
- Distinctive: line 90
add tags and FTS when exact filters miss
- Very specific: line 91
prefer active procedures/insights when confidence is similar
- Distinctive: line 92
prefer recent local episodes over shared memory unless local retrieval is clearly low-yield
- Very specific: line 93
if retrieval is low-yield, keep going, but record memory_skip_reason or memory_low_yield_reason
- Distinctive: line 97
Treat shared memory as an optional read-only source, not as project-local memory.
- Very specific: line 100
If local retrieval is low-yield, query the user-configured shared repo from project-context.
- Very specific: line 102
Use read-only retrieval against the local shared repo checkout.
- Distinctive: line 103
Avoid syncing the shared repo on every run or stage.
- Very specific: line 108
Treat hits as external/shared evidence until they are validated in the current project.
- Very specific: line 109
Do not rewrite shared records into local episode/procedure/insight as if they were observed locally unless the current run reproduced them.
- Distinctive: line 113
Write conservatively, but more frequently than before:
- Very specific: line 115
write a concise working delta after every execution batch
- Very specific: line 116
write a concise working delta after every long-action poll cycle that changes status or next step
- Very specific: line 117
write episode at milestones, major failure, replan, or human intervention
- Very specific: line 118
create procedure draft after repeated successful pattern or validated recovery workflow
- Very specific: line 119
create insight draft after cross-task recurring evidence
- Distinctive: line 121
when a completed long-running action produces results that affect later decisions, record the result summary before leaving watch mode
- Distinctive: line 137
Treat stale continuity state as risk:
- Very specific: line 154
write working delta after every execution batch
- Very specific: line 165
When skipped, log memory_skip_reason for auditability.
- Distinctive: line 169
When memory is auto-compressed/summarized:
- Distinctive: line 181
Use layer-specific timing to keep retrieval frequent but useful:
- Distinctive: line 184
before every execution batch
- Distinctive: line 185
before high-resource or irreversible actions
- Distinctive: line 186
after stalled or failed background jobs
- Distinctive: line 190
when repeated failure indicates recent local history may help
- Distinctive: line 193
when evidence conflicts or root cause is unclear
- Distinctive: line 194
before final report/answer to run boundary checks
- Distinctive: line 203
before final user-facing delivery
- Distinctive: line 207
If execution becomes repetitive or confused:
- Very specific: line 210
run targeted retrieval by project/task/error signature
- Distinctive: line 211
if drift followed compaction or summary-style recovery, read prior Memory before publishing or trusting a compact state summary
- Distinctive: line 216
When context may have been compressed:
- Very specific: line 219
if any marker is present, call memory-manager to read prior Memory before editing instructions, planning next actions, or resuming execution
- Distinctive: line 220
if prior Memory cannot be read, treat that as an active blocker because key context may be missing
- Distinctive: line 234
Treat shared export as post-task work:
- Distinctive: line 236
do not export during main task execution
- Very specific: line 238
never export noisy working state
- Very specific: line 247
use pull-based flow: local export -> codex/* branch -> PR -> review -> merge
- Distinctive: line 248
never push directly to main
- Distinctive: line 253
Use the helper script for lightweight read-only search of a local shared repo checkout:
“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.
Files
Memory Manager
Mission
Build compounding capability by turning execution traces into reusable, evidence-linked memory, with retrieval centered on prior experience rather than only current working state.
Load References
Load these files before writing or promoting records:
references/memory-layout.mdreferences/memory-templates.mdreferences/sqlite-schema.sql
Memory Types
Manage these layers:
working- run-scoped continuity state
- resume after compaction, interruption, or long waits
episode- concrete run case records
- useful for similar errors, repeated attempts, and local history
procedure- highest-priority execution memory
- default retrieval layer before acting
insight- cross-task abstraction, tradeoffs, boundaries, and contradiction handling
persona- behavior config only
Working Memory Contract
working must include:
goalstagehypothesislast_actionlast_observationnext_stepblockersevidence_refsactive_action_idstodo_activetodo_donetodo_blocked
Todo granularity should be task-level (small stages/subtasks), not command-level.
Experience-First Retrieval Policy
Prior experience retrieval is the default. working is important for continuity, but it is not the only retrieval path and should not crowd out reusable experience.
Mandatory retrieval triggers:
- every new user turn
- every execution batch before acting
- every replan
- every significant failure or new error signature
- every high-resource or irreversible action
- every long-action resume or post-poll decision
- before final answer or report handoff
- when modifying
memory-manageror another Memory-related skill/instruction - when compaction markers such as
Compact,压缩, orSummaryappear
Default retrieval order:
procedure- mandatory before every execution batch
episode- mandatory when a similar failure, repeated attempt, or same task type is present
insight- mandatory during planning, tradeoff analysis, contradiction handling, or final answer shaping
working- mandatory for resume, compaction recovery, long-action reconciliation, and final handoff
Query strategy:
- query by
project,task_type,error_signature, and stage first - add tags and FTS when exact filters miss
- prefer
activeprocedures/insights when confidence is similar - prefer recent local episodes over shared memory unless local retrieval is clearly low-yield
- if retrieval is low-yield, keep going, but record
memory_skip_reasonormemory_low_yield_reason
Shared Retrieval Policy
Treat shared memory as an optional read-only source, not as project-local memory.
- Query project-local memory first.
- If local retrieval is low-yield, query the user-configured shared repo from
project-context. - Resolve the local shared repo path from
memory.shared_repo.path; if missing, ask the user where the repo should live and persist it throughproject-context. - Use read-only retrieval against the local shared repo checkout; do not mirror shared records into
.project_localby default. - Avoid syncing the shared repo on every run or stage.
- Sync only when:
- the shared repo checkout is missing and the user approved clone/bootstrap
- a retrieval gap remains and the local shared repo is suspected stale
- immediately before exporting shared memory
- Treat hits as
external/sharedevidence until they are validated in the current project. - Do not rewrite shared records into local
episode/procedure/insightas if they were observed locally unless the current run reproduced them.
Writeback Policy
Write conservatively, but more frequently than before:
- write a concise
workingdelta after every execution batch - write a concise
workingdelta after every long-action poll cycle that changes status or next step - write
episodeat milestones, major failure, replan, or human intervention - create
proceduredraft after repeated successful pattern or validated recovery workflow - create
insightdraft after cross-task recurring evidence - store evidence pointers, not narrative only
- when a completed long-running action produces results that affect later decisions, record the result summary before leaving watch mode
Error-Resolution Memory
For significant errors, capture:
error_signature- reproduction condition
- attempted fixes
- observed outcomes
- final fix (if any)
- unresolved hypotheses
- retrieved procedures/episodes that influenced the fix
Working Freshness Rules
Treat stale continuity state as risk:
- refresh after plan changes, tool-call batches, or diagnosis updates
- refresh after long-action polls that change status
- review at least every 15 minutes in active execution
- force review before high-resource actions
- force review after interruptions or unexpected failures
Invocation Schedule (Experience-First, Frequent but Targeted)
- Mandatory once-per-run operations:
- bootstrap
retrieve/init-workingafter intake and before planning/execution - close-out writeback before final task completion
- bootstrap
- Mandatory per-turn operations:
- retrieve relevant experience on every new user turn
- Mandatory per-batch operations:
- retrieve
procedurebefore every execution batch - write
workingdelta after every execution batch
- retrieve
- Mandatory trigger-based operations:
- retrieve
episodeon problem, failure, repeated attempt, or new error signature - retrieve
insighton planning/replanning/tradeoff/final answer - retrieve
procedureplusepisodebefore high-resource actions - reread
workingduring resume, compaction recovery, long-action reconciliation, and final handoff - retrieve
procedureplusepisodeimmediately after stalled or failed poll outcomes - retrieve
insightafter completed poll outcomes when interpretation or next-step selection is needed
- retrieve
- Cooldown:
- skip only duplicate retrievals when objective, stage, and error signature are unchanged and the same hit set is still fresh
- cooldown does not suppress a new-trigger retrieval
- When skipped, log
memory_skip_reasonfor auditability.
Post-Compression Recovery (Required)
When memory is auto-compressed/summarized:
- immediately run a
workingreread before the next execution step - rebuild
workingfields from recent evidence:- latest stage report
- latest action/observation logs
- latest todo diff (
todo_active/todo_done/todo_blocked) - active long-action records
- publish a compact post-compression state snapshot and continue only after snapshot is consistent
Layered Retrieval Timing
Use layer-specific timing to keep retrieval frequent but useful:
procedureretrieve:- before every execution batch
- before high-resource or irreversible actions
- after stalled or failed background jobs
episoderetrieve:- at run start for same project/task_type
- at replan or major failure
- when repeated failure indicates recent local history may help
insightretrieve:- during planning/replanning for hypothesis shaping
- when evidence conflicts or root cause is unclear
- before final report/answer to run boundary checks
workingretrieve:- bootstrap
- resume/reconcile
- after memory compression
- before final handoff
personaretrieve:- once at run start
- on interaction mode switch or explicit user preference change
- before final user-facing delivery
Recovery on Context Drift
If execution becomes repetitive or confused:
- rebuild working state from action and observation logs
- run targeted retrieval by project/task/error signature
- if drift followed compaction or summary-style recovery, read prior Memory before publishing or trusting a compact state summary
- publish compact state summary before continuing
Compaction Recovery Policy
When context may have been compressed:
- inspect available status/state/context files for markers such as
Compact,压缩,Summary, or equivalent summary/compression techniques - if any marker is present, call
memory-managerto read prior Memory before editing instructions, planning next actions, or resuming execution - if prior Memory cannot be read, treat that as an active blocker because key context may be missing
- record the compaction trigger and retrieval result in working state or the next stage report
Promotion Policy
Promote only with evidence:
procedure draft -> activeafter successful reuse and stable boundariesinsight draft -> activeafter multi-episode support- require human review for safety-critical or expensive procedures
- deprecate entries when contradictions accumulate
Shared Export Policy
Treat shared export as post-task work:
- do not export during main task execution
- export only verified/high-value records
- never export noisy
workingstate - require
human-checkpointbefore publishing - sync the shared repo before export so dedupe/conflict checks run against the latest branch tip
Shared Repository Contract
When exporting:
- target
https://github.com/TenureAI/open-research-memory - use pull-based flow: local export ->
codex/*branch -> PR -> review -> merge - never push directly to
main - enforce schema and required sections
Shared Retrieval Helper
Use the helper script for lightweight read-only search of a local shared repo checkout:
python3 .agents/skills/memory-manager/scripts/shared_memory_retrieval.py \
--repo-root /path/to/open-research-memory \
--query "cuda out of memory" \
--type procedure \
--task-type debug \
--limit 5Required Operation Output
For each memory operation, emit:
RunAction(retrieve|write|promote|deprecate|export)TargetLayersRationaleQueryHitsWorking Updatememory_skip_reasonwhen applicable
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
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.

