@hir4ta/mneme 0.18.3 → 0.19.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mneme",
3
3
  "description": "A plugin that provides long-term memory for Claude Code. It automatically saves context lost during auto-compact, offering features for session restoration, recording technical decisions, and learning developer patterns.",
4
- "version": "0.18.3",
4
+ "version": "0.19.0",
5
5
  "author": {
6
6
  "name": "hir4ta"
7
7
  },
package/README.ja.md CHANGED
@@ -10,9 +10,9 @@ Claude Codeの長期記憶を実現するプラグイン
10
10
  ## 機能
11
11
 
12
12
  ### コア機能
13
- - **会話の自動保存**: セッション終了時にjqで自動保存(確実・高速)
13
+ - **インクリメンタル保存**: 各ターン完了時に差分のみをSQLiteに保存(Node.js、高速)
14
14
  - **自動記憶検索**: プロンプトごとに関連する過去のセッション・判断を自動で注入
15
- - **PreCompactバックアップ**: Auto-Compact前にinteractionsをバックアップ(コンテキスト95%で発動)
15
+ - **PreCompact対応**: Auto-Compact前に未保存分をキャッチアップ(コンテキスト95%で発動)
16
16
  - **フルデータ抽出**: `/mneme:save` で要約・判断・パターン・ルールを一括保存
17
17
  - **記憶参照プランニング**: `/mneme:plan` で過去の知見を活用した設計・計画
18
18
  - **セッション再開**: `/mneme:resume` で過去のセッションを再開(チェーン追跡付き)
@@ -49,6 +49,15 @@ Claude Codeの長期記憶を実現するプラグイン
49
49
 
50
50
  ### 前提条件
51
51
 
52
+ > **⚠️ 重要: Node.js 22.5.0 以上が必要です**
53
+ >
54
+ > mnemeは **Node.js 22.5.0** で導入された組み込みの `node:sqlite` モジュールを使用しています。
55
+ > Node.js 20以前のバージョンではダッシュボードが動作しません。
56
+ >
57
+ > バージョン確認: `node --version`
58
+ >
59
+ > Node.js 20 LTSは2026年4月でサポート終了です。Node.js 22以上にアップグレードしてください。
60
+
52
61
  - **jq**: フックでJSON処理に使用します
53
62
 
54
63
  ```bash
@@ -110,11 +119,15 @@ Claude Codeを再起動
110
119
 
111
120
  ## 使い方
112
121
 
113
- ### セッション自動保存
122
+ ### インクリメンタル保存
123
+
124
+ **会話ログは各ターン完了時に自動保存**されます(Node.jsでストリーミング処理)。設定不要。
114
125
 
115
- **会話ログは自動保存**されます(セッション終了時にjqで抽出)。設定不要。
126
+ - **Stop hook**: 各アシスタント応答完了時に差分のみを保存
127
+ - **PreCompact hook**: Auto-Compact前に未保存分をキャッチアップ
128
+ - **SessionEnd hook**: 軽量な終了処理のみ(重い処理なし)
116
129
 
117
- **PreCompact**ではinteractionsを`preCompactBackups`にバックアップします(コンテキスト95%で発動)。要約は自動作成されません。
130
+ **`/mneme:save`を実行しないと、セッション終了時に会話履歴は削除されます**(ゴミデータ防止)。
118
131
 
119
132
  ### 自動記憶検索
120
133
 
@@ -214,47 +227,55 @@ mnemeはMCPサーバーを提供し、Claude Codeから直接呼び出せる検
214
227
 
215
228
  ```mermaid
216
229
  flowchart TB
217
- subgraph autosave [会話の自動保存]
218
- A[セッション終了] --> B[SessionEndフック]
219
- B --> C[jqでトランスクリプトから抽出]
220
- C --> D[interactions + files + metrics]
230
+ subgraph incremental [インクリメンタル保存]
231
+ A[各ターン] --> B[Stop Hook]
232
+ B --> C[Node.js ストリーミング]
233
+ C --> D[差分のみ保存]
221
234
  end
222
235
 
223
236
  subgraph autosearch [自動記憶検索]
224
- E[ユーザープロンプト] --> F[UserPromptSubmitフック]
225
- F --> G[sessions/decisions/patternsを検索]
226
- G --> H[関連コンテキストを注入]
237
+ E[ユーザープロンプト] --> F[UserPromptSubmit Hook]
238
+ F --> G[sessions/decisions/patterns検索]
239
+ G --> H[関連コンテキスト注入]
240
+ end
241
+
242
+ subgraph precompact [PreCompact キャッチアップ]
243
+ I[コンテキスト95%] --> J[PreCompact Hook]
244
+ J --> K[未保存分をキャッチアップ]
227
245
  end
228
246
 
229
- subgraph backup [PreCompactバックアップ]
230
- I[コンテキスト95%] --> J[PreCompactフック]
231
- J --> K[interactionsをpreCompactBackupsに保存]
247
+ subgraph sessionend [セッション終了]
248
+ L[終了] --> M[SessionEnd Hook]
249
+ M --> N{コミット済み?}
250
+ N -->|Yes| O[interactions保持]
251
+ N -->|No| P[interactions削除]
232
252
  end
