memorix 1.8.9 → 1.9.1

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 (62) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +12 -1
  3. package/README.zh-CN.md +7 -1
  4. package/dist/cli/index.js +4764 -2186
  5. package/dist/index.js +2703 -1901
  6. package/dist/maintenance-runner.js +1966 -1129
  7. package/dist/media-audio-runner.js +2465 -1628
  8. package/dist/media-video-runner.js +2465 -1628
  9. package/dist/memcode-runtime/CHANGELOG.md +46 -0
  10. package/dist/sdk.js +2765 -1899
  11. package/dist/vector-backfill-runner.d.ts +4 -1
  12. package/dist/vector-backfill-runner.js +2466 -1627
  13. package/docs/API_REFERENCE.md +14 -0
  14. package/docs/CONFIGURATION.md +68 -0
  15. package/docs/DEVELOPMENT.md +3 -3
  16. package/docs/MULTI-DEVICE-SYNC-RESEARCH.md +344 -0
  17. package/docs/PERFORMANCE.md +109 -20
  18. package/docs/README.md +4 -2
  19. package/llms-full.txt +1 -0
  20. package/llms.txt +1 -0
  21. package/package.json +2 -1
  22. package/plugins/antigravity/memorix/plugin.json +1 -1
  23. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  24. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  25. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  26. package/plugins/copilot/memorix/plugin.json +1 -1
  27. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  28. package/plugins/hermes/memorix/plugin.yaml +1 -1
  29. package/plugins/omp/memorix/package.json +1 -1
  30. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  31. package/plugins/pi/memorix/package.json +1 -1
  32. package/server.json +2 -2
  33. package/src/cli/command-guide.ts +9 -1
  34. package/src/cli/commands/serve-http.ts +11 -0
  35. package/src/cli/commands/sync-store.ts +191 -0
  36. package/src/cli/commands/sync.ts +8 -0
  37. package/src/compact/engine.ts +14 -4
  38. package/src/memory/freshness.ts +7 -4
  39. package/src/memory/observations.ts +133 -8
  40. package/src/runtime/maintenance-targets.ts +6 -0
  41. package/src/runtime/vector-backfill-runner.ts +186 -8
  42. package/src/sdk.ts +13 -6
  43. package/src/search/semantic-index.ts +340 -0
  44. package/src/server.ts +1 -1
  45. package/src/store/obs-store.ts +54 -2
  46. package/src/store/orama-store.ts +385 -114
  47. package/src/store/sqlite-db.ts +6 -0
  48. package/src/store/sqlite-fts.ts +164 -0
  49. package/src/store/sqlite-store.ts +83 -6
  50. package/src/sync/adapters/fs.ts +179 -0
  51. package/src/sync/adapters/github.ts +258 -0
  52. package/src/sync/adapters/object-store.ts +267 -0
  53. package/src/sync/adapters/postgres.ts +269 -0
  54. package/src/sync/engine.ts +353 -0
  55. package/src/sync/journal.ts +162 -0
  56. package/src/sync/merge.ts +116 -0
  57. package/src/sync/namespace.ts +15 -0
  58. package/src/sync/paging.ts +45 -0
  59. package/src/sync/policy.ts +37 -0
  60. package/src/sync/remote-factory.ts +49 -0
  61. package/src/sync/store-port.ts +288 -0
  62. package/src/sync/types.ts +183 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,52 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.9.1] - 2026-09-08
