| name | project-memory |
| description | Proactive project memory management via MemOS MCP. USE MCP TOOLS AUTOMATICALLY when: (1) Starting work - memos_search for context, (2) Completing tasks - memos_save as MILESTONE, (3) Fixing bugs - memos_save as ERROR_PATTERN, (4) Making decisions - memos_save as DECISION, (5) Encountering errors - memos_search for solutions, (6) User mentions 'ไนๅ/ไธๆฌก/previously' - memos_search history, (7) Need to understand dependencies/causality - memos_get_graph or memos_trace_path for relationships, (8) Cube not found - memos_list_cubes to discover available cubes, (9) Need full memory details - memos_get with memory_id. Available MCP tools: memos_search, memos_search_context, memos_save, memos_list_v2, memos_get, memos_suggest, memos_list_cubes, memos_get_graph, memos_trace_path, memos_export_schema. |
Project Memory (MCP Powered)
Intelligent project memory system powered by MemOS MCP Server. Use MCP tools directly - no scripts needed!
๐จ ๅผบๅถ่งๅ (MUST/MUST NOT)
MUST (ๅฟ
้กป้ตๅฎ)
- ไฟฎๅค Bug ๅๅฟ
้กปไฟๅญไธบ
BUGFIX ๆ ERROR_PATTERN๏ผไธๅพไฝฟ็จ PROGRESS
- ๅๅบๆๆฏๅณ็ญๅๅฟ
้กปไฟๅญไธบ
DECISION๏ผๅ
ๅซ็็ฑๅๅค้ๆนๆก
- ๅ็ฐ้ๆพ่ๆ่ง็้ท้ฑๅฟ
้กปไฟๅญไธบ
GOTCHA
- ไฟๅญๆถๅฟ
้กปๆพๅผๆๅฎ
memory_type ๅๆฐ๏ผไธไพ่ต่ชๅจๆฃๆต
MUST NOT (็ฆๆญข)
- ็ฆๆญขๅฐ PROGRESS ไฝไธบ้ป่ฎค/ไธ่ฝ็ฑปๅ
- ็ฆๆญข็็ฅ memory_type ๅๆฐ (้ค้ๆฏ็บฏ่ฟๅบฆๆฑๆฅ)
- ็ฆๆญขๅจ PROGRESS ไธญๅ
ๅซ้่ฏฏ่งฃๅณๆนๆกใๆๆฏๅณ็ญใ้ท้ฑ่ญฆๅ
็ฑปๅ้ๆฉๅณ็ญๆ
ๆฏๅฆ่งฃๅณไบไธไธช้่ฏฏ/Bug๏ผ
โโ ๆฏ โ ๆฏๅฆๆ้็จไปทๅผ๏ผ
โ โโ ๆฏ โ ERROR_PATTERN (้่ฏฏๆจกๅผ๏ผๅฏๅค็จ)
โ โโ ๅฆ โ BUGFIX (ไธๆฌกๆงไฟฎๅค)
โโ ๅฆ โ ๆฏๅฆๅๅบไบๆๆฏ้ๆฉ๏ผ
โโ ๆฏ โ DECISION
โโ ๅฆ โ ๆฏๅฆๅ็ฐไบ้ๆพ่ๆ่ง็้ฎ้ข๏ผ
โโ ๆฏ โ GOTCHA
โโ ๅฆ โ ๆฏๅฆๆฏๅฏๅค็จ็ไปฃ็ ๆจกๆฟ๏ผ
โโ ๆฏ โ CODE_PATTERN
โโ ๅฆ โ ๆฏๅฆไฟฎๆนไบ้
็ฝฎ๏ผ
โโ ๆฏ โ CONFIG
โโ ๅฆ โ ๆฏๅฆๅฎๆไบ้ๅคง้็จ็ข๏ผ
โโ ๆฏ โ MILESTONE
โโ ๅฆ โ ๆฏๅฆๆฐๅขไบๅ่ฝ๏ผ
โโ ๆฏ โ FEATURE
โโ ๅฆ โ PROGRESS (ไป
้็บฏ่ฟๅบฆ)
้่ฏฏ็คบ่ vs ๆญฃ็กฎ็คบ่
โ ้่ฏฏ: memos_save(content="ไฟฎๅคไบๆจกๅ่ทฏๅพ้ฎ้ข") โ ้ป่ฎค PROGRESS
โ
ๆญฃ็กฎ: memos_save(content="ไฟฎๅคไบๆจกๅ่ทฏๅพ้ฎ้ข...", memory_type="BUGFIX")
โ ้่ฏฏ: memos_save(content="ๅณๅฎ้็จไธ่ฝจๆถๆ") โ ๅฏ่ฝ่ขซ่ฏฏๆฃๆต
โ
ๆญฃ็กฎ: memos_save(content="ๅณๅฎ้็จไธ่ฝจๆถๆ...", memory_type="DECISION")
โ ้่ฏฏ: memos_save(content="ๆณจๆ: fallbacksไผ่ชๅจๅๆข") โ ๅฏ่ฝ่ฝๅ
ฅ PROGRESS
โ
ๆญฃ็กฎ: memos_save(content="ๆณจๆ: fallbacksไผ่ชๅจๅๆข...", memory_type="GOTCHA")
็ฝฎไฟกๅบฆๆบๅถ
detect_memory_type() ่ฟๅ (็ฑปๅ, ็ฝฎไฟกๅบฆ) ๅ
็ป๏ผ
| ็ฝฎไฟกๅบฆ | ๅซไน |
|---|
| 1.0 | ๆพๅผๆๅฎ็ฑปๅ |
| 0.85-0.95 | ๅผบ็นๅพๅน้
๏ผๅฆ tracebackใๅณๅฎ้็จ๏ผ |
| 0.7-0.84 | ไธญ็ญ็นๅพๅน้
|
| 0.3 | ้ป่ฎค PROGRESS๏ผๆ ็นๅพๅน้
๏ผไผ่งฆๅ่ญฆๅ๏ผ |
ๅฝ็ฝฎไฟกๅบฆ < 0.6 ไธ็ฑปๅไธบ PROGRESS ๆถ๏ผ็ณป็ปไผ่พๅบ่ญฆๅๆ็คบๆพๅผๆๅฎ็ฑปๅใ
ๅฅๅบทๆฃๆฅ
memos_get_stats ไผๅจ PROGRESS ๅ ๆฏ >70% ๆถ่พๅบๅฅๅบท่ญฆๅ๏ผ
โ ๏ธ ๅฅๅบท่ญฆๅ: PROGRESS ็ฑปๅๅ ๆฏ่ฟ้ซ (>70%)
่ฟๅฏ่ฝๅฏผ่ด Neo4j ็ฅ่ฏๅพ่ฐฑๆ ๆณๅปบ็ซๆๆๅ
ณ็ณปใๅปบ่ฎฎ:
1. ไฟๅญ่ฎฐๅฟๆถๆพๅผๆๅฎ memory_type ๅๆฐ
2. ๅ่็ฑปๅ้ๆฉๅณ็ญๆ
Quick Reference: MCP Tools
| Tool | When to Use | Example |
|---|
memos_search | Find related memories, solutions, patterns | query: "ERROR_PATTERN ModuleNotFoundError" |
memos_search_context | Smart search with conversation context | query: "what was the solution?" |
memos_save | Record important information | content: "Fixed X by Y", memory_type: "BUGFIX" |
memos_list_v2 | See all memories in project (with compression) | cube_id: "dev_cube", limit: 10 |
memos_get | Get full memory details by ID | memory_id: "uuid..." (after compacted results) |
memos_list_cubes | Discover available cubes | include_status: true |
memos_suggest | Get search suggestions | context: "Connection refused error" |
memos_get_graph | View dependency/causal relationships | query: "Neo4j" โ shows CAUSE/RELATE/CONFLICT |
memos_trace_path | Trace paths between memories | source_id: "...", target_id: "..." |
memos_export_schema | View graph structure and health | Shows node/edge counts, types, connectivity |
memos_register_cube | Manual cube registration (fallback) | cube_id: "my_project_cube" |
memos_create_user | Create user (fallback) | user_id: "dev_user" |
getGraphData (IPC) | Renderer-side graph data fetch | projectId: "ddsp-svc-6.3" (Desktop App Only) |
Context Compression (NEW!)
When search/list returns >15 results, automatic compression activates:
- Shows top 5 previews with ID, type, and summary
- Displays total count and omitted count
- Use
memos_get(memory_id="<id>") to retrieve full details
Example compressed output:
## ๐ Search Results (Compacted)
**Query**: `Neo4j`
**Total**: 25 memories found
**Showing**: Top 5 (omitted 20)
### Preview
1. ๐ **[BUGFIX]** Fixed Neo4j connection timeout...
ID: `abc123-def456-...`
...
๐ก **Tip**: Use `memos_get(memory_id="<id>")` to get full details.
To disable compression: memos_search(query="...", compact=false)
Desktop Integration: Knowledge Graph Visualization
The desktop app now supports real-time Neo4j knowledge graph visualization.
Usage in Renderer
const accomplish = getAccomplish();
const graphData = await accomplish.getGraphData("ddsp-svc-6.3");
UI Component
The <KnowledgeGraph /> component (located in renderer/components/memory/KnowledgeGraph.tsx) provides:
- Force-directed graph layout
- Node color-coding by memory type
- Interactive tooltips with memory content
- Color coding by type:
- LongTermMemory: Blue (#3b82f6)
- WorkingMemory: Emerald (#10b981)
- ShortTermMemory: Amber (#f59e0b)
- Episodic/Semantic: Violet/Pink
- Zoom, pan, and center controls
- Automatic data fetching for a given
projectId
Proactive Triggers (Use MCP Automatically!)
When to Search (memos_search)
| User Says / Context | Search Query |
|---|
| "ไนๅ", "ไธๆฌก", "previously" | {topic} history |
| "ไธบไปไน", "why did we" | DECISION {topic} |
| "ๆไน่งฃๅณ", "how to fix", error message | ERROR_PATTERN {error_type} |
| "็ฑปไผผ", "similar" | CODE_PATTERN {pattern} |
| Working with config file | CONFIG {filename} |
| Opening file for editing | {filename} gotcha |
When to Get Graph (memos_get_graph) - NEW!
| User Says / Context | Query | Returns |
|---|
| "ไพ่ตๅ
ณ็ณป", "dependencies" | {component} | CAUSE/RELATE relationships |
| "ไธบไปไนๅคฑ่ดฅ", "why failed", "root cause" | {error/feature} | Causal chain (AโBโC) |
| "็ธๅ
ณ็", "related to", "ๅ
ณ่" | {topic} | RELATE relationships |
| "ๅฒ็ช", "conflict", "็็พ" | {topic} | CONFLICT relationships |
| "ๅฝฑๅ", "impact", "ไผๅฝฑๅไปไน" | {change} | What depends on this |
| Debugging complex issues | {error_keyword} | Full context graph |
Example Output:
[Neo4j้่ฆJava 17+]
โโCAUSEโโ>
[Neo4jๅฏๅจๅคฑ่ดฅ, JAVA_HOME not set]
When to Trace Path (memos_trace_path) - NEW!
| Scenario | Use Case |
|---|
| ่ฟฝๆบฏๆ นๅ | source_id: "็็ถID", target_id: "ๆ นๅ ID" โ ๆพ็คบๅฎๆดๅ ๆ้พ |
| ็่งฃๅฝฑๅ | ไปๅณ็ญAๅฐ็ปๆB็่ทฏๅพ |
| ่ฐ่ฏๅคๆ้ฎ้ข | ๆพๅฐ้่ฏฏไน้ด็ๅ
ณ่ |
Example:
memos_trace_path(source_id="uuid1", target_id="uuid2", max_depth=5)
โ [ๅณ็ญA] โโCAUSEโโ> [ๅๆดB] โโCAUSEโโ> [้ฎ้ขC]
When to List Cubes (memos_list_cubes) - NEW!
| Scenario | Action |
|---|
| ้ๅฐ "cube not found" ้่ฏฏ | memos_list_cubes() ๆฅ็ๅฏ็จ cubes |
| ๅๆข้กน็ฎ | memos_list_cubes(include_status=true) ๆฅ็ๆณจๅ็ถๆ |
| ๅๅงๅ้กน็ฎ | ็กฎ่ฎค cube ๆฏๅฆๅญๅจ |
When to Export Schema (memos_export_schema) - NEW!
| Scenario | What You Get |
|---|
| ็่งฃ็ฅ่ฏๅบ็ปๆ | ่็น/่พนๆปๆฐ, ็ฑปๅๅๅธ |
| ๆฃๆฅๅฅๅบท็ถๆ | ๅญค็ซ่็นๆฐ, ่ฟๆฅๅบฆ |
| ๆฅ็ๅธธ็จๆ ็ญพ | Top 20 tags |
When to Save (memos_save)
| Scenario | Memory Type | Content Should Include |
|---|
| Bug fixed | ERROR_PATTERN | Error signature, cause, solution, prevention |
| Feature done | FEATURE | What was added, how to use |
| Task completed | MILESTONE | Summary of achievement |
| Made a choice | DECISION | Options considered, rationale, impact |
| Found a trap | GOTCHA | Issue, context, workaround |
| Changed config | CONFIG | What changed, why, how to revert |
| Code template | CODE_PATTERN | Template, usage, parameters |
Memory Type Formats
[ERROR_PATTERN] - For Solved Errors
[ERROR_PATTERN] Error: {ErrorType}
## Signature
- Type: {ErrorType}
- Message: {Full error message}
- Context: {When this occurs}
## Root Cause
{Why this error happens}
## Solution
1. {Step 1}
2. {Step 2}
## Prevention
{How to avoid in future}
Tags: error, {error_type}, {category}
[DECISION] - For Choices Made
[DECISION] Topic: {topic}
## Decision
{What was decided}
## Options Considered
1. **{Option A}**: {pros/cons}
2. **{Option B}** (chosen): {pros/cons}
## Rationale
{Why this option was chosen}
## Impact
- Files affected: {list}
- Dependencies: {list}
Tags: decision, {topic}
[CODE_PATTERN] - For Reusable Code
[CODE_PATTERN] Pattern: {name}
## Purpose
{What this pattern does}
## Template
```{language}
{code template}
Usage
{When and how to use}
Tags: pattern, {language}, {category}
### [MILESTONE] - For Achievements
```markdown
[MILESTONE] {short description}
## Summary
{What was accomplished}
## Details
- {detail 1}
- {detail 2}
Tags: milestone, {category}
[GOTCHA] - For Traps and Workarounds
[GOTCHA] {short description}
## Issue
{The non-obvious problem}
## Context
{When/where this occurs}
## Workaround
{How to avoid or fix}
Tags: gotcha, {category}
Workflow with MCP
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PROJECT MEMORY WORKFLOW (MCP) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ TRIGGER MCP TOOL ACTION โ
โ โโโโโโโ โโโโโโโโ โโโโโโ โ
โ โ
โ Start working โโโ> memos_search โโโ> Get project context โ
โ โ
โ Hit error โโโ> memos_search โโโ> Find ERROR_PATTERN โ
โ query: "ERROR_PATTERN {type}" โ
โ โ
โ Need context โโโ> memos_search_context โ> Smart search โ
โ with conversation history โ
โ โ
โ Need full detail โโ> memos_get โโโ> Get by memory_id โ
โ (after compacted results) โ
โ โ
โ Need root cause โโโ> memos_get_graph โโโ> View CAUSE chain โ
โ query: "{error_keyword}" โ
โ โ
โ Trace path โโโ> memos_trace_path โโ> AโBโC chain โ
โ source_id, target_id โ
โ โ
โ Check deps โโโ> memos_get_graph โโโ> View relationships โ
โ query: "{component}" โ
โ โ
โ Cube not found โโโ> memos_list_cubes โโ> Discover cubes โ
โ include_status: true โ
โ โ
โ Graph health โโโ> memos_export_schema > Stats & structure โ
โ โ
โ Solved error โโโ> memos_save โโโ> Save ERROR_PATTERN โ
โ memory_type: "ERROR_PATTERN" โ
โ โ
โ Make decision โโโ> memos_save โโโ> Save DECISION โ
โ memory_type: "DECISION" โ
โ โ
โ Complete task โโโ> memos_save โโโ> Save MILESTONE โ
โ memory_type: "MILESTONE" โ
โ โ
โ "ไนๅ/ไธๆฌก" โโโ> memos_search โโโ> Find history โ
โ โ
โ Unsure search โโโ> memos_suggest โโโ> Get suggestions โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Best Practices
- Search Before Save - Check if similar memory exists
- Be Specific - Include file paths, function names, error messages
- Include Why - Don't just record what, explain the reasoning
- Tag Consistently - Use standard tags for searchability
- Save Immediately - Record while context is fresh
Legacy Scripts (Optional)
Note: With MCP, you rarely need these scripts. They're kept for backward compatibility.
The following scripts in scripts/ folder still work but MCP is preferred:
| Script | MCP Equivalent |
|---|
memos_init_project.py | Auto-registered by MCP |
memos_save.py | memos_save tool |
memos_search.py | memos_search tool |
Environment Variables
| Variable | Default | Description |
|---|
MEMOS_URL | http://localhost:18000 | MemOS API base URL |
MEMOS_USER | dev_user | Default user ID |
MEMOS_DEFAULT_CUBE | dev_cube | Default memory cube ID |
MEMOS_CUBES_DIR | G:/test/MemOS/data/memos_cubes | Cube storage (for auto-registration) |
NEO4J_HTTP_URL | http://localhost:7474/db/neo4j/tx/commit | Neo4j HTTP endpoint |
NEO4J_USER | neo4j | Neo4j username |
NEO4J_PASSWORD | 12345678 | Neo4j password |
MEMOS_ENABLE_DELETE | false | Enable delete functionality |
Auto-Registration & Auto-Creation
The MCP server includes smart cube management:
- Auto-Creation: New projects automatically get their own cube (cloned from
dev_cube template)
- Automatic Registration: Cubes are auto-registered on first use
- Path Verification: Checks if cube directory exists before registration
- Helpful Error Messages: If a cube is not found and cannot be created, shows available cubes
- Cube Discovery: Use
memos_list_cubes to see all available cubes
How it works for new projects:
User starts Claude Code in ~/projects/my-new-project/
โ
MCP derives cube_id: "my_new_project_cube"
โ
Cube not found? Auto-create from dev_cube template
โ
Auto-register with MemOS API
โ
Ready to use!
Requirements:
dev_cube must exist as template in MEMOS_CUBES_DIR
- Cubes directory must be writable
If you see "Cube Registration Failed" error:
- Use
memos_list_cubes() to see available cubes
- Verify
dev_cube exists as template
- Check cubes directory permissions
curl -X POST "http://localhost:18000/mem_cubes" \
-H "Content-Type: application/json" \
-d '{"user_id":"dev_user","mem_cube_name_or_path":"G:/test/MemOS/data/memos_cubes/dev_cube"}'
Troubleshooting (MCP Tools Only)
Note: All error recovery uses MCP tools - no Bash/curl required. Works in isolated projects.
Cube Not Found Error
Error: Cube 'xxx' not found or Cube not registered
Recovery Steps (all via MCP):
memos_list_cubes() โ See available cubes
- If cube exists but not registered:
memos_register_cube(cube_id="xxx")
- If cube doesn't exist: Create cube directory with config.json, then register
Example:
memos_list_cubes(include_status=true)
โ Shows: dev_cube (registered), my_project (not registered)
memos_register_cube(cube_id="my_project")
โ "Cube 'my_project' registered successfully"
User Does Not Exist Error
Error: User 'xxx' does not exist
Recovery Steps (all via MCP):
memos_create_user(user_id="xxx") โ Create the user
- Retry the original operation
Example:
memos_save(content="...", cube_id="my_cube")
โ Error: User 'dev_user' does not exist
memos_create_user(user_id="dev_user")
โ "User 'dev_user' created successfully"
memos_save(content="...", cube_id="my_cube")
โ Success
MCP Connection Error
Error: MCP tools not responding or timeout
Recovery Steps:
- Wait a moment and retry (API may be starting)
- Try a simpler operation first:
memos_list_cubes()
- If persistent, the MemOS API service may need restart (outside MCP scope)
Memory Not Found
Error: Search returns empty results
Recovery Steps (all via MCP):
memos_list(cube_id="xxx", limit=20) โ Check what memories exist
memos_list_cubes() โ Verify using correct cube_id
memos_search_context(query="...", context=[...]) โ Use context-aware search
- Try broader search terms or different memory types
Save Failed
Error: Save operation failed
Recovery Steps (all via MCP):
memos_list_cubes(include_status=true) โ Check cube status
- If not registered:
memos_register_cube(cube_id="xxx")
- If user error:
memos_create_user(user_id="xxx")
- Retry save operation
Quick Recovery Flowchart
Error occurred
โ
โโ "Cube not found" โโโโโโโโโโโโ> memos_list_cubes()
โ โ
โ โโ Found? โ memos_register_cube()
โ โโ Not found? โ Create cube first
โ
โโ "User does not exist" โโโโโโโ> memos_create_user(user_id="xxx")
โ
โโ "Save failed" โโโโโโโโโโโโโโโ> memos_list_cubes(include_status=true)
โ โ
โ โโ Check cube/user, then retry
โ
โโ "No results" โโโโโโโโโโโโโโโโ> memos_list() to verify data exists