233
253
 
234
- subgraph manual [手動操作]
235
- L["mneme:save"] --> M[判断 + パターン + ルールを抽出]
236
- N["mneme:plan"] --> O[記憶参照 + 設計 + タスク分割]
254
+ subgraph manual [手動アクション]
255
+ Q["mneme:save"] --> R[decisions + patterns + rules抽出]
256
+ R --> S[セッションをコミット済みに]
257
+ T["mneme:plan"] --> U[記憶参照 + タスク分割]
237
258
  end
238
259
 
239
260
  subgraph resume [セッション再開]
240
- P["mneme:resume"] --> Q[一覧から選択]
241
- Q --> R[過去の文脈を復元 + resumedFrom設定]
261
+ V["mneme:resume"] --> W[一覧から選択]
262
+ W --> X[コンテキスト復元 + resumedFrom設定]
242
263
  end
243
264
 
244
265
  subgraph review [レビュー]
245
- S["mneme:review"] --> T[ルールに基づく指摘]
246
- T --> U[レビュー結果を保存]
266
+ Y["mneme:review"] --> Z[ルールベース指摘]
267
+ Z --> AA[レビュー結果保存]
247
268
  end
248
269
 
249
270
  subgraph dashboard [ダッシュボード]
250
- V["npx @hir4ta/mneme -d"] --> W[ブラウザで表示]
251
- W --> X[全データを閲覧]
271
+ AB["npx @hir4ta/mneme -d"] --> AC[ブラウザで開く]
272
+ AC --> AD[全データ閲覧]
252
273
  end
253
274
 
254
- D --> P
255
- H --> L
256
- M --> V
257
- U --> V
275
+ D --> Q
276
+ H --> Q
277
+ S --> AB
278
+ AA --> AB
258
279
  ```
259
280
 
260
281
  ## データ保存
@@ -397,7 +418,7 @@ mnemeは**完全にローカルで動作**し、外部サーバーへのデー
397
418
  | **外部通信** | なし - curl/fetch/HTTP リクエスト等は一切使用していません |
398
419
  | **データ保存** | すべてプロジェクト内の `.mneme/` ディレクトリに保存 |
399
420
  | **会話履歴** | `local.db` に保存され、自動的にgitignore(Git共有されません) |
400
- | **使用ツール** | bash, jq, sqlite3, Node.js標準ライブラリのみ |
421
+ | **使用ツール** | bash, Node.js, jq, sqlite3(外部依存なし) |
401
422
  | **コード** | オープンソース - すべてのコードは監査可能です |
402
423
 
403
424
  ### プライバシー設計
package/README.md CHANGED
@@ -10,9 +10,9 @@ Provides automatic session saving, intelligent memory search, and web dashboard
10
10
  ## Features
11
11
 
12
12
  ### Core Features
13
- - **Auto-save interactions**: Conversations auto-saved at session end (jq-based, reliable)
13
+ - **Incremental save**: Save only new interactions on each turn completion (Node.js, fast)
14
14
  - **Auto memory search**: Related past sessions/decisions automatically injected on each prompt
15
- - **Backup on PreCompact**: Interactions backed up before Auto-Compact (context 95% full)
15
+ - **PreCompact support**: Catch up unsaved interactions before Auto-Compact (context 95% full)
16
16
  - **Full data extraction**: Save summary, decisions, patterns, and rules with `/mneme:save`
17
17
  - **Memory-informed planning**: Design and plan with past knowledge via `/mneme:plan`
18
18
  - **Session Resume**: Resume past sessions with `/mneme:resume` (with chain tracking)
@@ -49,6 +49,15 @@ Provides automatic session saving, intelligent memory search, and web dashboard
49
49
 
50
50
  ### Prerequisites
51
51
 
52
+ > **⚠️ IMPORTANT: Node.js >= 22.5.0 Required**
53
+ >
54
+ > mneme uses the built-in `node:sqlite` module, which was introduced in **Node.js 22.5.0**.
55
+ > The dashboard will NOT work on Node.js 20 or earlier versions.
56
+ >
57
+ > Check your version: `node --version`
58
+ >
59
+ > Node.js 20 LTS ends April 2026. Please upgrade to Node.js 22 or later.
60
+
52
61
  - **jq**: Used for JSON processing in hooks
53
62
 
54
63
  ```bash
@@ -110,11 +119,15 @@ This will auto-update on Claude Code startup.
110
119
 
111
120
  ## Usage
112
121
 
113
- ### Session Auto-Save
122
+ ### Incremental Save
123
+
124
+ **Conversation logs are auto-saved on each turn completion** (Node.js streaming). No configuration needed.
114
125
 