8
+
9
+ ### Changed
10
+ - **Large-scale retrieval** -- SQLite FTS5 is now the persistent lexical
11
+ candidate index. It stays synchronized on insert, update, delete, and can be
12
+ rebuilt from the durable observations table.
13
+ - **Disk-backed semantic retrieval** -- the optional local LanceDB shadow index
14
+ stores only vector IDs and metadata, uses HNSW with scalar quantization once
15
+ the corpus is large enough, and fuses bounded semantic candidates with FTS5
16
+ results. Search falls back to Orama when the optional native package is not
17
+ available.
18
+ - **Lazy large-corpus startup** -- projects above the Orama hydration threshold
19
+ keep SQLite as the source of truth and do not load the complete observation
20
+ corpus into the interactive agent process. Detail, export, and maintenance
21
+ paths can still load the data they explicitly need.
22
+ - **Large-store acceptance** -- adds regression coverage and verified gates for
23
+ 1k, 10k, 40k, and 100k records without reducing the durable memory corpus.
24
+ - **Post-threshold vector writes** -- newly generated vectors still reach the
25
+ persistent semantic index after the in-memory Orama corpus is released.
26
+
27
+ ### Fixed
28
+ - **Stale lexical index on upsert** -- replace-style SQLite writes could leave
29
+ old terms in an external-content FTS index. Observation upserts now preserve
30
+ trigger-visible row updates so old terms are removed.
31
+ - **Optional native dependency bundling** -- LanceDB is resolved at runtime so
32
+ unsupported platforms or installations without its native binary continue
33
+ to build and use the FTS5/Orama fallback.
34
+
35
+ ## [1.9.0] - 2026-09-07
36
+
37
+ ### Added
38
+ - **Opt-in multi-device sync** -- adds a project-scoped observation
39
+ event contract with privacy filtering, local outbox retry, conflict evidence,
40
+ device-clone protection, bounded relay pulls, and filesystem/GitHub/S3/
41
+ Postgres transport boundaries. It is disabled by default and keeps local
42
+ SQLite as the canonical store.
43
+ - **Sync hardening** -- retracts records that become private or agent-targeted,
44
+ keeps imported observations and sync state atomic, rejects immutable-key
45
+ collisions, verifies every pulled content hash, and uses stable continuation
46
+ cursors so large pulls do not skip events.
47
+ - **Resource hardening** -- coalesces deferred vector workers across hook
48
+ processes, respects retry cooldowns, drains due vector jobs through one
49
+ recoverable worker, removes the redundant full-document detail cache, and
50
+ batches startup vector hydration to reduce CPU/RAM peaks without imposing a
51
+ small corpus limit.
52
+
7
53
  ## [1.8.9] - 2026-09-06
8
54
 
9
55
  ### Added
package/README.md CHANGED
@@ -63,7 +63,11 @@ Use Claude Code today, Codex tomorrow, and Cursor in the afternoon. The agent ca
63
63
  | Static rule files drift | Gotchas, fixes, and project skills evolve from real work |
64
64
  | Parallel agent work gets messy | `memorix orchestrate` coordinates task context, handoffs, locks, verification, and review loops |
65
65
 
66
- Memorix is local-first. SQLite is the canonical store, Orama handles search, and LLM-backed formation/embedding is optional. Without model keys, Memorix still works with local full-text retrieval.
66
+ Memorix is local-first. SQLite is the canonical store. Small projects use the
67
+ in-process Orama path; larger projects use a persistent SQLite FTS5 candidate
68
+ index and, when available, an optional local LanceDB semantic shadow index.
69
+ Both indexes are rebuildable and are never a limit on how many durable memories
70
+ you can keep. LLM-backed formation and embedding remain optional.
67
71
 
68
72
  ### Capabilities
69
73
 
@@ -85,6 +89,7 @@ Memorix is more than a memory store. It also installs agent integrations, keeps
85
89
  | Orchestration and team work | Task planning, worker handoffs, file locks, messages, verification gates, and review loops | `memorix orchestrate`, `memorix team`, `memorix lock` |
86
90
  | memcode | A bundled terminal coding agent that already reads and writes the same project memory | `memorix`, `memcode` |
87
91
  | CLI and SDK | Scriptable access for automation, imports/exports, diagnostics, and custom integrations | `memorix ...`, `createMemoryClient()` |
92
+ | Optional multi-device sync | Project-scoped, privacy-filtered observation events with local SQLite kept canonical; GitHub JSONL, filesystem, S3, or Postgres relay | `memorix sync store status\|push\|pull` |
88
93
 
