@bubstack/moe-memory 0.1.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.
Files changed (157) hide show
  1. package/.mcp.json +18 -0
  2. package/README.md +47 -0
  3. package/agents/search-conversations.md +171 -0
  4. package/dist/LICENSE +25 -0
  5. package/dist/cli.d.ts +25 -0
  6. package/dist/cli.d.ts.map +1 -0
  7. package/dist/cli.js +125 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/codex-hook-trust.d.ts +4 -0
  10. package/dist/codex-hook-trust.d.ts.map +1 -0
  11. package/dist/codex-hook-trust.js +114 -0
  12. package/dist/codex-hook-trust.js.map +1 -0
  13. package/dist/codex-support.d.ts +6 -0
  14. package/dist/codex-support.d.ts.map +1 -0
  15. package/dist/codex-support.js +29 -0
  16. package/dist/codex-support.js.map +1 -0
  17. package/dist/constants.d.ts +14 -0
  18. package/dist/constants.d.ts.map +1 -0
  19. package/dist/constants.js +14 -0
  20. package/dist/constants.js.map +1 -0
  21. package/dist/db.d.ts +103 -0
  22. package/dist/db.d.ts.map +1 -0
  23. package/dist/db.js +430 -0
  24. package/dist/db.js.map +1 -0
  25. package/dist/doctor-cli.d.ts +3 -0
  26. package/dist/doctor-cli.d.ts.map +1 -0
  27. package/dist/doctor-cli.js +43 -0
  28. package/dist/doctor-cli.js.map +1 -0
  29. package/dist/doctor.d.ts +17 -0
  30. package/dist/doctor.d.ts.map +1 -0
  31. package/dist/doctor.js +98 -0
  32. package/dist/doctor.js.map +1 -0
  33. package/dist/embedding-migration.d.ts +73 -0
  34. package/dist/embedding-migration.d.ts.map +1 -0
  35. package/dist/embedding-migration.js +120 -0
  36. package/dist/embedding-migration.js.map +1 -0
  37. package/dist/embeddings.d.ts +78 -0
  38. package/dist/embeddings.d.ts.map +1 -0
  39. package/dist/embeddings.js +180 -0
  40. package/dist/embeddings.js.map +1 -0
  41. package/dist/file-lock.d.ts +39 -0
  42. package/dist/file-lock.d.ts.map +1 -0
  43. package/dist/file-lock.js +91 -0
  44. package/dist/file-lock.js.map +1 -0
  45. package/dist/index-cli.d.ts +10 -0
  46. package/dist/index-cli.d.ts.map +1 -0
  47. package/dist/index-cli.js +195 -0
  48. package/dist/index-cli.js.map +1 -0
  49. package/dist/index.d.ts +12 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +19 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/indexer.d.ts +4 -0
  54. package/dist/indexer.d.ts.map +1 -0
  55. package/dist/indexer.js +318 -0
  56. package/dist/indexer.js.map +1 -0
  57. package/dist/install-check.d.ts +48 -0
  58. package/dist/install-check.d.ts.map +1 -0
  59. package/dist/install-check.js +82 -0
  60. package/dist/install-check.js.map +1 -0
  61. package/dist/journal/index.d.ts +5 -0
  62. package/dist/journal/index.d.ts.map +1 -0
  63. package/dist/journal/index.js +5 -0
  64. package/dist/journal/index.js.map +1 -0
  65. package/dist/journal/legacy-sidecars.d.ts +74 -0
  66. package/dist/journal/legacy-sidecars.d.ts.map +1 -0
  67. package/dist/journal/legacy-sidecars.js +151 -0
  68. package/dist/journal/legacy-sidecars.js.map +1 -0
  69. package/dist/journal/markdown.d.ts +91 -0
  70. package/dist/journal/markdown.d.ts.map +1 -0
  71. package/dist/journal/markdown.js +234 -0
  72. package/dist/journal/markdown.js.map +1 -0
  73. package/dist/journal/search.d.ts +91 -0
  74. package/dist/journal/search.d.ts.map +1 -0
  75. package/dist/journal/search.js +203 -0
  76. package/dist/journal/search.js.map +1 -0
  77. package/dist/journal/store.d.ts +96 -0
  78. package/dist/journal/store.d.ts.map +1 -0
  79. package/dist/journal/store.js +270 -0
  80. package/dist/journal/store.js.map +1 -0
  81. package/dist/journal-cli.d.ts +19 -0
  82. package/dist/journal-cli.d.ts.map +1 -0
  83. package/dist/journal-cli.js +153 -0
  84. package/dist/journal-cli.js.map +1 -0
  85. package/dist/logging.d.ts +6 -0
  86. package/dist/logging.d.ts.map +1 -0
  87. package/dist/logging.js +20 -0
  88. package/dist/logging.js.map +1 -0
  89. package/dist/mcp-server.d.ts +34 -0
  90. package/dist/mcp-server.d.ts.map +1 -0
  91. package/dist/mcp-server.js +607 -0
  92. package/dist/mcp-server.js.map +1 -0
  93. package/dist/parser.d.ts +11 -0
  94. package/dist/parser.d.ts.map +1 -0
  95. package/dist/parser.js +445 -0
  96. package/dist/parser.js.map +1 -0
  97. package/dist/paths.d.ts +103 -0
  98. package/dist/paths.d.ts.map +1 -0
  99. package/dist/paths.js +258 -0
  100. package/dist/paths.js.map +1 -0
  101. package/dist/search-cli.d.ts +3 -0
  102. package/dist/search-cli.d.ts.map +1 -0
  103. package/dist/search-cli.js +138 -0
  104. package/dist/search-cli.js.map +1 -0
  105. package/dist/search.d.ts +36 -0
  106. package/dist/search.d.ts.map +1 -0
  107. package/dist/search.js +371 -0
  108. package/dist/search.js.map +1 -0
  109. package/dist/show-cli.d.ts +3 -0
  110. package/dist/show-cli.d.ts.map +1 -0
  111. package/dist/show-cli.js +60 -0
  112. package/dist/show-cli.js.map +1 -0
  113. package/dist/show.d.ts +3 -0
  114. package/dist/show.d.ts.map +1 -0
  115. package/dist/show.js +984 -0
  116. package/dist/show.js.map +1 -0
  117. package/dist/stats-cli.d.ts +3 -0
  118. package/dist/stats-cli.d.ts.map +1 -0
  119. package/dist/stats-cli.js +51 -0
  120. package/dist/stats-cli.js.map +1 -0
  121. package/dist/stats.d.ts +19 -0
  122. package/dist/stats.d.ts.map +1 -0
  123. package/dist/stats.js +116 -0
  124. package/dist/stats.js.map +1 -0
  125. package/dist/summarizer.d.ts +83 -0
  126. package/dist/summarizer.d.ts.map +1 -0
  127. package/dist/summarizer.js +526 -0
  128. package/dist/summarizer.js.map +1 -0
  129. package/dist/summary-sentinel.d.ts +31 -0
  130. package/dist/summary-sentinel.d.ts.map +1 -0
  131. package/dist/summary-sentinel.js +80 -0
  132. package/dist/summary-sentinel.js.map +1 -0
  133. package/dist/sync-cli.d.ts +15 -0
  134. package/dist/sync-cli.d.ts.map +1 -0
  135. package/dist/sync-cli.js +202 -0
  136. package/dist/sync-cli.js.map +1 -0
  137. package/dist/sync.d.ts +35 -0
  138. package/dist/sync.d.ts.map +1 -0
  139. package/dist/sync.js +204 -0
  140. package/dist/sync.js.map +1 -0
  141. package/dist/types.d.ts +125 -0
  142. package/dist/types.d.ts.map +1 -0
  143. package/dist/types.js +32 -0
  144. package/dist/types.js.map +1 -0
  145. package/dist/verify.d.ts +30 -0
  146. package/dist/verify.d.ts.map +1 -0
  147. package/dist/verify.js +174 -0
  148. package/dist/verify.js.map +1 -0
  149. package/dist/version.d.ts +13 -0
  150. package/dist/version.d.ts.map +1 -0
  151. package/dist/version.js +13 -0
  152. package/dist/version.js.map +1 -0
  153. package/hooks/hooks.json +15 -0
  154. package/package.json +71 -0
  155. package/prompts/search-agent.md +160 -0
  156. package/skills/remembering-conversations/MCP-TOOLS.md +147 -0
  157. package/skills/remembering-conversations/SKILL.md +97 -0
