agent-memory
Skill1 starsChanged 8 months agoMITView on GitHub
联想记忆系统:为 Claude Code subagent 提供基于 BM25 + 三维评分的记忆检索、存储、反馈学习能力
38 other projects use a version of this.
Adopted by
Most recently taken up by
- isaacbitran/agent-memorytheir own version, first seen Nov 8, 2026
- msking18/agent-memory-mcptheir own version, first seen Nov 8, 2026
- komluk/scaffoldingtheir own version, first seen Nov 7, 2026
- MemTether/MemTethertheir own version, first seen Nov 1, 2026
- tigerless-labs/agent-memorytheir own version, first seen Oct 22, 2026
- brianschroeder/simple-agent-memorytheir own version, first seen Oct 21, 2026
Used with
Projects with it also use observability, data-analysis and 10 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.
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 4 projects that use this
shanggqmSkilldata-analysis
数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。
Also in 3 projects that use this
Microsoft AzureSkillskill-authoring
Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.
Also in 3 projects that use this
VercelSkilltechnical-writing
Write, edit, review, or audit user-facing documentation for the eve repository. Use for changes under docs/, documentation tied to eve APIs or CLI behavior, docs work based on Slack or support feedback, and requests to make eve docs clearer, more natural, or less AI-patterned while verifying claims against current source, tests, CLI help, public releases, and repository conventions.
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
AnthropicSkillpdf
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Also in 5 projects that use this
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 38
- tigerless-labs/agent-memory★ 4.3ksame name
- databricks/app-templates★ 218same name
- OpenHands/extensions★ 167same name
- JKHeadley/instar★ 86same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- VoDaiLocz/kilo-kit-mcp★ 28same name
- jayzeng/agentmemory★ 24same name
- komluk/scaffolding★ 16same name
- xChuCx/agent-memory★ 11same name
- t4sh/skills4sh★ 5same name
28 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.
- skills/agent-memory/CLAUDE.mdCLAUDE.md
- auto-iterateSkill
- collaborating-with-codexSkill
- collaborating-with-geminiSkill
- collaborating-with-kimiSkill
- explorationSkill
- reflex-auditSkill
- reflex-fuzzSkill
- skill-catalogSkill
- skill-snapshotSkill
The file
Files
Agent Memory System
为 Claude Code subagent 提供联想记忆能力。
核心能力
| 能力 | 模块 | 说明 |
| 存储 | memory_store.py | Markdown 文件存储,YAML frontmatter 元数据 |
| 检索 | retriever.py | BM25 + 扩散激活 + 三维评分(相关性/重要性/新近性) |
| 关联 | associator.py | 共现分析 + 语义相似度 |
| 提取 | extractor.py | 从任务描述自动提取结构化记忆 |
| 注入 | inject.py | 向 agent prompt 注入相关记忆上下文 |
| 演化 | evolver.py | LLM 驱动的记忆邻居演化 |
| 去重 | consolidator.py | Jaccard 相似度合并(阈值 0.85) |
| 衰减 | decay_engine.py | Ebbinghaus 遗忘曲线 R=e^(-t/S) |
| 学习 | feedback_loop.py | 自动推断 + 渐进式升级(降权→告警→阻断,health 过滤) |
| 触发 | trigger_tracker.py | 触发效率追踪:record/efficiency/adjust/stats/reset |
| 导出 | obsidian_export.py | Obsidian 笔记/MOC/Mermaid 图 |
| 注册 | registry.py | Agent 角色注册表 |
存储格式
每条记忆为一个 .md 文件,YAML frontmatter 包含元数据:
---
id: task_example
name: 任务描述
description: 一句话摘要
type: task
owner: tetsu
scope: private
importance: 8
access_count: 3
positive_feedback: 5
negative_feedback: 1
keywords: [TDD, Python]
tags: [implementation]
timestamp: 2026-03-14T22:00:00
---
记忆正文内容...CLI 用法
# 基础路径
SCRIPT=~/.claude/skills/agent-memory/scripts/cli.py
# 快速添加记忆
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu \
quick-add --name "任务名" --description "描述" --type task --context "执行上下文" "正文内容"
# 检索记忆
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu \
retrieve --query "搜索关键词" --top-k 5
# 快速添加(明确字段)
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu \
add --subject "任务主题" --description "详细描述" --keywords "kw1,kw2" --importance 7
# 反馈(手动正向)
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu \
feedback --memory-id "mem_id" --useful
# 反馈(手动负向)
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu \
feedback --memory-id "mem_id" --not-useful
# 反馈(自动推断)
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu \
feedback --memory-id "mem_id" --auto --event task_success
# 记忆去重合并
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu \
consolidate --threshold 0.85 --dry-run
# 列出记忆
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu list --limit 10
# 统计
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu stats
# 生成索引(增量,默认)
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu generate-index
# 生成索引(强制全量重建)
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu generate-index --force
# 修复损坏记忆文件(--fix 自动修复, --delete 删除无法修复项, --yes 跳过确认)
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu repair --fix --delete --yes
# 一站式健康概览(blocked/warning/healthy 分布 + 衰减统计,--trigger-stats 附加触发效率)
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu dashboard --trigger-stats路径约束
| Agent | 正确路径 |
| tetsu | ~/.claude/memory/agents/Worker/tetsu |
| shin | ~/.claude/memory/agents/Auditor/shin |
| fumio | ~/.claude/memory/agents/Weaver/fumio |
| root | ~/.claude/memory/agents/root |
--store 参数优先于 --agent 推断的路径。
测试
cd ~/.claude/skills/agent-memory
python3 -m pytest # 491 tests, ~5s架构演进
| Phase | 内容 | 状态 |
| Phase 1 | Active Recall + Retrieval Feedback | 已完成 |
| Phase 2 | Memory Consolidation + Decay | 已完成 |
| Phase 3 | Feedback Learning Loop | 已完成 |
| Phase A | feedback_loop.py 审计修复(M1-M4) | 已完成 |
| Phase B | retriever + cli feedback 集成 | 已完成 |
| Phase C | trigger_tracker.py 智能触发追踪 | 已完成 |
| Phase D | 端到端测试(5 场景,12 tests) | 已完成 |
| Phase E | 全量审计 + 文档同步 | 已完成 |
| Round 2 | 深度集成(decay+feedback 联动、consolidator+health 联动、CLI dashboard) | 已完成 |
| Round 3 | 自动化集成(feedback hook、trigger-map 注释、CLI 专项测试 +60、evolver+feedback 联动) | 已完成 |
| Round 4 | 智能自动化(auto-consolidate hook、scheduled decay hook、cross-agent retriever、performance benchmarks) | 已完成 |
| Round 5 | 健壮性强化(conftest fixtures、incremental index、corrupted recovery、full workflow tests) | 已完成 |
也可在 CLI 中添加 health-check 和 trigger 子命令:
# 健康检查(--show-all 显示全部记忆,含 healthy 状态)
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu health-check --show-all
# 触发追踪
python3 $SCRIPT --agent tetsu --store ~/.claude/memory/agents/Worker/tetsu trigger stats
# 记忆演化
python3 $SCRIPT --store ~/.claude/memory/agents/Worker/tetsu \
evolve mem_xxxxx --context "新语境" --tags "tag1,tag2"
# 跨 agent 联合检索(Round 4 新增)
python3 $SCRIPT retrieve --cross-agent --query "搜索关键词" --top-k 5
python3 $SCRIPT retrieve --stores "~/.claude/memory/agents/Worker/tetsu,~/.claude/memory/agents/Auditor/shin" --query "搜索关键词"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.

