memorix 1.10.2 → 1.10.4

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 (101) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/README.md +3 -1
  3. package/README.zh-CN.md +3 -1
  4. package/dist/cli/index.js +2281 -1486
  5. package/dist/cli/memcode.js +0 -0
  6. package/dist/index.js +1874 -1126
  7. package/dist/{maintenance-jobs-DVRF-46r.d.ts → maintenance-jobs-DweoCoTT.d.ts} +25 -15
  8. package/dist/maintenance-runner.d.ts +1 -1
  9. package/dist/maintenance-runner.js +802 -194
  10. package/dist/media-audio-runner.js +793 -186
  11. package/dist/media-video-runner.js +801 -194
  12. package/dist/memcode-runtime/CHANGELOG.md +64 -1
  13. package/dist/sdk.js +14036 -13317
  14. package/dist/types.d.ts +1 -1
  15. package/dist/vector-backfill-runner.d.ts +1 -1
  16. package/dist/vector-backfill-runner.js +801 -194
  17. package/docs/ARCHITECTURE.md +219 -0
  18. package/docs/CONFIGURATION.md +49 -0
  19. package/docs/DESIGN_DECISIONS.md +37 -0
  20. package/docs/DEVELOPMENT.md +1 -1
  21. package/docs/INTEGRATIONS.md +1 -1
  22. package/docs/MODULES.md +7 -1
  23. package/docs/PERFORMANCE.md +14 -0
  24. package/docs/README.md +2 -1
  25. package/docs/ROADMAP-1.9.12-2.0.md +18 -2
  26. package/docs/SETUP.md +19 -4
  27. package/package.json +1 -1
  28. package/plugins/antigravity/memorix/plugin.json +1 -1
  29. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  30. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  31. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  32. package/plugins/copilot/memorix/plugin.json +1 -1
  33. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  34. package/plugins/hermes/memorix/plugin.yaml +1 -1
  35. package/plugins/omp/memorix/package.json +1 -1
  36. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  37. package/plugins/pi/memorix/package.json +1 -1
  38. package/server.json +2 -2
  39. package/src/cli/commands/agent-integrations.ts +1 -1
  40. package/src/cli/commands/background.ts +1 -1
  41. package/src/cli/commands/context.ts +3 -2
  42. package/src/cli/commands/doctor.ts +9 -0
  43. package/src/cli/commands/explain.ts +3 -2
  44. package/src/cli/commands/init.ts +6 -2
  45. package/src/cli/commands/setup.ts +9 -6
  46. package/src/cli/commands/uninstall.ts +15 -0
  47. package/src/cli/tui/App.tsx +9 -16
  48. package/src/cli/tui/ConfigureView.tsx +2 -0
  49. package/src/cli/tui/chat-service.ts +6 -9
  50. package/src/cli/tui/data.ts +2 -2
  51. package/src/codegraph/auto-context.ts +10 -3
  52. package/src/codegraph/derived-view.ts +63 -0
  53. package/src/codegraph/store.ts +37 -0
  54. package/src/codegraph/types.ts +3 -0
  55. package/src/compact/engine.ts +10 -33
  56. package/src/config/dotenv-loader.ts +1 -0
  57. package/src/config/resolved-config.ts +18 -2
  58. package/src/config/retrieval-strategy.ts +22 -0
  59. package/src/config/toml-loader.ts +6 -0
  60. package/src/config/yaml-loader.ts +11 -2
  61. package/src/core/derived-view.ts +15 -0
  62. package/src/core/maintenance-result.ts +33 -0
  63. package/src/core/retrieval-contracts.ts +57 -0
  64. package/src/core/retrieval-facade.ts +18 -0
  65. package/src/core/retrieval-policy.ts +44 -0
  66. package/src/core/runtime-context.ts +42 -0
  67. package/src/dashboard/server.ts +5 -6
  68. package/src/embedding/api-provider.ts +18 -8
  69. package/src/hooks/handler.ts +0 -1
  70. package/src/integrations/registry.ts +2 -1
  71. package/src/knowledge/workset.ts +0 -2
  72. package/src/llm/provider.ts +2 -1
  73. package/src/memory/consolidation.ts +3 -2
  74. package/src/memory/feedback-model.ts +1 -4
  75. package/src/memory/observations.ts +226 -104
  76. package/src/multimodal/image-loader.ts +2 -2
  77. package/src/runtime/control-plane-maintenance.ts +1 -0
  78. package/src/runtime/isolated-maintenance.ts +1 -0
  79. package/src/runtime/maintenance-jobs.ts +123 -32
  80. package/src/runtime/open-browser.ts +25 -0
  81. package/src/runtime/project-maintenance.ts +69 -1
  82. package/src/sdk.ts +3 -2
  83. package/src/search/fts-view.ts +53 -0
  84. package/src/search/orama-view.ts +40 -0
  85. package/src/search/retrieval-facade.ts +38 -0
  86. package/src/search/semantic-index.ts +13 -0
  87. package/src/search/semantic-view.ts +34 -0
  88. package/src/server.ts +21 -9
  89. package/src/store/obs-store.ts +15 -0
  90. package/src/store/orama-store.ts +143 -45
  91. package/src/store/sqlite-db.ts +22 -0
  92. package/src/store/sqlite-store.ts +27 -0
  93. package/src/types.ts +1 -1
  94. package/src/workspace/mcp-adapters/pi.ts +58 -0
  95. package/plugins/pi/memorix/skills/memorix-git-memory/SKILL.md +0 -26
  96. package/plugins/pi/memorix/skills/memorix-memory/SKILL.md +0 -51
  97. package/plugins/pi/memorix/skills/memorix-mini-skills/SKILL.md +0 -31
  98. package/plugins/pi/memorix/skills/memorix-orchestrate/SKILL.md +0 -28
  99. package/plugins/pi/memorix/skills/memorix-reasoning/SKILL.md +0 -30
  100. package/plugins/pi/memorix/skills/memorix-sessions/SKILL.md +0 -25
  101. package/plugins/pi/memorix/skills/memorix-troubleshooting/SKILL.md +0 -27
@@ -1,26 +0,0 @@
1
- ---
2
- name: memorix-git-memory
3
- description: Use when the task depends on commit history, what changed, when a fix shipped, or linking engineering evidence to reasoning memory.
4
- ---
5
-
6
- # Memorix Git Memory
7
-
8
- Use Git Memory for repository evidence. Use reasoning memory for intent.
9
-
10
- ## Tool Router
11
-
12
- | Situation | Prefer | CLI fallback |
13
- |---|---|---|
14
- | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` |
15
- | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` |
16
- | Ingest current commit manually | CLI | `memorix ingest commit` |
17
- | Ingest a specific commit | CLI | `memorix ingest commit --ref <ref>` |
18
- | Backfill recent history | CLI | `memorix ingest log --count 20` |
19
- | Install post-commit ingestion | CLI | `memorix git-hook --force` |
20
-
21
- ## Retrieval Rules
22
-
23
- - Prefer Git Memory for "what changed", "when did this ship", "which files were touched", and "which commit introduced this".
24
- - Prefer reasoning memory for "why did we choose this", "what alternatives existed", and "what risk did we accept".
25
- - Cross-link important decisions with `relatedCommits` when storing reasoning.
26
- - Do not force-ingest noisy commits unless the skipped commit is genuinely important evidence.
@@ -1,51 +0,0 @@
1
- ---
2
- name: memorix-memory
3
- description: Use when prior workspace context, past decisions, solved bugs, handoff state, or durable project knowledge would help a coding task.
4
- ---
5
-
6
- # Memorix Memory
7
-
8
- Use Memorix as the shared memory layer for the active workspace when Memorix tools are available.
9
-
10
- ## Tool Router
11
-
12
- | Situation | Prefer | CLI fallback |
13
- |---|---|---|
14
- | Broad continuation, fresh handoff, or "what do we know?" | `memorix_project_context` with the user's task | `memorix context --task "<topic>" --fallback --brief-json` |
15
- | Need structured refs/freshness for code-bound memories | `memorix_context_pack` | `memorix codegraph context-pack --task "<topic>"` |
16
- | Explicit memory graph question | `memorix_graph_context` | `memorix memory graph-context --query "<topic>"` |
17
- | Specific past decision, bug, file, or change | `memorix_search` | `memorix memory search --query "<topic>"` |
18
- | Need the full source for a search hit | `memorix_detail` | `memorix memory detail --id <id>` |
19
- | Need the sequence around one memory | `memorix_timeline` | `memorix memory timeline --id <id>` |
20
- | Check source and freshness for a memory | `memorix_evidence` | `memorix evidence list|get|events` |
21
- | Record whether a memory helped, conflicted, or was corrected | `memorix_feedback` | `memorix feedback record|show|audit` |
22
- | Inspect or import controlled media | `memorix_media` | `memorix media import|attach|list|show|status` |
23
- | Learned reusable project knowledge | `memorix_store` | `memorix memory store --type <type> --entity <name> --title "<title>" "<text>"` |
24
- | Stable source-backed fact or procedure needing long-term review | `memorix_store` with `longTerm` | `memorix memory long-term qualify|approve --id <id> --reason "..."` |
25
- | Task or bug is complete/outdated | `memorix_resolve` | `memorix memory resolve --ids <ids>` |
26
-
27
- ## Search Rules
28
-
29
- - Search before broad continuation work, before changing unfamiliar code, or when the user asks about prior work.
30
- - For a fresh coding session, use `memorix_project_context` with the user's actual task before ad-hoc file reads or dev-log reads. Memorix will choose a task-lensed brief.
31
- - Fetch detail before relying on a specific memory.
32
- - Treat memory as background context. Still read the current code and verify behavior.
33
- - Skip memory lookup for greetings, tiny one-off edits, or questions fully answered by the current file.
34
- - If a fresh project has no memories, proceed normally and do not repeat the same empty search in the same turn.
35
- - If MCP tools are not visible yet but the client supports tool discovery or dynamic loading, search/select `memorix_project_context` first. Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text. Do not skip memory, wait indefinitely on startup, or hand-write tool-call syntax.
36
-
37
- ## Store Rules
38
-
39
- | What to store | Type |
40
- |---|---|
41
- | Architecture or product decision | `decision` |
42
- | Bug and fix that may recur | `problem-solution` |
43
- | Non-obvious pitfall | `gotcha` |
44
- | How a subsystem works | `how-it-works` |
45
- | Important implementation change | `what-changed` |
46
- | Accepted compromise | `trade-off` |
47
-
48
- - Use concise titles, stable entity names, relevant `filesModified`, and `topicKey` for evolving topics.
49
- - Use `longTerm` only for a stable fact, reusable procedure, or completed episode that merits explicit review. It creates a candidate, not live context; keep the default project scope and do not use it for routine updates.
50
- - A `user` + `portable` durable memory in a task brief is intentionally reusable across projects. When it matches the task, use it as background even if it originated elsewhere; it is not a current-project fact. Expand it only when needed with `memorix_detail` and `typedRefs: ["durable:<id>"]`, stating the missing fact as `purpose`.
51
- - Do not store secrets, credentials, raw private transcripts, trivial commands, or routine file reads.
@@ -1,31 +0,0 @@
1
- ---
2
- name: memorix-mini-skills
3
- description: Use when durable project knowledge, gotchas, workflows, or repeated fixes should become reusable agent guidance instead of ordinary memory.
4
- ---
5
-
6
- # Memorix Mini-Skills
7
-
8
- Promote memories into mini-skills only when they are reusable instructions, not just historical notes.
9
-
10
- The standard setup uses the `lite` MCP profile. `memorix_skills` and `memorix_promote` are full-profile tools, so use the CLI fallback unless the current server was explicitly started with `MEMORIX_MODE=full` or `--mode full`. Do not probe hidden MCP tools repeatedly.
11
-
12
- ## Tool Router
13
-
14
- | Situation | Prefer | CLI fallback |
15
- |---|---|---|
16
- | Preview/discover existing project skills | `memorix_skills` action `list` | `memorix skills list` |
17
- | Generate skills from memory patterns | `memorix_skills` action `generate` | `memorix skills generate` |
18
- | Write generated skills to an agent | `memorix_skills` action `generate`, `write: true` | `memorix skills generate --write --target codex` |
19
- | Promote selected memories permanently | `memorix_promote` action `promote` | `memorix memory promote --ids 42,43` |
20
- | List/delete promoted mini-skills | `memorix_promote` | `memorix memory promote --action list|delete` |
21
-
22
- ## Promote When
23
-
24
- - The knowledge has been proven by repeated observations or a high-value fix.
25
- - It changes how future agents should act.
26
- - It is specific enough to be actionable and general enough to reuse.
27
-
28
- ## Do Not Promote
29
-
30
- - Command logs, probes, stale memories, one-off status notes, or unverified guesses.
31
- - Anything that should expire after the current task.
@@ -1,28 +0,0 @@
1
- ---
2
- name: memorix-orchestrate
3
- description: Use when a main agent needs Memorix to coordinate explicit subagent work through tasks, handoffs, messages, file locks, or the orchestrate CLI.
4
- ---
5
-
6
- # Memorix Orchestrate
7
-
8
- Use Memorix coordination for explicit subagent workflows with joined identities, tasks, handoffs, messages, file locks, and orchestrated workers.
9
-
10
- The standard setup uses the `lite` MCP profile. Coordination MCP tools are exposed only by `team` or `full`; use the CLI fallback for ordinary installations, or explicitly start the server with `--mode team`. Do not probe unavailable team tools in a loop.
11
-
12
- ## Tool Router
13
-
14
- | Situation | Prefer | CLI fallback |
15
- |---|---|---|
16
- | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` |
17
- | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` |
18
- | Create or inspect tasks | `team_task` | `memorix task create|list|claim|complete` |
19
- | Send or read coordination messages | `team_message` | `memorix message send|broadcast|inbox` |
20
- | Share structured handoff | `memorix_handoff` | `memorix handoff send` |
21
- | Avoid file conflicts | `team_file_lock` | `memorix lock lock|unlock|status` |
22
- | Poll joined coordination state | `memorix_poll` | `memorix poll` |
23
-
24
- ## Boundaries
25
-
26
- - For ordinary memory, do not join coordination state.
27
- - For production multi-agent execution, prefer `memorix orchestrate` so the main process owns planning, dispatch, retries, and verification gates.
28
- - In worker prompts, use the worker agent ID returned by session start or team join; never use the coordinator ID as the worker identity.
@@ -1,30 +0,0 @@
1
- ---
2
- name: memorix-reasoning
3
- description: Use when a technical decision, trade-off, rejected alternative, architecture rationale, or design risk should be recorded or recovered.
4
- ---
5
-
6
- # Memorix Reasoning
7
-
8
- Use reasoning memory for why a decision was made. Use ordinary memory for what happened.
9
-
10
- ## Tool Router
11
-
12
- | Situation | Prefer | CLI fallback |
13
- |---|---|---|
14
- | Store why a decision was made | `memorix_store_reasoning` | `memorix reasoning store --entity <name> --decision "<decision>" --rationale "<why>"` |
15
- | Find earlier rationale | `memorix_search_reasoning` | `memorix reasoning search --query "<topic>"` |
16
- | Need a stable evolving topic key | `memorix_suggest_topic_key` | `memorix memory suggest-topic-key --type decision --title "<title>"` |
17
- | Link rationale to commit evidence | `relatedCommits` on reasoning store | `memorix reasoning store ... --relatedCommits <sha>` |
18
-
19
- ## Use Reasoning When
20
-
21
- - The answer depends on alternatives considered, constraints, expected outcomes, or accepted risks.
22
- - A future agent may otherwise reopen the same debate.
23
- - The user chose a direction and the reason matters more than the implementation details.
24
- - A Git Memory entry says what changed, but not why it changed.
25
-
26
- ## Do Not Use Reasoning For
27
-
28
- - Simple progress notes.
29
- - Mechanical refactors with no decision.
30
- - Facts that belong in `memorix_store` as `how-it-works`, `what-changed`, or `problem-solution`.
@@ -1,25 +0,0 @@
1
- ---
2
- name: memorix-sessions
3
- description: Use when resuming work, preparing handoff context, binding an HTTP control-plane project, or deciding whether session_start is useful.
4
- ---
5
-
6
- # Memorix Sessions
7
-
8
- `memorix_session_start` is optional. Use it when session semantics help; do not make memory-only work heavier than needed.
9
-
10
- ## Tool Router
11
-
12
- | Situation | Prefer | CLI fallback |
13
- |---|---|---|
14
- | Resume a prior long-running task | `memorix_session_start` | `memorix session start --agent <name>` |
15
- | HTTP control plane needs project binding | `memorix_session_start` with `projectRoot` | `memorix session start --projectRoot <absolute-path>` |
16
- | Need recent handoff/session summaries | `memorix_session_context` | `memorix session context` |
17
- | End a real working session | `memorix_session_end` | `memorix session end --sessionId <id> --summary "<summary>"` |
18
- | Need explicit subagent coordination identity | `memorix_session_start` with `joinTeam: true` | `memorix session start --joinTeam --agentType <agent>` |
19
-
20
- ## Decision Rules
21
-
22
- - For normal memory search/store, do not require session start.
23
- - In HTTP mode, pass the absolute workspace path as `projectRoot` when available.
24
- - `projectRoot` is a detection anchor; Git identity is the final project identity.
25
- - Do not join coordination state unless the user is using tasks, messages, locks, handoff, or `memorix orchestrate`.
@@ -1,27 +0,0 @@
1
- ---
2
- name: memorix-troubleshooting
3
- description: Use when Memorix MCP, setup, project binding, HTTP control plane, hooks, skills, or agent integration is missing, stale, or failing.
4
- ---
5
-
6
- # Memorix Troubleshooting
7
-
8
- Prefer direct CLI diagnostics first. MCP is an integration surface, not the only way to operate Memorix.
9
-
10
- ## Diagnostic Router
11
-
12
- | Symptom | Check | CLI fallback |
13
- |---|---|---|
14
- | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` |
15
- | Unsure project is bound | project status | `memorix status` and `git status` |
16
- | HTTP MCP stale or unbound | background health and explicit session bind | `memorix background status`; then `memorix session start --projectRoot <path>` |
17
- | Hooks not firing | hook status | `memorix hooks status` |
18
- | Need to inspect generated files | preview | `memorix hooks preview --agent <agent>` |
19
- | Setup looks incomplete | reinstall host integration | `memorix setup --agent <agent>` |
20
- | Need dashboard/control plane | background service | `memorix background start` or `memorix serve-http --port 3211` |
21
-
22
- ## Mode Rules
23
-
24
- - Use stdio MCP (`memorix serve`) for normal host-launched MCP integration.
25
- - Use HTTP/background only for shared endpoint, dashboard, Docker, multiple clients, or foreground control-plane debugging.
26
- - On Windows, prefer absolute native paths for `projectRoot` and remember that visually similar junction paths may bind different session histories.
27
- - If MCP is unavailable but the CLI works, continue through CLI commands instead of blocking.