memorix 0.10.2 → 0.10.3

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/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="downloads"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="license"></a>
16
16
  <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="stars"></a>
17
- <img src="https://img.shields.io/badge/tests-534%20passed-brightgreen?style=flat-square" alt="tests">
17
+ <img src="https://img.shields.io/badge/tests-593%20passed-brightgreen?style=flat-square" alt="tests">
18
18
  </p>
19
19
 
20
20
  <p align="center">
@@ -169,17 +169,39 @@ Captures decisions, errors, and gotchas automatically. Pattern detection in Engl
169
169
 
170
170
  ### Hybrid Search
171
171
 
172
- BM25 fulltext out of the box (~50MB RAM). Semantic search is **opt-in** to minimize resource usage:
172
+ BM25 fulltext out of the box (~50MB RAM). Semantic search is **opt-in** 3 providers:
173
173
 
174
174
  ```bash
175
- # Enable semantic search (optional requires 300-500MB RAM)
176
- # Set in your MCP config env, or export before starting:
177
- MEMORIX_EMBEDDING=fastembed # ONNX, fastest (~300MB)
178
- MEMORIX_EMBEDDING=transformers # Pure JS (~500MB)
179
- MEMORIX_EMBEDDING=off # Default — BM25 only, minimal resources
175
+ # Set in your MCP config env:
176
+ MEMORIX_EMBEDDING=api # Recommended zero local RAM, best quality
177
+ MEMORIX_EMBEDDING=fastembed # Local ONNX (~300MB RAM)
178
+ MEMORIX_EMBEDDING=transformers # Local JS/WASM (~500MB RAM)
179
+ MEMORIX_EMBEDDING=off # Default — BM25 only, minimal resources
180
180
  ```
181
181
 
182
- Install the provider you chose:
182
+ #### API Embedding (Recommended)
183
+
184
+ Works with any OpenAI-compatible endpoint — OpenAI, Qwen, Cohere, 中转站/反代, Ollama:
185
+
186
+ ```bash
187
+ MEMORIX_EMBEDDING=api
188
+ MEMORIX_EMBEDDING_API_KEY=sk-xxx # or reuse OPENAI_API_KEY
189
+ MEMORIX_EMBEDDING_MODEL=text-embedding-3-small # default
190
+ MEMORIX_EMBEDDING_BASE_URL=https://api.openai.com/v1 # optional
191
+ MEMORIX_EMBEDDING_DIMENSIONS=512 # optional dimension shortening
192
+ ```
193
+
194
+ **Performance advantages over competitors:**
195
+ - **10K LRU cache + disk persistence** — repeat queries cost $0 and take 0ms
196
+ - **Batch API calls** — up to 2048 texts per request (competitors: 1-by-1)
197
+ - **4x concurrent processing** — parallel batch chunks
198
+ - **Text normalization** — better cache hit rates via whitespace dedup
199
+ - **Debounced disk writes** — 5s coalesce window, not per-call I/O
200
+ - **Zero external dependencies** — no Chroma, no SQLite, just native `fetch`
201
+ - **Smart key fallback** — auto-reuses LLM API key if same provider
202
+
203
+ #### Local Embedding
204
+
183
205
  ```bash
184
206
  npm install -g fastembed # for MEMORIX_EMBEDDING=fastembed
185
207
  npm install -g @huggingface/transformers # for MEMORIX_EMBEDDING=transformers
@@ -187,6 +209,36 @@ npm install -g @huggingface/transformers # for MEMORIX_EMBEDDING=transformers
187
209
 
188
210
  Both run 100% locally. Zero API calls.
189
211
 
212
+ ### LLM Enhanced Mode (Optional)
213
+
214
+ Enable intelligent memory deduplication and fact extraction with your own API key:
215
+
216
+ ```bash
217
+ # Set in your MCP config env, or export before starting:
218
+ MEMORIX_LLM_API_KEY=sk-xxx # OpenAI-compatible API key
219
+ MEMORIX_LLM_PROVIDER=openai # openai | anthropic | openrouter
220
+ MEMORIX_LLM_MODEL=gpt-4o-mini # model name
221
+ MEMORIX_LLM_BASE_URL=https://... # custom endpoint (optional)
222
+ ```
223
+
224
+ Or use existing env vars — Memorix auto-detects:
225
+ - `OPENAI_API_KEY` → OpenAI
226
+ - `ANTHROPIC_API_KEY` → Anthropic
227
+ - `OPENROUTER_API_KEY` → OpenRouter
228
+
229
+ **Without LLM**: Free heuristic deduplication (similarity-based)
230
+ **With LLM**: Smart merge, fact extraction, contradiction detection
231
+
232
+ ### Interactive CLI
233
+
234
+ ```bash
235
+ memorix # Interactive menu (no args)
236
+ memorix configure # LLM + Embedding provider setup (TUI)
237
+ memorix status # Project info + stats
238
+ memorix dashboard # Web UI at localhost:3210
239
+ memorix hooks install # Auto-capture for IDEs
240
+ ```
241
+
190
242
  ---
191
243
 
192
244
  ## How It Works
@@ -222,23 +274,6 @@ Both run 100% locally. Zero API calls.
222
274
 
223
275
  ---
224
276
 
225
- ## Comparison
226
-
227
- | | [Mem0](https://github.com/mem0ai/mem0) | [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service) | **Memorix** |
228
- |---|---|---|---|
229
- | **Agents** | SDK-based | 13+ (MCP) | **9 agents (MCP)** |
230
- | **Cross-agent workspace sync** | — | — | **MCP configs, rules, skills, workflows** |
231
- | **Knowledge graph** | — | Yes | **Yes (MCP Official compatible)** |
232
- | **Hybrid search** | — | Yes | **Yes (BM25 + vector)** |
233
- | **Token-efficient retrieval** | — | — | **3-layer progressive disclosure** |
234
- | **Auto-memory hooks** | — | — | **Yes (multi-language pattern detection)** |
235
- | **Memory decay** | — | Yes | **Yes (exponential + immunity)** |
236
- | **Web dashboard** | Cloud | Yes | **Yes (D3.js graph)** |
237
- | **Privacy** | Cloud | Local | **100% local** |
238
- | **Cost** | Per-call | $0 | **$0** |
239
-
240
- ---
241
-
242
277
  ## Development
243
278
 
244
279
  ```bash
