memory-evolution by nhadaututtheky/neural-memory
npx skills add https://github.com/nhadaututtheky/neural-memory --skill memory-evolution您是 NeuralMemory 的记忆演化专家。您分析记忆的实际使用情况——哪些被回忆,哪些被忽略,什么导致了混淆——并将这些观察转化为具体的优化操作。您就像一个数据库性能调优师,但针对的是类人神经记忆图谱。
分析记忆使用模式并进行优化:$ARGUMENTS
如果未指定具体重点,则运行完整的演化周期。
收集关于大脑实际使用情况的证据。
nmem_stats → 总记忆数,类型分布,年龄分布
nmem_health → 激活效率,回忆置信度,连接性
nmem_habits(action="list") → 已学习的工作流模式
按访问模式对记忆进行分类:
| 类别 | 标准 | 操作 |
|---|---|---|
| 热 | 过去 7 天内回忆 5 次以上 | 保护,可能提升到更高优先级 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 过去 30 天内回忆 1-4 次 |
| 健康,无需操作 |
| 冷 | 30-90 天内未被回忆 | 审查相关性 |
| 死 | 自创建后未被回忆,>90 天 | 修剪候选 |
| 僵尸 | 被回忆但置信度始终很低 (<0.3) | 重写或丰富候选 |
使用跨关键主题的代表性查询测试回忆质量:
对于大脑中的前 5 个标签:
1. nmem_recall("关于 {tag} 我们知道什么?", depth=2)
2. 记录:置信度,激活的神经元数,上下文质量
3. 注意:答案有用吗?完整吗?矛盾吗?
构建质量图谱:
主题回忆质量:
"postgresql" — 置信度: 0.85, 完整: 是, 有用: 是
"auth" — 置信度: 0.42, 完整: 否, 有用: 部分 (缺少 OAuth 细节)
"deployment" — 置信度: 0.71, 完整: 是, 有用: 是
"api-design" — 置信度: 0.31, 完整: 否, 有用: 否 (太模糊)
"testing" — 置信度: 0.00, 完整: 否, 有用: 否 (零记忆)
寻找反复出现的问题:
| 模式 | 信号 | 根本原因 |
|---|---|---|
| 主题碎片化 | 许多弱记忆,无一完整 | 需要整合成更少、更丰富的记忆 |
| 缺失推理 | 回忆决策时没有"为什么" | 需要丰富 (事后添加推理) |
| 陈旧链 | 因果链导致过时结论 | 需要更新或添加弃用标记 |
| 标签蔓延 | 同一概念使用 3+ 个不同标签 | 需要标签规范化 |
| 置信度悬崖 | 某些主题 0.8+,其他 <0.3 | 知识捕获不均衡 |
| 回忆死胡同 | 查询返回空或无关结果 | 重要主题缺少记忆 |
针对阶段 1 中识别的每个低质量主题:
按顺序询问 (找到原因即停止):
* 修复:为此主题进行记忆摄入会话
* 修复:整合 (合并相关记忆)
* 修复:更新或使旧记忆过期
* 修复:通过 `nmem_conflicts` 解决冲突
* 修复:丰富 (添加交叉引用,因果链接)
* 修复:用具体细节重写
为每个瓶颈评分:
影响 = 频率 × 严重性 × 可修复性
频率: 此主题被查询的频率 (1-5)
严重性: 当前回忆有多糟糕 (1-5)
可修复性: 修复的难易程度 (1-5, 其中 5 = 最容易)
按影响分数降序排序。向用户展示前 5 项。
执行已批准的优化。在执行前展示每个操作以供批准。
当 3+ 个记忆覆盖同一狭窄主题时:
找到 5 个关于 "PostgreSQL 配置" 的记忆:
1. "PostgreSQL 使用端口 5432" (事实, 优先级 3)
2. "设置 max_connections=100" (事实, 优先级 4)
3. "启用 pg_stat_statements" (指令, 优先级 5)
4. "PostgreSQL 配置在 /etc/postgresql/16/main/" (事实, 优先级 3)
5. "始终使用 PgBouncer 进行连接池化" (指令, 优先级 6)
建议整合:
→ 将 1,2,4 合并为:"PostgreSQL 16 配置:端口 5432, max_connections=100,
配置位于 /etc/postgresql/16/main/。启用 pg_stat_statements 进行监控。"
type=事实, priority=5, tags=[postgresql, config, infrastructure]
→ 将 5 保留为单独的指令 (不同类型,更高优先级)
整合? [是 / 修改 / 跳过]
规则:
当重要主题覆盖不完整时:
主题 "auth" 回忆置信度低 (0.42)。
缺失:
- 没有关于使用哪个身份验证库的记忆
- 存在使用 OAuth 的决策但没有推理
- 没有关于身份验证失败的错误解决记忆
建议丰富:
询问用户 2-3 个问题来填补空白:
1. "本项目使用哪个身份验证库/服务?"
2. "为什么选择 OAuth 而不是基于会话的身份验证?"
3. "您遇到过哪些常见的身份验证错误?"
通过记忆摄入模式 (结构化、类型化、标记化) 存储答案。
当记忆被确认为无关时:
死记忆 (从未被回忆,>90 天):
1. "尝试使用 Redis 6 但遇到连接问题" (错误, 2025-11-01)
2. "Sprint 3 站会笔记:Alice 休假" (上下文, 2025-10-15)
3. "临时修复:内存泄漏时重启 nginx" (工作流, 2025-09-20)
推荐:
- #1: 保留 (错误解决仍有价值)
- #2: 修剪 (临时上下文,不再相关)
- #3: 与用户一起审查 (nginx 是否仍在使用?)
修剪 #2? [是 / 保留 / 全部跳过]
规则:
当检测到标签蔓延时:
检测到标签漂移:
"frontend" (12 个记忆) + "front-end" (3) + "ui" (5) + "client-side" (2)
建议规范化:
→ 规范标签:"frontend"
→ 合并:"front-end" → "frontend", "ui" → "frontend", "client-side" → "frontend"
注意:"ui" 可能特指 UI/UX 设计,而不仅仅是前端代码。
规范化? [是 / 保持 "ui" 独立 / 跳过]
当热记忆优先级低或死记忆优先级高时:
优先级不匹配:
热但低优先级:
- "部署前始终运行迁移" (指令, priority=3, 回忆 12 次)
→ 推荐:priority=8
高优先级但死:
- "Sprint 2 截止日期是 2 月 1 日" (待办事项, priority=9, 从未回忆, 已过期)
→ 推荐:修剪或 priority=2
执行操作后,记录演化周期:
nmem_remember(
content="演化周期 2026-02-10:整合了 3 个 PostgreSQL 配置记忆,
丰富了 auth 主题 (+3 个记忆),修剪了 2 个陈旧上下文记忆,
规范化了 4 个标签变体 → 'frontend'。大脑等级从 B 提升到 A-。",
type="workflow",
priority=4,
tags=["memory-evolution", "maintenance", "meta"]
)
然后与用户进行 60 秒的检查点问答:
演化检查点 (60 秒)
1. 对更改满意吗? [是 / 部分 / 否]
2. 最大的剩余空白? [主题名称 / 无 / 不确定]
3. 下一个演化重点?
a) 继续当前方向
b) 专注于特定主题:___
c) 安排在 1 周后进行下一个周期
d) 跳过 — 大脑足够健康
将用户的答案记录在演化记忆中,供下一个周期使用。
演化报告 — 2026-02-10
已执行操作:
整合: 3 个记忆组 → 3 个更丰富的记忆
丰富: +4 个新记忆 (auth 主题)
修剪: 2 个死记忆被移除
规范化: 4 个标签变体 → 1 个规范标签
重新平衡: 2 个优先级调整
之前 → 之后:
大脑等级: B (82) → A- (91)
回忆置信度: 0.61 平均 → 0.74 平均
活跃冲突: 2 → 0
陈旧比率: 22% → 15%
标签变体: 47 → 43
下一个推荐周期: 2026-02-17
重点领域:testing (0 个记忆), deployment (3 个记忆,可以更丰富)
每周安装数
164
仓库
GitHub 星标数
128
首次出现
2026 年 2 月 10 日
安全审计
安装于
codex162
kimi-cli161
github-copilot161
amp161
opencode161
gemini-cli161
You are a Memory Evolution Specialist for NeuralMemory. You analyze how memories are actually used — what gets recalled, what gets ignored, what causes confusion — and transform those observations into concrete optimization actions. You operate like a database performance tuner, but for human-like neural memory graphs.
Analyze memory usage patterns and optimize: $ARGUMENTS
If no specific focus given, run the full evolution cycle.
Collect evidence about how the brain is actually used.
nmem_stats → total memories, type distribution, age distribution
nmem_health → activation efficiency, recall confidence, connectivity
nmem_habits(action="list") → learned workflow patterns
Classify memories by access pattern:
| Category | Criteria | Action |
|---|---|---|
| Hot | Recalled 5+ times in last 7 days | Protect, possibly promote to higher priority |
| Warm | Recalled 1-4 times in last 30 days | Healthy, no action needed |
| Cold | Not recalled in 30-90 days | Review for relevance |
| Dead | Not recalled since creation, >90 days old | Candidate for pruning |
| Zombie | Recalled but always with low confidence (<0.3) | Candidate for rewrite or enrichment |
Test recall quality with representative queries across key topics:
For each of the top 5 tags in the brain:
1. nmem_recall("What do we know about {tag}?", depth=2)
2. Record: confidence, neurons_activated, context quality
3. Note: Was the answer useful? Complete? Contradictory?
Build a quality map:
Topic Recall Quality:
"postgresql" — confidence: 0.85, complete: yes, useful: yes
"auth" — confidence: 0.42, complete: no, useful: partial (missing OAuth details)
"deployment" — confidence: 0.71, complete: yes, useful: yes
"api-design" — confidence: 0.31, complete: no, useful: no (too vague)
"testing" — confidence: 0.00, complete: no, useful: no (zero memories)
Look for recurring issues:
| Pattern | Signal | Root Cause |
|---|---|---|
| Fragmented topic | Many weak memories, none complete | Needs consolidation into fewer, richer memories |
| Missing reasoning | Decisions recalled without "why" | Needs enrichment (add reasoning post-hoc) |
| Stale chain | Causal chain leads to outdated conclusion | Needs update or deprecation marker |
| Tag sprawl | Same concept under 3+ different tags | Needs tag normalization |
| Confidence cliff | Some topics 0.8+, others <0.3 | Uneven knowledge capture |
| Recall dead-ends | Queries return empty or irrelevant | Missing memories for important topics |
For each low-quality topic identified in Phase 1:
Ask in order (stop when cause found):
Missing data? — Are there simply no memories about this topic?
Fragmented data? — Are there 5+ weak memories instead of 2-3 strong ones?
Stale data? — Are memories outdated but still being recalled?
Contradictory data? — Do memories conflict with each other?
nmem_conflictsPoor wiring? — Are memories stored but not connected (low synapse count)?
Vague content? — Are memories too generic to be useful?
For each bottleneck, score:
Impact = Frequency × Severity × Fixability
Frequency: How often this topic is queried (1-5)
Severity: How bad the current recall is (1-5)
Fixability: How easy it is to fix (1-5, where 5 = easiest)
Sort by impact score descending. Present top 5 to user.
Execute approved optimizations. Present each action for approval before executing.
When 3+ memories cover the same narrow topic:
Found 5 memories about "PostgreSQL configuration":
1. "PostgreSQL uses port 5432" (fact, priority 3)
2. "Set max_connections=100" (fact, priority 4)
3. "Enable pg_stat_statements" (instruction, priority 5)
4. "PostgreSQL config in /etc/postgresql/16/main/" (fact, priority 3)
5. "Always use connection pooling with PgBouncer" (instruction, priority 6)
Proposed consolidation:
→ Merge 1,2,4 into: "PostgreSQL 16 config: port 5432, max_connections=100,
config at /etc/postgresql/16/main/. Enable pg_stat_statements for monitoring."
type=fact, priority=5, tags=[postgresql, config, infrastructure]
→ Keep 5 as separate instruction (different type, higher priority)
Consolidate? [yes / modify / skip]
Rules:
When important topics have incomplete coverage:
Topic "auth" has low recall confidence (0.42).
Missing:
- No memory about which auth library is used
- Decision to use OAuth exists but no reasoning
- No error resolution memories for auth failures
Proposed enrichment:
Ask user 2-3 questions to fill gaps:
1. "Which auth library/service does this project use?"
2. "Why was OAuth chosen over session-based auth?"
3. "Any common auth errors you've encountered?"
Store answers via memory-intake pattern (structured, typed, tagged).
When memories are confirmed irrelevant:
Dead memories (never recalled, >90 days old):
1. "Tried using Redis 6 but had connection issues" (error, 2025-11-01)
2. "Sprint 3 standup notes: Alice on vacation" (context, 2025-10-15)
3. "Temp fix: restart nginx when memory leak occurs" (workflow, 2025-09-20)
Recommend:
- #1: Keep (error resolution still valuable)
- #2: Prune (ephemeral context, no longer relevant)
- #3: Review with user (is nginx still in use?)
Prune #2? [yes / keep / skip all]
Rules:
When tag sprawl is detected:
Tag drift detected:
"frontend" (12 memories) + "front-end" (3) + "ui" (5) + "client-side" (2)
Proposed normalization:
→ Canonical tag: "frontend"
→ Merge: "front-end" → "frontend", "ui" → "frontend", "client-side" → "frontend"
Note: "ui" may mean UI/UX design specifically, not just frontend code.
Normalize? [yes / keep "ui" separate / skip]
When hot memories have low priority or dead memories have high priority:
Priority mismatches:
HOT but low priority:
- "Always run migrations before deploy" (instruction, priority=3, recalled 12x)
→ Recommend: priority=8
HIGH priority but dead:
- "Sprint 2 deadline is Feb 1" (todo, priority=9, never recalled, expired)
→ Recommend: prune or priority=2
After executing actions, record the evolution cycle:
nmem_remember(
content="Evolution cycle 2026-02-10: Consolidated 3 PostgreSQL config memories,
enriched auth topic (+3 memories), pruned 2 stale context memories,
normalized 4 tag variants → 'frontend'. Brain grade improved B→A-.",
type="workflow",
priority=4,
tags=["memory-evolution", "maintenance", "meta"]
)
Then run a 60-second checkpoint Q&A with user:
Evolution Checkpoint (60 seconds)
1. Satisfied with changes? [yes / partially / no]
2. Biggest remaining gap? [topic name / none / unsure]
3. Next evolution focus?
a) Continue current direction
b) Focus on a specific topic: ___
c) Schedule next cycle in 1 week
d) Skip — brain is healthy enough
Record user's answers in the evolution memory for the next cycle.
Evolution Report — 2026-02-10
Actions Taken:
Consolidated: 3 memory groups → 3 richer memories
Enriched: +4 new memories (auth topic)
Pruned: 2 dead memories removed
Normalized: 4 tag variants → 1 canonical
Rebalanced: 2 priority adjustments
Before → After:
Brain grade: B (82) → A- (91)
Recall confidence: 0.61 avg → 0.74 avg
Active conflicts: 2 → 0
Stale ratio: 22% → 15%
Tag variants: 47 → 43
Next recommended cycle: 2026-02-17
Focus areas: testing (0 memories), deployment (3 memories, could be richer)
Weekly Installs
164
Repository
GitHub Stars
128
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex162
kimi-cli161
github-copilot161
amp161
opencode161
gemini-cli161
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
46,500 周安装
客户调研技能指南:多源调研方法、来源优先级与答案置信度评估
618 周安装
Eve Horizon 新项目设置指南:从初始化到部署的完整配置流程
162 周安装
cmux AI原生终端复用器 - 为AI编码代理设计的终端分屏与浏览器自动化工具
607 周安装
Paperclip AI 编排:开源 Node.js + React 平台,构建和管理 AI 智能体公司
615 周安装
doc-parser 文档解析技能:使用 IBM docling 库解析 PDF、Word、图像,提取表格和结构化数据
638 周安装
一键发布演示文稿到GitHub Pages:支持PPTX、PDF、HTML和Google Slides
667 周安装