115
- **Interactions are auto-saved** at session end using jq (no Claude dependency). No configuration needed.
126
+ - **Stop hook**: Saves only new interactions on each assistant response completion
127
+ - **PreCompact hook**: Catches up unsaved interactions before Auto-Compact
128
+ - **SessionEnd hook**: Lightweight cleanup only (no heavy processing)
116
129
 
117
- **PreCompact** backs up interactions to `preCompactBackups` before Auto-Compact (context 95% full). Summary is NOT auto-created.
130
+ **If you don't run `/mneme:save`, conversation history is deleted at session end** (prevents garbage data).
118
131
 
119
132
  ### Auto Memory Search
120
133
 
@@ -214,10 +227,10 @@ mneme provides MCP servers with search and database tools callable directly from
214
227
 
215
228
  ```mermaid
216
229
  flowchart TB
217
- subgraph autosave [Auto-Save Interactions]
218
- A[Session End] --> B[SessionEnd Hook]
219
- B --> C[jq extracts from transcript]
220
- C --> D[interactions + files + metrics]
230
+ subgraph incremental [Incremental Save]
231
+ A[Each Turn] --> B[Stop Hook]
232
+ B --> C[Node.js streaming]
233
+ C --> D[Save only new interactions]
221
234
  end
222
235
 
223
236
  subgraph autosearch [Auto Memory Search]
@@ -226,35 +239,43 @@ flowchart TB
226
239
  G --> H[Inject relevant context]
227
240
  end
228
241
 
229
- subgraph backup [PreCompact Backup]
242
+ subgraph precompact [PreCompact Catch-up]
230
243
  I[Context 95% Full] --> J[PreCompact Hook]
231
- J --> K[Backup interactions to preCompactBackups]
244
+ J --> K[Catch up missed interactions]
245
+ end
246
+
247
+ subgraph sessionend [Session End]
248
+ L[Exit] --> M[SessionEnd Hook]
249
+ M --> N{Committed?}
250
+ N -->|Yes| O[Keep interactions]
251
+ N -->|No| P[Delete interactions]
232
252
  end
233
253
 
234
254
  subgraph manual [Manual Actions]
235
- L["mneme:save"] --> M[Extract decisions + patterns + rules]
236
- N["mneme:plan"] --> O[Memory-informed design + tasks]
255
+ Q["mneme:save"] --> R[Extract decisions + patterns + rules]
256
+ R --> S[Mark session committed]
257
+ T["mneme:plan"] --> U[Memory-informed design + tasks]
237
258
  end
238
259
 
239
260
  subgraph resume [Session Resume]
240
- P["mneme:resume"] --> Q[Select from list]
241
- Q --> R[Restore past context + set resumedFrom]
261
+ V["mneme:resume"] --> W[Select from list]
262
+ W --> X[Restore past context + set resumedFrom]
242
263
  end
243
264
 
244
265
  subgraph review [Review]
245
- S["mneme:review"] --> T[Rule-based findings]
246
- T --> U[Save review results]
266
+ Y["mneme:review"] --> Z[Rule-based findings]
267
+ Z --> AA[Save review results]
247
268
  end
248
269
 
249
270
  subgraph dashboard [Dashboard]
250
- V["npx @hir4ta/mneme -d"] --> W[Open in browser]
251
- W --> X[View all data]
271
+ AB["npx @hir4ta/mneme -d"] --> AC[Open in browser]
272
+ AC --> AD[View all data]
252
273
  end
253
274
 
254
- D --> P
255
- H --> L
256
- M --> V
257
- U --> V
275
+ D --> Q
276
+ H --> Q
277
+ S --> AB
278
+ AA --> AB
258
279
  ```
259
280
 
260
281
  ## Data Storage
@@ -388,16 +409,6 @@ Tags are selected from `.mneme/tags.json` to prevent notation variations (e.g.,
388
409
  - **cloud**: serverless, microservices, edge, wasm
389
410
  - And more...
390
411
 
391
- ## Versioning
392
-
393
- This project follows [Semantic Versioning](https://semver.org/).
394
-
395
- **⚠️ While in 0.x (pre-1.0), breaking changes may occur between minor versions.**
396
-
397
- If you encounter issues after an update:
398
- 1. Check the [releases](https://github.com/hir4ta/mneme/releases) for migration notes
399
- 2. Re-initialize with `npx @hir4ta/mneme --init` if needed
400
-
401
412
  ## Security and Privacy
402
413
 
403
414
  mneme operates **entirely locally** with no data sent to external servers.
@@ -407,7 +418,7 @@ mneme operates **entirely locally** with no data sent to external servers.
407
418
  | **External Communication** | None - no curl/fetch/HTTP requests are made |
408
419
  | **Data Storage** | All data stored in project's `.mneme/` directory |
409
420
  | **Conversation History** | Stored in `local.db`, automatically gitignored (not shared via Git) |
410
- | **Tools Used** | bash, jq, sqlite3, Node.js standard libraries only |
421
+ | **Tools Used** | bash, Node.js, jq, sqlite3 (no external dependencies) |
411
422
  | **Code** | Open source - all code is auditable |
412
423
 
413
424
  ### Privacy by Design