Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/mr-chen-05/rules-2.1-optimized/memory-system-integrationgit clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimizedWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.04276 |
| Opus 5 | $0.00000 | $0.02138 |
| Sonnet 5 | $0.00000 | $0.00855 |
| Haiku 4.5 | $0.00000 | $0.00428 |
Grade A, and why
memory-system-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 547 lines — stays where its author put it; the contents beside it link to each section on GitHub.
💾 记忆系统集成
智能记忆: 项目全生命周期记忆管理,支持智能检索和上下文感知
🎯 系统概述
记忆系统是可选的协作组件,主要用于语义模糊检索与跨项目/跨时间的关联聚合。默认情况下,日常的历史记录与精准查询由记录员系统(Recorder)承担;当需要模糊语义检索或跨范围聚合时,再按需联动记忆系统以增强上下文检索能力。
记忆系统集成配置
记忆系统作为可选协作组件,主要用于语义模糊检索与跨项目/跨时间关联聚合。
核心原则: Recorder优先,Memory可选
优先级策略明确化:
- 主要职责分工:
- Recorder: 精确记录、结构化存储、项目上下文管理
- Memory: 语义检索、跨项目关联、长期知识积累
- 决策优先级:
- 项目内精确查询 → 优先使用Recorder
- 跨项目语义检索 → 优先使用Memory
- 实时记录和更新 → 强制使用Recorder
- 历史模式分析 → 优先使用Memory
- 冲突解决机制:
- 数据一致性冲突时,以Recorder为准
- 功能重叠时,优先调用Recorder
- Memory故障时,系统完全依赖Recorder运行
🏗️ 记忆架构
记忆层次结构
记忆层次:
L1_会话记忆:
范围: 当前对话会话
生命周期: 会话结束时清除
内容: 临时交互、即时决策
L2_项目记忆:
范围: 单个项目全生命周期
生命周期: 项目完成后归档
内容: 项目状态、阶段信息、技术决策
L3_全局记忆:
范围: 跨项目经验和知识
生命周期: 永久保存
内容: 最佳实践、模式库、用户偏好
L4_学习记忆:
范围: AI系统自我优化
生命周期: 持续更新
内容: 算法参数、性能指标、优化策略
MCP Memory工具集成
MCP记忆工具使用:
实体创建:
触发条件:
- 新项目启动
- 重要技术决策
- 关键里程碑达成
- 问题解决方案
实体类型:
- Project: 项目基本信息
- Phase: 项目阶段状态
- Decision: 技术决策记录
- Solution: 解决方案记录
- User: 用户偏好和习惯
关系建立:
关系类型:
- belongs_to: 归属关系
- depends_on: 依赖关系
- leads_to: 导致关系
- similar_to: 相似关系
- conflicts_with: 冲突关系
观察记录:
记录机制(按需可配置):
- 结构化记录优先采用 Recorder(默认):Facts/Decisions/TODO/Notes 分类
- 需要语义检索或聚合时:将关键片段同步到 Memory(可选)
- 可配置的记录触发:按需启用、可关闭、不影响系统正常使用
📝 记录机制(按需)
触发条件详细定义
建议记录触发(可按需启用):
项目生命周期事件:
- 项目创建: 记录项目基本信息和初始需求
- 阶段切换: 保存当前阶段成果和下阶段计划
- 项目完成: 归档项目总结和经验教训
- 项目暂停/恢复: 记录状态变更原因
技术决策事件:
- 技术栈选择: 记录选择理由和替代方案
- 架构设计: 保存设计方案和权衡考虑
- 工具选择: 记录工具评估和使用效果
- 性能优化: 保存优化策略和效果评估
问题解决事件:
- Bug发现和修复: 记录问题描述和解决方案
- 性能瓶颈: 保存分析过程和优化结果
- 集成问题: 记录集成挑战和解决策略
- 部署问题: 保存部署经验和最佳实践
用户交互事件:
- 重要确认: 记录用户确认的关键决策
- 偏好表达: 保存用户技术偏好和习惯
- 反馈意见: 记录用户满意度和改进建议
- 学习需求: 保存用户知识盲点和学习计划
记录内容标准
记录格式:
基础信息:
- 时间戳: ISO 8601格式
- 项目ID: 唯一标识符
- 阶段标识: 当前项目阶段
- 用户ID: 用户唯一标识
内容结构:
- 事件类型: 分类标签
- 事件描述: 详细说明
- 上下文信息: 相关背景
- 结果评估: 效果和影响
- 关联实体: 相关项目、决策等
元数据:
- 重要性级别: 1-5级评分
- 可信度: 信息准确性评估
- 更新频率: 信息变更频率
- 访问权限: 信息共享范围
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 547 lines · 0 tokens per session scan A 76c2406c6e99
memory-system-integration is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,276 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.