openmemory-plus 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +524 -163
- package/package.json +1 -1
- package/templates/shared/_omp/commands/memory.md +6 -0
- package/templates/shared/{skills → _omp/skills}/memory-extraction/SKILL.md +92 -51
- package/templates/shared/_omp/skills/memory-extraction/scripts/validate.sh +94 -0
- package/templates/shared/_omp/skills/memory-extraction/templates/decision.yaml.tmpl +32 -0
- package/templates/shared/_omp/skills/memory-extraction/templates/session.yaml.tmpl +35 -0
- package/templates/shared/_omp/workflows/memory/steps/clean.md +92 -0
- package/templates/shared/_omp/workflows/memory/steps/decay.md +82 -0
- package/templates/shared/_omp/workflows/memory/steps/graph.md +88 -0
- package/templates/shared/_omp/workflows/memory/steps/search.md +68 -0
- package/templates/shared/_omp/workflows/memory/steps/status.md +63 -0
- package/templates/shared/_omp/workflows/memory/steps/store.md +81 -0
- package/templates/shared/_omp/workflows/memory/steps/sync.md +76 -0
- package/templates/shared/_omp/workflows/memory/workflow.md +147 -0
- package/templates/augment/AGENTS.md +0 -78
- package/templates/claude/CLAUDE.md +0 -52
- package/templates/common/AGENTS.md +0 -51
- package/templates/cursor/.cursorrules +0 -57
- package/templates/gemini/gemini.md +0 -77
- package/templates/shared/commands/memory.md +0 -86
- package/templates/shared/memory/activeContext.md +0 -34
- package/templates/shared/memory/productContext.md +0 -30
- package/templates/shared/memory/progress.md +0 -41
- package/templates/shared/memory/projectbrief.md +0 -36
- package/templates/shared/memory/systemPatterns.md +0 -39
- package/templates/shared/memory/techContext.md +0 -51
- package/templates/shared/memory-actions/clean.md +0 -54
- package/templates/shared/memory-actions/decay.md +0 -64
- package/templates/shared/memory-actions/graph.md +0 -75
- package/templates/shared/memory-actions/search.md +0 -38
- package/templates/shared/memory-actions/status.md +0 -35
- package/templates/shared/memory-actions/store.md +0 -45
- package/templates/shared/memory-actions/sync.md +0 -50
- package/templates/shared/rules/classification.md +0 -108
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graph
|
|
3
|
+
description: 查看记忆中的实体关系图谱
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step: 知识图谱
|
|
7
|
+
|
|
8
|
+
## EXECUTION RULES
|
|
9
|
+
|
|
10
|
+
- ✅ Extract entities from memories
|
|
11
|
+
- ✅ Identify relationships
|
|
12
|
+
- ✅ Visualize in ASCII or Mermaid
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## EXECUTION
|
|
17
|
+
|
|
18
|
+
### 1. Read Graph Data
|
|
19
|
+
|
|
20
|
+
Check for existing `_omp/.memory/graph.yaml`:
|
|
21
|
+
- If exists, load entities and relations
|
|
22
|
+
- If not, initialize empty graph
|
|
23
|
+
|
|
24
|
+
### 2. Extract Entities
|
|
25
|
+
|
|
26
|
+
From project and user memories, extract:
|
|
27
|
+
|
|
28
|
+
| Entity Type | Examples |
|
|
29
|
+
|-------------|----------|
|
|
30
|
+
| project | Project name |
|
|
31
|
+
| technology | TypeScript, React, Python |
|
|
32
|
+
| service | API, CLI, Web |
|
|
33
|
+
| database | Qdrant, PostgreSQL |
|
|
34
|
+
| config | tsconfig.json, package.json |
|
|
35
|
+
| preference | User preferences |
|
|
36
|
+
|
|
37
|
+
### 3. Identify Relations
|
|
38
|
+
|
|
39
|
+
| Relation | Meaning |
|
|
40
|
+
|----------|---------|
|
|
41
|
+
| uses | A uses B |
|
|
42
|
+
| depends_on | A depends on B |
|
|
43
|
+
| configured_by | A configured by B |
|
|
44
|
+
| prefers | User prefers A |
|
|
45
|
+
|
|
46
|
+
### 4. Display Graph
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
🔗 知识图谱
|
|
50
|
+
|
|
51
|
+
项目: {project_name}
|
|
52
|
+
|
|
53
|
+
实体关系:
|
|
54
|
+
┌─────────────────────────────────────────┐
|
|
55
|
+
│ │
|
|
56
|
+
│ [{entity}] ──{relation}──> [{entity}] │
|
|
57
|
+
│ │ │
|
|
58
|
+
│ └──{relation}──> [{entity}] │
|
|
59
|
+
│ │
|
|
60
|
+
│ [User] ──prefers──> [{preference}] │
|
|
61
|
+
│ │
|
|
62
|
+
└─────────────────────────────────────────┘
|
|
63
|
+
|
|
64
|
+
统计: {n} 个实体, {n} 个关系
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 5. Follow-up Actions
|
|
68
|
+
|
|
69
|
+
- `"添加关系"` → Add new entity relation
|
|
70
|
+
- `"查看 {entity}"` → Show all relations for entity
|
|
71
|
+
- `"导出 mermaid"` → Export as Mermaid diagram
|
|
72
|
+
- `"导出 dot"` → Export as DOT format
|
|
73
|
+
|
|
74
|
+
### 6. Mermaid Export Format
|
|
75
|
+
|
|
76
|
+
```mermaid
|
|
77
|
+
graph LR
|
|
78
|
+
A[CLI] -->|uses| B[TypeScript]
|
|
79
|
+
A -->|depends_on| C[Commander.js]
|
|
80
|
+
D[User] -->|prefers| E[中文]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## RETURN TO MENU
|
|
86
|
+
|
|
87
|
+
完成后提示:
|
|
88
|
+
> "还需要其他操作吗?输入 **M** 返回菜单,或直接输入下一个操作"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: 在项目级和用户级记忆中进行语义搜索
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step: 搜索记忆
|
|
7
|
+
|
|
8
|
+
## EXECUTION RULES
|
|
9
|
+
|
|
10
|
+
- ✅ Get search query from user if not provided
|
|
11
|
+
- ✅ Search both project and user memory
|
|
12
|
+
- ✅ Display results with relevance scores
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## EXECUTION
|
|
17
|
+
|
|
18
|
+
### 1. Get Search Query
|
|
19
|
+
|
|
20
|
+
If user provided query in their command, use it directly.
|
|
21
|
+
Otherwise ask:
|
|
22
|
+
> "请输入搜索关键词:"
|
|
23
|
+
|
|
24
|
+
### 2. Search User Memory
|
|
25
|
+
|
|
26
|
+
Call `search_memory_openmemory` with the query:
|
|
27
|
+
- Get matching memories with scores
|
|
28
|
+
- Sort by relevance
|
|
29
|
+
|
|
30
|
+
### 3. Search Project Memory
|
|
31
|
+
|
|
32
|
+
Search `_omp/.memory/*.md` and `_omp/.memory/*.yaml` files:
|
|
33
|
+
- Grep for query keywords
|
|
34
|
+
- Match file content
|
|
35
|
+
|
|
36
|
+
### 4. Display Results
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
🔍 搜索结果: "{query}"
|
|
40
|
+
|
|
41
|
+
📁 项目级结果:
|
|
42
|
+
{foreach result}
|
|
43
|
+
{n}. [{filename}] {matched_content}
|
|
44
|
+
匹配位置: 行 {line_number}
|
|
45
|
+
{/foreach}
|
|
46
|
+
|
|
47
|
+
👤 用户级结果:
|
|
48
|
+
{foreach result}
|
|
49
|
+
{n}. {memory_content}
|
|
50
|
+
相关度: {score} | 创建: {time_ago} | 状态: {decay_status}
|
|
51
|
+
{/foreach}
|
|
52
|
+
|
|
53
|
+
共找到 {total} 条相关记忆
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 5. Follow-up Actions
|
|
57
|
+
|
|
58
|
+
用户可继续操作:
|
|
59
|
+
- `"删除 N"` → 删除指定记忆
|
|
60
|
+
- `"详情 N"` → 展示完整内容
|
|
61
|
+
- `"更新 N"` → 修改记忆内容
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## RETURN TO MENU
|
|
66
|
+
|
|
67
|
+
完成后提示:
|
|
68
|
+
> "还需要其他操作吗?输入 **M** 返回菜单,或直接输入下一个操作"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: status
|
|
3
|
+
description: 查看项目级和用户级记忆的详细状态
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step: 查看记忆状态
|
|
7
|
+
|
|
8
|
+
## EXECUTION RULES
|
|
9
|
+
|
|
10
|
+
- ✅ Execute all steps in order
|
|
11
|
+
- ✅ Display results clearly
|
|
12
|
+
- ✅ End with menu prompt
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## EXECUTION
|
|
17
|
+
|
|
18
|
+
### 1. Read Project-Level Memory
|
|
19
|
+
|
|
20
|
+
Read `_omp/.memory/` directory:
|
|
21
|
+
- List all files with last modified time
|
|
22
|
+
- Count total files
|
|
23
|
+
|
|
24
|
+
### 2. Get User-Level Memory
|
|
25
|
+
|
|
26
|
+
Call `list_memories_openmemory`:
|
|
27
|
+
- Get all user memories
|
|
28
|
+
- Count by decay status (Active/Aging/Stale/Cleanup)
|
|
29
|
+
|
|
30
|
+
### 3. Display Status
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
📊 记忆系统详细状态
|
|
34
|
+
|
|
35
|
+
📁 项目级 (_omp/.memory/)
|
|
36
|
+
├── project.yaml ({last_modified})
|
|
37
|
+
├── decisions.yaml ({last_modified})
|
|
38
|
+
└── ... 共 {n} 个文件
|
|
39
|
+
|
|
40
|
+
👤 用户级 (openmemory)
|
|
41
|
+
├── 总记忆数: {total} 条
|
|
42
|
+
├── 最近添加: "{latest_memory}" ({time_ago})
|
|
43
|
+
└── 衰减状态:
|
|
44
|
+
├── 🟢 Active: {n} 条
|
|
45
|
+
├── 🟡 Aging: {n} 条
|
|
46
|
+
├── 🔴 Stale: {n} 条
|
|
47
|
+
└── ⚫ Cleanup: {n} 条
|
|
48
|
+
|
|
49
|
+
{status_message}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 4. Status Message Logic
|
|
53
|
+
|
|
54
|
+
- If Cleanup > 0: `"⚠️ 有 {n} 条待清理记忆,建议执行清理"`
|
|
55
|
+
- If Stale > 3: `"💡 有较多陈旧记忆,建议检查是否仍需要"`
|
|
56
|
+
- Else: `"✅ 系统状态正常"`
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## RETURN TO MENU
|
|
61
|
+
|
|
62
|
+
完成后提示:
|
|
63
|
+
> "还需要其他操作吗?输入 **M** 返回菜单,或直接输入下一个操作"
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: store
|
|
3
|
+
description: 手动添加新的记忆到系统中
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step: 存储记忆
|
|
7
|
+
|
|
8
|
+
## EXECUTION RULES
|
|
9
|
+
|
|
10
|
+
- ✅ Get content from user if not provided
|
|
11
|
+
- ✅ Classify and route to correct storage
|
|
12
|
+
- ✅ Confirm before storing
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## EXECUTION
|
|
17
|
+
|
|
18
|
+
### 1. Get Content
|
|
19
|
+
|
|
20
|
+
If user provided content in their command, use it directly.
|
|
21
|
+
Otherwise ask:
|
|
22
|
+
> "请输入要存储的信息:"
|
|
23
|
+
|
|
24
|
+
### 2. Classify Information
|
|
25
|
+
|
|
26
|
+
Analyze content and determine storage location:
|
|
27
|
+
|
|
28
|
+
| Keywords | Storage | Action |
|
|
29
|
+
|----------|---------|--------|
|
|
30
|
+
| 项目路径, URL, 配置, deploy, domain | `_omp/.memory/` | Write to YAML |
|
|
31
|
+
| 选择, 决定, 使用, 采用 (技术决策) | `_omp/.memory/decisions.yaml` | Append decision |
|
|
32
|
+
| 喜欢, 偏好, 习惯 (用户偏好) | openmemory | `add_memories_openmemory` |
|
|
33
|
+
| 熟悉, 擅长, 会用 (用户技能) | openmemory | `add_memories_openmemory` |
|
|
34
|
+
| Other | Ask user | - |
|
|
35
|
+
|
|
36
|
+
### 3. Confirm Storage
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
📝 即将存储:
|
|
40
|
+
|
|
41
|
+
内容: "{content}"
|
|
42
|
+
类型: {type}
|
|
43
|
+
位置: {location}
|
|
44
|
+
|
|
45
|
+
确认存储?[Y/n]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 4. Execute Storage
|
|
49
|
+
|
|
50
|
+
**For project-level:**
|
|
51
|
+
- Read existing YAML file
|
|
52
|
+
- Append new entry with timestamp
|
|
53
|
+
- Write back
|
|
54
|
+
|
|
55
|
+
**For user-level:**
|
|
56
|
+
- Call `add_memories_openmemory` with content
|
|
57
|
+
|
|
58
|
+
### 5. Display Result
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
💾 记忆已存储
|
|
62
|
+
|
|
63
|
+
类型: {type}
|
|
64
|
+
内容: "{content}"
|
|
65
|
+
位置: {location}
|
|
66
|
+
时间: {timestamp}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 6. Batch Storage
|
|
70
|
+
|
|
71
|
+
If content contains multiple items (comma/semicolon separated):
|
|
72
|
+
- Split into individual items
|
|
73
|
+
- Classify each separately
|
|
74
|
+
- Store all with confirmation
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## RETURN TO MENU
|
|
79
|
+
|
|
80
|
+
完成后提示:
|
|
81
|
+
> "还需要存储其他信息吗?输入 **M** 返回菜单,或直接输入下一个操作"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sync
|
|
3
|
+
description: 检测项目级和用户级记忆之间的冲突
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step: 同步检查
|
|
7
|
+
|
|
8
|
+
## EXECUTION RULES
|
|
9
|
+
|
|
10
|
+
- ✅ Compare project and user memories
|
|
11
|
+
- ✅ Identify conflicts and duplicates
|
|
12
|
+
- ✅ Guide user through resolution
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## EXECUTION
|
|
17
|
+
|
|
18
|
+
### 1. Read Project Memory
|
|
19
|
+
|
|
20
|
+
Read all files in `_omp/.memory/`:
|
|
21
|
+
- Extract key-value pairs from YAML files
|
|
22
|
+
- Extract topics from markdown files
|
|
23
|
+
|
|
24
|
+
### 2. Search User Memory
|
|
25
|
+
|
|
26
|
+
Call `search_memory_openmemory` with project topics:
|
|
27
|
+
- Find related user memories
|
|
28
|
+
- Compare values
|
|
29
|
+
|
|
30
|
+
### 3. Detect Conflicts
|
|
31
|
+
|
|
32
|
+
| Conflict Type | Example | Detection |
|
|
33
|
+
|---------------|---------|-----------|
|
|
34
|
+
| 值不一致 | Project: "npm" vs User: "pnpm" | Same topic, different value |
|
|
35
|
+
| 重复记录 | Both have deploy URL | Same info in both |
|
|
36
|
+
| 过期信息 | Project updated, user not | Timestamp comparison |
|
|
37
|
+
|
|
38
|
+
### 4. Display Conflicts
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
🔄 同步检查结果
|
|
42
|
+
|
|
43
|
+
{if no_conflicts}
|
|
44
|
+
✅ 无冲突,项目级和用户级记忆同步正常
|
|
45
|
+
{else}
|
|
46
|
+
发现 {n} 个冲突:
|
|
47
|
+
|
|
48
|
+
{foreach conflict}
|
|
49
|
+
⚠️ 冲突 {n}: {description}
|
|
50
|
+
├── 📁 项目级: {project_value}
|
|
51
|
+
└── 👤 用户级: {user_value}
|
|
52
|
+
|
|
53
|
+
建议: {recommendation}
|
|
54
|
+
操作: [A] {option_a} [B] {option_b} [S] 跳过
|
|
55
|
+
{/foreach}
|
|
56
|
+
{/if}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 5. Resolution Options
|
|
60
|
+
|
|
61
|
+
- `"全部自动"` - Apply all recommendations
|
|
62
|
+
- `"逐个处理"` - Handle one by one
|
|
63
|
+
- `"A/B/S"` - Per-conflict decision
|
|
64
|
+
|
|
65
|
+
### 6. Execute Resolution
|
|
66
|
+
|
|
67
|
+
Based on user selection:
|
|
68
|
+
- Update or delete memories as needed
|
|
69
|
+
- Display summary of changes
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## RETURN TO MENU
|
|
74
|
+
|
|
75
|
+
完成后提示:
|
|
76
|
+
> "还需要其他操作吗?输入 **M** 返回菜单,或直接输入下一个操作"
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory
|
|
3
|
+
description: 记忆管理工作流 - 统一管理项目级和用户级记忆
|
|
4
|
+
version: "2.0"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory Management Workflow
|
|
8
|
+
|
|
9
|
+
**Goal:** 提供统一的记忆管理入口,支持查看、搜索、存储、清理、同步、衰减分析和知识图谱功能。
|
|
10
|
+
|
|
11
|
+
**Your Role:** 你是记忆管理专家,帮助用户高效管理项目级(`.memory/`)和用户级(openmemory)记忆。使用中文交流,技术术语保留英文。
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## WORKFLOW ARCHITECTURE
|
|
16
|
+
|
|
17
|
+
This uses **micro-file architecture** with **menu-driven routing**:
|
|
18
|
+
|
|
19
|
+
- Main workflow displays status and menu
|
|
20
|
+
- Each action is a self-contained step file
|
|
21
|
+
- User selects action via number or natural language
|
|
22
|
+
- After action completion, return to menu
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## INITIALIZATION
|
|
27
|
+
|
|
28
|
+
### Configuration
|
|
29
|
+
|
|
30
|
+
- `installed_path` = `{project-root}/_omp/workflows/memory`
|
|
31
|
+
- `memory_folder` = `{project-root}/_omp/.memory`
|
|
32
|
+
- `steps_path` = `{installed_path}/steps`
|
|
33
|
+
|
|
34
|
+
### MCP Tools Available
|
|
35
|
+
|
|
36
|
+
| Tool | Purpose |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `add_memories_openmemory` | 添加用户级记忆 |
|
|
39
|
+
| `search_memory_openmemory` | 语义搜索记忆 |
|
|
40
|
+
| `list_memories_openmemory` | 列出所有记忆 |
|
|
41
|
+
| `delete_memories_openmemory` | 删除指定记忆 |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## EXECUTION
|
|
46
|
+
|
|
47
|
+
### Step 1: Quick Status Check
|
|
48
|
+
|
|
49
|
+
1. Read `_omp/.memory/` directory, count files
|
|
50
|
+
2. Call `list_memories_openmemory` to get user memory count
|
|
51
|
+
3. Display status summary
|
|
52
|
+
|
|
53
|
+
### Step 2: Display Menu
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
🧠 OpenMemory Plus - 记忆管理
|
|
57
|
+
|
|
58
|
+
📊 当前状态:
|
|
59
|
+
├── 项目级 (_omp/.memory/): {n} 个文件
|
|
60
|
+
└── 用户级 (openmemory): {n} 条记忆
|
|
61
|
+
|
|
62
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
+
|
|
64
|
+
选择操作:
|
|
65
|
+
|
|
66
|
+
[1] 📊 查看状态 详细记忆状态和统计
|
|
67
|
+
[2] 🔍 搜索记忆 语义搜索项目和用户记忆
|
|
68
|
+
[3] 💾 存储记忆 手动添加新记忆
|
|
69
|
+
[4] 🧹 清理记忆 清理 ROT (冗余/过时/琐碎)
|
|
70
|
+
[5] 🔄 同步检查 检测冲突并解决
|
|
71
|
+
[6] ⏰ 衰减分析 查看记忆衰减状态
|
|
72
|
+
[7] 🔗 知识图谱 查看实体关系
|
|
73
|
+
|
|
74
|
+
[M] 返回菜单 [X] 退出
|
|
75
|
+
|
|
76
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
|
+
|
|
78
|
+
输入数字选择,或直接描述你的需求:
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 3: Wait for User Input
|
|
82
|
+
|
|
83
|
+
**STOP and WAIT** for user input. Do NOT proceed automatically.
|
|
84
|
+
|
|
85
|
+
### Step 4: Route to Step File
|
|
86
|
+
|
|
87
|
+
Based on user input, load the corresponding step file:
|
|
88
|
+
|
|
89
|
+
| Input | Keywords | Load Step |
|
|
90
|
+
|-------|----------|-----------|
|
|
91
|
+
| `1` | 状态, 概览, status, overview | `./steps/status.md` |
|
|
92
|
+
| `2` | 搜索, 找, 查, search, find | `./steps/search.md` |
|
|
93
|
+
| `3` | 存储, 记住, 保存, store, save, remember | `./steps/store.md` |
|
|
94
|
+
| `4` | 清理, 删除, clean, delete, remove | `./steps/clean.md` |
|
|
95
|
+
| `5` | 同步, 冲突, sync, conflict | `./steps/sync.md` |
|
|
96
|
+
| `6` | 衰减, 老化, decay, aging | `./steps/decay.md` |
|
|
97
|
+
| `7` | 图谱, 关系, graph, relation | `./steps/graph.md` |
|
|
98
|
+
| `M` | 菜单, menu | Re-display menu |
|
|
99
|
+
| `X` | 退出, exit, quit | Exit workflow |
|
|
100
|
+
|
|
101
|
+
### Natural Language Routing
|
|
102
|
+
|
|
103
|
+
Support natural language commands:
|
|
104
|
+
|
|
105
|
+
- "搜索部署配置" → Load `search.md`
|
|
106
|
+
- "这个项目用 React" → Load `store.md`
|
|
107
|
+
- "清理过期的记忆" → Load `clean.md`
|
|
108
|
+
- "查看记忆衰减" → Load `decay.md`
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## STEP FILE PROTOCOL
|
|
113
|
+
|
|
114
|
+
Each step file MUST:
|
|
115
|
+
|
|
116
|
+
1. Execute its specific action
|
|
117
|
+
2. Display results clearly
|
|
118
|
+
3. Offer follow-up actions
|
|
119
|
+
4. End with: `"还需要其他操作吗?输入 M 返回菜单,或直接输入下一个操作"`
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## FALLBACK (MCP Unavailable)
|
|
124
|
+
|
|
125
|
+
If `openmemory` MCP tools are not available:
|
|
126
|
+
|
|
127
|
+
1. Display warning: `"⚠️ openmemory MCP 不可用,用户级记忆功能受限"`
|
|
128
|
+
2. Offer to store user-level info temporarily in `_omp/.memory/user-context.yaml`
|
|
129
|
+
3. Continue with project-level memory operations
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## SUCCESS METRICS
|
|
134
|
+
|
|
135
|
+
✅ Quick status displayed on entry
|
|
136
|
+
✅ Menu clearly presented
|
|
137
|
+
✅ User input correctly routed
|
|
138
|
+
✅ Each action completes with clear output
|
|
139
|
+
✅ Return to menu flow works smoothly
|
|
140
|
+
|
|
141
|
+
## FAILURE MODES
|
|
142
|
+
|
|
143
|
+
❌ Proceeding without user input
|
|
144
|
+
❌ Misrouting user commands
|
|
145
|
+
❌ Not handling MCP unavailability
|
|
146
|
+
❌ Breaking out of menu loop unexpectedly
|
|
147
|
+
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# OpenMemory Plus - Agent 记忆管理
|
|
2
|
-
|
|
3
|
-
本项目已启用 OpenMemory Plus 双层记忆管理系统。
|
|
4
|
-
|
|
5
|
-
## 快速使用
|
|
6
|
-
|
|
7
|
-
**只需记住一个命令:**
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
/memory
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
输入后会显示菜单,选择数字或用自然语言描述需求:
|
|
14
|
-
|
|
15
|
-
| 选项 | 说明 |
|
|
16
|
-
|------|------|
|
|
17
|
-
| 1 | 📋 查看状态 - 详细记忆状态 |
|
|
18
|
-
| 2 | 🔍 搜索记忆 - 语义搜索 |
|
|
19
|
-
| 3 | 💾 存储记忆 - 手动添加 |
|
|
20
|
-
| 4 | 🧹 清理记忆 - 清理 ROT |
|
|
21
|
-
| 5 | 🔄 同步检查 - 冲突检测 |
|
|
22
|
-
| 6 | ⏰ 衰减分析 - 时间衰减 |
|
|
23
|
-
| 7 | 🔗 知识图谱 - 实体关系 |
|
|
24
|
-
|
|
25
|
-
**示例:**
|
|
26
|
-
- 输入 `2` 或 "搜索部署配置"
|
|
27
|
-
- 输入 `4` 或 "清理过期的记忆"
|
|
28
|
-
|
|
29
|
-
## 双层记忆架构
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
Agent 记忆系统
|
|
33
|
-
├── .memory/ (项目级)
|
|
34
|
-
│ ├── project.yaml # 项目配置 (SSOT)
|
|
35
|
-
│ ├── decisions.yaml # 技术决策
|
|
36
|
-
│ └── changelog.yaml # 变更历史
|
|
37
|
-
└── openmemory (用户级)
|
|
38
|
-
├── 用户偏好 # 跨项目通用
|
|
39
|
-
├── 用户技能 # 个人能力
|
|
40
|
-
└── 对话上下文 # 历史记忆
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## 自动行为
|
|
44
|
-
|
|
45
|
-
### 对话开始时
|
|
46
|
-
1. 搜索 `openmemory` 获取用户上下文
|
|
47
|
-
2. 加载 `.memory/project.yaml` 获取项目配置
|
|
48
|
-
3. 融合上下文提供个性化响应
|
|
49
|
-
|
|
50
|
-
### 对话结束时
|
|
51
|
-
1. 检测有价值信息
|
|
52
|
-
2. 按分类规则路由存储
|
|
53
|
-
3. 项目级 → `.memory/`
|
|
54
|
-
4. 用户级 → `openmemory`
|
|
55
|
-
|
|
56
|
-
## MCP 工具
|
|
57
|
-
|
|
58
|
-
| 工具 | 用途 |
|
|
59
|
-
|------|------|
|
|
60
|
-
| `add_memories_openmemory` | 添加用户级记忆 |
|
|
61
|
-
| `search_memory_openmemory` | 语义搜索记忆 |
|
|
62
|
-
| `list_memories_openmemory` | 列出所有记忆 |
|
|
63
|
-
| `delete_memories_openmemory` | 删除指定记忆 |
|
|
64
|
-
|
|
65
|
-
## 分类规则
|
|
66
|
-
|
|
67
|
-
| 信息类型 | 存储位置 | 示例 |
|
|
68
|
-
|----------|----------|------|
|
|
69
|
-
| 项目配置 | `.memory/` | 部署 URL、路径 |
|
|
70
|
-
| 技术决策 | `.memory/` | 框架选择、架构 |
|
|
71
|
-
| 用户偏好 | `openmemory` | 语言、风格 |
|
|
72
|
-
| 用户技能 | `openmemory` | 熟悉的技术栈 |
|
|
73
|
-
|
|
74
|
-
详细规则见 `.rules/memory/classification.md`
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
*由 OpenMemory Plus CLI 生成 | https://github.com/Alenryuichi/openmemory-plus*
|
|
78
|
-
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# OpenMemory Plus 配置
|
|
2
|
-
|
|
3
|
-
## 记忆管理系统
|
|
4
|
-
|
|
5
|
-
本项目已启用 OpenMemory Plus 双层记忆管理。
|
|
6
|
-
|
|
7
|
-
### 命令入口
|
|
8
|
-
|
|
9
|
-
**只需记住一个命令:**
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
/memory
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
输入后会显示菜单,选择数字或用自然语言描述需求:
|
|
16
|
-
|
|
17
|
-
| 选项 | 说明 |
|
|
18
|
-
|------|------|
|
|
19
|
-
| 1 | 📋 查看状态 - 详细记忆状态 |
|
|
20
|
-
| 2 | 🔍 搜索记忆 - 语义搜索 |
|
|
21
|
-
| 3 | 💾 存储记忆 - 手动添加 |
|
|
22
|
-
| 4 | 🧹 清理记忆 - 清理 ROT |
|
|
23
|
-
| 5 | 🔄 同步检查 - 冲突检测 |
|
|
24
|
-
| 6 | ⏰ 衰减分析 - 时间衰减 |
|
|
25
|
-
| 7 | 🔗 知识图谱 - 实体关系 |
|
|
26
|
-
|
|
27
|
-
### 存储架构
|
|
28
|
-
|
|
29
|
-
| 系统 | 存储位置 | 用途 |
|
|
30
|
-
|------|----------|------|
|
|
31
|
-
| 项目级 | `.memory/*.yaml` | 项目配置、技术决策、变更记录 |
|
|
32
|
-
| 用户级 | `openmemory` MCP | 用户偏好、技能、跨项目上下文 |
|
|
33
|
-
|
|
34
|
-
### 自动提取 (Memory Extraction)
|
|
35
|
-
|
|
36
|
-
对话结束时自动执行:
|
|
37
|
-
1. 检测有价值信息
|
|
38
|
-
2. 智能分类路由
|
|
39
|
-
3. 项目级 → `.memory/`
|
|
40
|
-
4. 用户级 → `openmemory`
|
|
41
|
-
|
|
42
|
-
### MCP 工具
|
|
43
|
-
|
|
44
|
-
| 工具 | 用途 |
|
|
45
|
-
|------|------|
|
|
46
|
-
| `add_memories_openmemory` | 添加用户级记忆 |
|
|
47
|
-
| `search_memory_openmemory` | 语义搜索记忆 |
|
|
48
|
-
| `list_memories_openmemory` | 列出所有记忆 |
|
|
49
|
-
| `delete_memories_openmemory` | 删除指定记忆 |
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
*由 OpenMemory Plus CLI 生成*
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# OpenMemory Plus - Agent 记忆管理
|
|
2
|
-
|
|
3
|
-
本项目已启用 OpenMemory Plus 双层记忆管理系统。
|
|
4
|
-
|
|
5
|
-
## 快速使用
|
|
6
|
-
|
|
7
|
-
**只需记住一个命令:**
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
/memory
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
输入后会显示菜单,选择数字或用自然语言描述需求:
|
|
14
|
-
|
|
15
|
-
| 选项 | 说明 |
|
|
16
|
-
|------|------|
|
|
17
|
-
| 1 | 📋 查看状态 - 详细记忆状态 |
|
|
18
|
-
| 2 | 🔍 搜索记忆 - 语义搜索 |
|
|
19
|
-
| 3 | 💾 存储记忆 - 手动添加 |
|
|
20
|
-
| 4 | 🧹 清理记忆 - 清理 ROT |
|
|
21
|
-
| 5 | 🔄 同步检查 - 冲突检测 |
|
|
22
|
-
| 6 | ⏰ 衰减分析 - 时间衰减 |
|
|
23
|
-
| 7 | 🔗 知识图谱 - 实体关系 |
|
|
24
|
-
|
|
25
|
-
## 双层记忆架构
|
|
26
|
-
|
|
27
|
-
| 层级 | 存储 | 用途 |
|
|
28
|
-
|------|------|------|
|
|
29
|
-
| 项目级 | `.memory/*.yaml` | 项目配置、技术决策、变更记录 |
|
|
30
|
-
| 用户级 | `openmemory` MCP | 用户偏好、技能、跨项目上下文 |
|
|
31
|
-
|
|
32
|
-
## 自动行为
|
|
33
|
-
|
|
34
|
-
### 对话开始时
|
|
35
|
-
1. 搜索 `openmemory` 获取用户上下文
|
|
36
|
-
2. 加载 `.memory/project.yaml` 获取项目配置
|
|
37
|
-
3. 融合上下文提供个性化响应
|
|
38
|
-
|
|
39
|
-
### 对话结束时
|
|
40
|
-
1. 检测有价值信息
|
|
41
|
-
2. 按分类规则路由存储
|
|
42
|
-
3. 项目级 → `.memory/`
|
|
43
|
-
4. 用户级 → `openmemory`
|
|
44
|
-
|
|
45
|
-
## 配置文件
|
|
46
|
-
|
|
47
|
-
- `.memory/project.yaml` - 项目配置
|
|
48
|
-
- 命令和 Skill 文件 - 参考 IDE 对应目录
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
*由 OpenMemory Plus CLI 生成*
|