89
94
  <h2 id="works-with-your-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
90
95
 
@@ -218,6 +223,12 @@ CLI, MCP, and HTTP are different entry points:
218
223
  - `memorix serve` is the stdio MCP bridge used by IDEs and coding agents. Its default tool profile is `micro`, so agents see only the compact core tool set.
219
224
  - `memorix background start` / `memorix serve-http` run the HTTP service for a shared endpoint, dashboard, VPS Docker deployment, or multiple clients.
220
225
 
226
+ Multi-device store sync is opt-in and separate from HTTP sharing. It never
227
+ uploads the live SQLite database or WAL files. By default it only relays
228
+ qualified project-visible observations; personal, agent-targeted, candidate,
229
+ ephemeral, and other-project records stay local. Set `MEMORIX_SYNC_PROVIDER` and
230
+ inspect `memorix sync store status --json` before the first push.
231
+
221
232
  <h2 id="install"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="Install" height="32" /></picture></h2>
222
233
 
223
234
  Requirements:
package/README.zh-CN.md CHANGED
@@ -62,7 +62,7 @@ Memorix 给你已经在用的 AI 编程 Agent 加上一套共享、可检索的
62
62
  | 静态规则文件容易过期 | 坑点、修复和项目技能从真实工作中持续沉淀 |
63
63
  | 并行 Agent 工作容易乱 | `memorix orchestrate` 负责协调任务上下文、交接、文件锁、验证和 review 流程 |
64
64
 
65
- Memorix 是本地优先的。SQLite 是权威存储,Orama 负责搜索,LLM 记忆整理和 embedding 是可选能力。没有模型 key 时,Memorix 仍然可以用本地全文检索工作。
65
+ Memorix 是本地优先的。SQLite 是权威存储。小项目使用进程内 Orama;数据量较大时,关键词检索使用持久化的 SQLite FTS5 候选索引,并在可用时使用本地 LanceDB 语义影子索引。索引都可以重建,也不会限制你能长期保存多少条记忆。LLM 记忆整理和 embedding 仍然是可选能力。
66
66
 
67
67
  ### 能力矩阵
68
68
 
@@ -84,6 +84,7 @@ Memorix 不只是一个记忆库。它还负责安装 Agent 接入、保留有
84
84
  | Orchestration 和团队协作 | 任务规划、worker 交接、文件锁、消息、验证门和 review loop | `memorix orchestrate`、`memorix team`、`memorix lock` |
85
85
  | memcode | 内置终端 Coding Agent,默认读写同一套项目记忆 | `memorix`、`memcode` |
86
86
  | CLI 和 SDK | 给自动化、导入导出、诊断和自定义集成使用的本地接口 | `memorix ...`、`createMemoryClient()` |
87
+ | 可选多设备同步 | 按项目隔离、经过隐私过滤的记忆事件同步;本地 SQLite 仍是主库 | `memorix sync store status\|push\|pull` |
87
88
 
88
89
  <h2 id="支持你的-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>
89
90
 
@@ -217,6 +218,11 @@ CLI、MCP 和 HTTP 是不同入口:
217
218
  - `memorix serve` 是给 IDE / Coding Agent 使用的 stdio MCP 桥。
218
219
  - `memorix background start` / `memorix serve-http` 是 HTTP 服务,用于共享端点、Dashboard、VPS Docker 部署或多客户端。
219
220
 
221
+ 多设备记忆同步是可选功能,和 HTTP 共享服务不是一回事。它不会上传
222
+ `memorix.db`、WAL 或 SHM 文件。默认只同步当前项目中已确认且项目可见的
223
+ 观察记录;个人、指定 Agent、候选、短期和其它项目的记录会留在本地。设置
224
+ `MEMORIX_SYNC_PROVIDER` 后,先运行 `memorix sync store status --json` 再 push。
225
+
220
226
  <h2 id="安装"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="安装" height="32" /></picture></h2>
221
227
 
222
228
  要求: