Install
$ agentstack add skill-tenureai-phd-zero-memory-manager ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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
- 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
- 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
- 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 5
Required Operation Output
For each memory operation, emit:
RunAction(retrieve|write|promote|deprecate|export)TargetLayersRationaleQueryHitsWorking Updatememory_skip_reasonwhen applicable
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: TenureAI
- Source: TenureAI/PhD-Zero
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.