@@ -0,0 +1,147 @@
1
+ # Moe Memory MCP Tools Reference
2
+
3
+ The moe-memory plugin exposes seven MCP tools over two record types. This file
4
+ documents the two **conversation** tools — harvested Claude Code and Codex
5
+ transcripts.
6
+
7
+ The five **journal** tools cover what you deliberately wrote down:
8
+ `process_thoughts`, `search_journal`, `read_journal_entry`,
9
+ `list_recent_entries` and `read_recent_entries`. They are self-describing at
10
+ `tools/list`; the one thing worth knowing is that `search_journal`'s `sections`
11
+ filter takes the same snake_case names as `process_thoughts`
12
+ (`project_notes`, `technical_insights`, …), and `type` selects the project
13
+ journal, the user journal, or both.
14
+
15
+ ## search_conversations
16
+
17
+ Search your Moe Memory of past Claude Code and Codex conversations using semantic or text search.
18
+
19
+ **Tool name:** `mcp__plugin_moe-memory_moe-memory__search_conversations`
20
+
21
+ ### Parameters
22
+
23
+ | Parameter | Type | Required | Description |
24
+ |-----------|------|----------|-------------|
25
+ | `query` | `string` or `string[]` | Yes | Search query. String for single-concept search, array of 2-5 strings for multi-concept AND search |
26
+ | `mode` | `"vector"` \| `"text"` \| `"both"` | No | Search mode (default: `"both"`). Only used for single-concept searches |
27
+ | `limit` | `number` | No | Maximum results to return, 1-50 (default: 10) |
28
+ | `after` | `string` | No | Only return conversations after this date (YYYY-MM-DD) |
29
+ | `before` | `string` | No | Only return conversations before this date (YYYY-MM-DD) |
30
+ | `response_format` | `"markdown"` \| `"json"` | No | Output format (default: `"markdown"`) |
31
+
32
+ ### Search Modes
33
+
34
+ - **`vector`** - Semantic similarity search using embeddings
35
+ - **`text`** - Exact text matching (case-insensitive)
36
+ - **`both`** - Combined semantic + text search (default, recommended)
37
+
38
+ ### Single-Concept Search
39
+
40
+ ```typescript
41
+ {
42
+ query: "React Router authentication errors",
43
+ mode: "both",
44
+ limit: 10
45
+ }
46
+ ```
47
+
48
+ ### Multi-Concept Search (AND)
49
+
50
+ Search for conversations containing ALL concepts:
51
+
52
+ ```typescript
53
+ {
54
+ query: ["authentication", "React Router", "error handling"],
55
+ limit: 10
56
+ }
57
+ ```
58
+
59
+ Note: `mode` is ignored for multi-concept searches (always uses vector similarity).
60
+
61
+ ### Date Filtering
62
+
63
+ ```typescript
64
+ {
65
+ query: "refactoring patterns",
66
+ after: "2025-09-01",
67
+ before: "2025-10-01"
68
+ }
69
+ ```
70
+
71
+ ### Response Format
72
+
73
+ #### Markdown (default)
74
+
75
+ Human-readable format with:
76
+ - Project name and date
77
+ - Conversation summary
78
+ - Matched exchange snippet
79
+ - Similarity score
80
+ - File path and line numbers
81
+
82
+ #### JSON
83
+
84
+ Machine-readable format:
85
+ ```json
86
+ {
87
+ "results": [...],
88
+ "count": 5,
89
+ "mode": "both"
90
+ }
91
+ ```
92
+
93
+ ## read_conversation
94
+
95
+ Display a full conversation from Moe Memory as markdown.
96
+
97
+ **Tool name:** `mcp__plugin_moe-memory_moe-memory__read_conversation`
98
+
99
+ ### Parameters
100
+
101
+ | Parameter | Type | Required | Description |
102
+ |-----------|------|----------|-------------|
103
+ | `path` | `string` | Yes | Absolute path to the JSONL conversation file |
104
+ | `startLine` | `number` | No | Starting line number (1-indexed, inclusive) |
105
+ | `endLine` | `number` | No | Ending line number (1-indexed, inclusive) |
106
+
107
+ ### Usage
108
+
109
+ **Read entire conversation:**
110
+ ```typescript
111
+ {
112
+ path: "/Users/name/.config/moe/memory/conversation-archive/project/uuid.jsonl"
113
+ }
114
+ ```
115
+
116
+ **Read specific range:**
117
+ ```typescript
118
+ {
119
+ path: "/Users/name/.config/moe/memory/conversation-archive/project/uuid.jsonl",
120
+ startLine: 100,
121
+ endLine: 200
122
+ }
123
+ ```
124
+
125
+ ### Response Format
126
+
127
+ Markdown-formatted conversation with:
128
+ - Message roles (user/assistant)
129
+ - Content (including tool uses and results)
130
+ - Line numbers for reference
131
+
132
+ ## Error Handling
133
+
134
+ Both tools return errors as text content with `isError: true`:
135
+ - Invalid parameters (validation errors)
136
+ - File not found
137
+ - Date parsing errors
138
+ - Search failures
139
+
140
+ ## Performance Notes
141
+
142
+ - **search_conversations** is fast (< 100ms typically)
143
+ - **read_conversation** can be slow for large conversations
144
+ - Use `startLine`/`endLine` to paginate
145
+ - Conversations can be 1000+ lines
146
+ - Vector search uses sqlite-vec with cached embeddings
147
+ - Text search is a bound-parameter SQL `LIKE`, not FTS5 — the upstream note claiming FTS5 was wrong
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: remembering-conversations
3
+ description: You MUST invoke this skill before saying "I don't know," guessing, or treating any topic as new, no matter how trivial the question seems. It supplements other memory systems, which only hold partial records. Searching past conversations is the only way to recover what was actually said.
4
+ ---
5
+
6
+ # Remembering Conversations
7
+
8
+ **Core principle:** Search before reinventing. Searching costs nothing; reinventing or repeating mistakes costs everything.
9
+
10
+ ## Mandatory: Search Historical Memory
11
+
12
+ **YOU MUST search historical memory for any historical search.**
13
+
14
+ Announce: "Searching past conversations for [topic]."
15
+
16
+ ### Claude Code
17
+
18
+ Use the Task tool with `subagent_type: "search-conversations"`:
19
+
20
+ ```
21
+ Task tool:
22
+ description: "Search past conversations for [topic]"
23
+ prompt: "Search for [specific query or topic]. Focus on [what you're looking for - e.g., decisions, patterns, gotchas, code examples]."
24
+ subagent_type: "search-conversations"
25
+ ```
26
+
27
+ ### Codex
28
+
29
+ If a `search-conversations` agent is available, dispatch it with the same prompt. If not, use the MCP tools directly:
30
+
31
+ 1. Search with the `search_conversations` tool
32
+ 2. Read the top 2-5 results with the `read_conversation` tool
33
+ 3. Synthesize findings in your response
34
+ 4. Include source pointers so the user can inspect the original conversations
35
+
36
+ The search workflow will:
37
+ 1. Search with the `search_conversations` tool
38
+ 2. Read top 2-5 results with the `read_conversation` tool
39
+ 3. Synthesize findings (200-1000 words)
40
+ 4. Return actionable insights + sources
41
+
42
+ **Saves 50-100x context vs. loading raw conversations.**
43
+
44
+ ## When to Use
45
+
46
+ Use this whenever the current task would benefit from information you may have learned before, even if the user did not explicitly ask you to search.
47
+
48
+ **When past experience may help:**
49
+ - You need to recall decisions, rationale, patterns, solutions, pitfalls, or project context from earlier work
50
+ - A task resembles something you've solved, debugged, reviewed, released, or planned before
51
+ - You need to repeat a workflow or process that may have prior gotchas or established steps
52
+
53
+ **When you're stuck:**
54
+ - You've investigated a problem and can't find the solution
55
+ - Facing a complex problem without obvious solution in current code
56
+ - Need to follow an unfamiliar workflow or process
57
+
58
+ **When historical signals are present:**
59
+ - User says "last time", "before", "we discussed", "you implemented"
60
+ - User asks "why did we...", "what was the reason..."
61
+ - User says "do you remember...", "what do we know about..."
62
+
63
+ **Before answering from uncertainty:**
64
+ - Before guessing from memory or saying "I don't know" about something that may have been learned in a past conversation, search memory unless the current conversation already answers it
65
+
66
+ **Don't search first:**
67
+ - For current codebase structure (use Grep/Read to explore first)
68
+ - For info in current conversation
69
+ - Before understanding what you're being asked to do
70
+
71
+ ## Direct MCP Tool Access
72
+
73
+ Use these directly when a search agent is unavailable or the current harness does not support agent dispatch:
74
+ - `mcp__plugin_moe-memory_moe-memory__search_conversations`
75
+ - `mcp__plugin_moe-memory_moe-memory__read_conversation`
76
+
77
+ When using MCP tools directly, keep context small: search first, then read only the top 2-5 relevant conversations or line ranges.
78
+
79
+ See MCP-TOOLS.md for complete API reference if needed for advanced usage.
80
+
81
+ ## Two Kinds of Memory
82
+
83
+ `search_conversations` searches transcripts that were **harvested** — nobody chose
84
+ to write them down, so they are complete but unfiltered.
85
+
86
+ The same server also exposes a **journal**: things you deliberately wrote down,
87
+ which are shorter, already synthesised, and often the faster answer.
88
+
89
+ - `search_journal` — semantic search over journal entries
90
+ - `read_journal_entry` / `list_recent_entries` / `read_recent_entries`
91
+ - `process_thoughts` — write one
92
+
93
+ Reach for `search_journal` first when the question is about a *conclusion* you
94
+ reached before ("what did I decide about X", "what have I learned about how this
95
+ person works"), and `search_conversations` when you need the *episode*: the
96
+ rationale, the alternatives, the gotchas, the code. They are separately queryable
97
+ on purpose.