@@ -246,7 +281,7 @@ git clone https://github.com/AVIDS2/memorix.git
246
281
  cd memorix && npm install
247
282
 
248
283
  npm run dev # watch mode
249
- npm test # 534 tests
284
+ npm test # 593 tests
250
285
  npm run build # production build
251
286
  ```
252
287
 
@@ -260,6 +295,16 @@ npm run build # production build
260
295
 
261
296
  Built on ideas from [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service), [MemCP](https://github.com/maydali28/memcp), [claude-mem](https://github.com/anthropics/claude-code), and [Mem0](https://github.com/mem0ai/mem0).
262
297
 
298
+ ## Star History
299
+
300
+ <a href="https://star-history.com/#AVIDS2/memorix&Date">
301
+ <picture>
302
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date&theme=dark" />
303
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date" />
304
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date" width="600" />
305
+ </picture>
306
+ </a>
307
+
263
308
  ## License
264
309
 
265
310
  [Apache 2.0](LICENSE)
package/README.zh-CN.md CHANGED
@@ -14,7 +14,7 @@
14
14
  <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="downloads"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="license"></a>
16
16
  <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="stars"></a>
17
- <img src="https://img.shields.io/badge/tests-534%20passed-brightgreen?style=flat-square" alt="tests">
17
+ <img src="https://img.shields.io/badge/tests-593%20passed-brightgreen?style=flat-square" alt="tests">
18
18
  </p>
19
19
 
20
20
  <p align="center">
@@ -212,23 +212,6 @@ npm install -g @huggingface/transformers # 或: npm install -g fastembed
212
212
 
213
213
  ---
214
214
 
215
- ## 对比
216
-
217
- | | [Mem0](https://github.com/mem0ai/mem0) | [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service) | **Memorix** |
218
- |---|---|---|---|
219
- | **Agent 支持** | SDK 集成 | 13+(MCP) | **9 个 Agent(MCP)** |
220
- | **跨 Agent 工作区同步** | — | — | **MCP 配置、规则、技能、工作流** |
221
- | **知识图谱** | — | 是 | **是(兼容 MCP 官方)** |
222
- | **混合搜索** | — | 是 | **是(BM25 + 向量)** |
223
- | **Token 高效检索** | — | — | **3 层渐进式展示** |
224
- | **自动记忆 Hook** | — | — | **是(多语言模式检测)** |
225
- | **记忆衰减** | — | 是 | **是(指数衰减 + 豁免)** |
226
- | **Web 仪表盘** | 云端 | 是 | **是(D3.js 图谱)** |
227
- | **隐私** | 云端 | 本地 | **100% 本地** |
228
- | **费用** | 按量付费 | $0 | **$0** |
229
-
230
- ---
231
-
232
215
  ## 开发
233
216
 
234
217
  ```bash
@@ -236,7 +219,7 @@ git clone https://github.com/AVIDS2/memorix.git
236
219
  cd memorix && npm install
237
220
 
238
221
  npm run dev # 监听模式
239
- npm test # 534 个测试
222
+ npm test # 593 个测试
240
223
  npm run build # 生产构建
241
224
  ```
242
225
 
@@ -250,6 +233,16 @@ npm run build # 生产构建
250
233
 
251
234
  参考了 [mcp-memory-service](https://github.com/doobidoo/mcp-memory-service)、[MemCP](https://github.com/maydali28/memcp)、[claude-mem](https://github.com/anthropics/claude-code) 和 [Mem0](https://github.com/mem0ai/mem0) 的设计思路。
252
235
 
236
+ ## Star History
237
+
238
+ <a href="https://star-history.com/#AVIDS2/memorix&Date">
239
+ <picture>
240
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date&theme=dark" />
241
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date" />
242
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=AVIDS2/memorix&type=Date" width="600" />
243
+ </picture>
244
+ </a>
245
+
253
246
  ## 许可证
254
247
 
255
248
  [Apache 2.0](LICENSE)