memorix 1.10.0 → 1.10.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 (44) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -0
  3. package/README.zh-CN.md +2 -0
  4. package/dist/cli/index.js +176 -46
  5. package/dist/index.js +160 -45
  6. package/dist/maintenance-runner.js +56 -2
  7. package/dist/media-audio-runner.js +56 -2
  8. package/dist/media-video-runner.js +56 -2
  9. package/dist/memcode-runtime/CHANGELOG.md +11 -0
  10. package/dist/sdk.js +159 -44
  11. package/dist/vector-backfill-runner.js +56 -2
  12. package/docs/1.2.0-EVALUATION-HARNESS.md +18 -0
  13. package/docs/CONFIGURATION.md +25 -0
  14. package/docs/DEVELOPMENT.md +4 -3
  15. package/docs/README.md +2 -2
  16. package/docs/ROADMAP-1.9.12-2.0.md +13 -6
  17. package/package.json +1 -1
  18. package/plugins/antigravity/memorix/plugin.json +1 -1
  19. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  20. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  21. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  22. package/plugins/copilot/memorix/plugin.json +1 -1
  23. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  24. package/plugins/hermes/memorix/plugin.yaml +1 -1
  25. package/plugins/omp/memorix/package.json +1 -1
  26. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  27. package/plugins/pi/memorix/package.json +1 -1
  28. package/server.json +2 -2
  29. package/src/cli/commands/init.ts +6 -2
  30. package/src/cli/tui/ConfigureView.tsx +2 -0
  31. package/src/codegraph/auto-context.ts +17 -0
  32. package/src/codegraph/context-pack.ts +15 -0
  33. package/src/compact/engine.ts +11 -0
  34. package/src/config/dotenv-loader.ts +1 -0
  35. package/src/config/resolved-config.ts +5 -2
  36. package/src/config/yaml-loader.ts +2 -2
  37. package/src/dashboard/server.ts +3 -0
  38. package/src/knowledge/context-assembly.ts +13 -0
  39. package/src/knowledge/context-receipt.ts +32 -0
  40. package/src/knowledge/workset.ts +8 -0
  41. package/src/llm/provider.ts +2 -1
  42. package/src/multimodal/image-loader.ts +2 -2
  43. package/src/search/derived-view-receipt.ts +22 -0
  44. package/src/store/orama-store.ts +62 -0
package/dist/sdk.js CHANGED
@@ -3870,7 +3870,8 @@ function getResolvedConfig(options = {}) {
3870
3870
  const isAtlasCloud = memoryLlmProvider === "atlascloud";
3871
3871
  const isRequesty = memoryLlmProvider === "requesty";
3872
3872
  const isApiRoute = memoryLlmProvider === "apiroute";
3873
- const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute;
3873
+ const isCheaperInference = memoryLlmProvider === "cheaperinference";
3874
+ const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute || isCheaperInference;
3874
3875
  const memoryLlmApiKey = first(
3875
3876
  process.env.MEMORIX_LLM_API_KEY,
3876
3877
  process.env.MEMORIX_API_KEY,
@@ -3878,7 +3879,7 @@ function getResolvedConfig(options = {}) {
3878
3879
  yaml.llm?.apiKey,
3879
3880
  legacy.llm?.apiKey,
3880
3881
  // Never borrow another provider's credentials for these gateway presets.
3881
- isAtlasCloud ? process.env.ATLASCLOUD_API_KEY : isRequesty ? process.env.REQUESTY_API_KEY : isApiRoute ? process.env.API_ROUTE_API_KEY : process.env.OPENAI_API_KEY,
3882
+ isAtlasCloud ? process.env.ATLASCLOUD_API_KEY : isRequesty ? process.env.REQUESTY_API_KEY : isApiRoute ? process.env.API_ROUTE_API_KEY : isCheaperInference ? process.env.CHEAPER_INFERENCE_API_KEY : process.env.OPENAI_API_KEY,
3882
3883
  usesPresetKeyOnly ? void 0 : process.env.ANTHROPIC_API_KEY,
3883
3884
  usesPresetKeyOnly ? void 0 : openRouterMemoryLlmApiKey
3884
3885
  );
@@ -4062,6 +4063,7 @@ function getEnvSourceNames() {
4062
4063
  "OPENROUTER_API_KEY",
4063
4064
  "REQUESTY_API_KEY",
4064
4065
  "API_ROUTE_API_KEY",
4066
+ "CHEAPER_INFERENCE_API_KEY",
4065
4067
  "ATLASCLOUD_API_KEY"
4066
4068
  ].filter((name) => process.env[name]);
4067
4069
  }
@@ -7056,6 +7058,7 @@ var init_provider2 = __esm({
7056
7058
  openrouter: { baseUrl: "https://openrouter.ai/api/v1", model: "openai/gpt-4.1-nano" },
7057
7059
  requesty: { baseUrl: "https://router.requesty.ai/v1", model: "openai/gpt-4.1-nano" },
7058
7060
  apiroute: { baseUrl: "https://global.api-route.com/v1", model: "deepseek-v4.1-flash" },
7061
+ cheaperinference: { baseUrl: "https://api.cheaperinference.com/v1", model: "gpt-5.4-mini" },
7059
7062
  atlascloud: { baseUrl: "https://api.atlascloud.ai/v1", model: "deepseek-ai/deepseek-v3.2" },
7060
7063
  custom: { baseUrl: "http://localhost:11434/v1", model: "llama3" }
7061
7064
  };
@@ -8676,6 +8679,7 @@ __export(orama_store_exports, {
8676
8679
  getLastSearchMode: () => getLastSearchMode,
8677
8680
  getObservationCount: () => getObservationCount,
8678
8681
  getObservationsByIds: () => getObservationsByIds,
8682
+ getSearchDerivedViews: () => getSearchDerivedViews,
8679
8683
  getTimeline: () => getTimeline,
8680
8684
  getVectorDimensions: () => getVectorDimensions,
8681
8685
  hasObservationVector: () => hasObservationVector,
@@ -8706,6 +8710,56 @@ function getLastSearchDiagnostics(projectId) {
8706
8710
  const diagnostics = lastSearchDiagnosticsByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY);
8707
8711
  return diagnostics ? { ...diagnostics } : void 0;
8708
8712
  }
8713
+ function getSearchDerivedViews() {
8714
+ const views = {};
8715
+ const store = getOptionalObservationStore();
8716
+ if (store) {
8717
+ try {
8718
+ const generation = store.getGeneration();
8719
+ if (store.hasLexicalIndex?.()) {
8720
+ views.fts = { generation, freshness: "current", rebuildStatus: "idle" };
8721
+ } else {
8722
+ views.fts = {
8723
+ generation,
8724
+ freshness: "unknown",
8725
+ rebuildStatus: "unavailable",
8726
+ failureReason: store.getBackendReason?.() ?? "persistent lexical index unavailable"
8727
+ };
8728
+ }
8729
+ } catch (error) {
8730
+ views.fts = {
8731
+ freshness: "unknown",
8732
+ rebuildStatus: "failed",
8733
+ failureReason: error instanceof Error ? error.message.slice(0, 240) : String(error).slice(0, 240)
8734
+ };
8735
+ }
8736
+ } else {
8737
+ views.fts = {
8738
+ freshness: "unknown",
8739
+ rebuildStatus: "unavailable",
8740
+ failureReason: "observation store is not initialized"
8741
+ };
8742
+ }
8743
+ views.orama = db ? { generation: dbGeneration, freshness: "current", rebuildStatus: "idle" } : {
8744
+ generation: dbGeneration,
8745
+ freshness: "unknown",
8746
+ rebuildStatus: "unavailable",
8747
+ failureReason: "Orama index is not initialized"
8748
+ };
8749
+ const configuredEmbeddingMode = process.env.MEMORIX_EMBEDDING?.trim().toLowerCase();
8750
+ if (configuredEmbeddingMode === "off") {
8751
+ views.embedding = { freshness: "current", rebuildStatus: "disabled" };
8752
+ } else if (embeddingEnabled) {
8753
+ views.embedding = { freshness: "current", rebuildStatus: "idle" };
8754
+ } else {
8755
+ views.embedding = {
8756
+ freshness: "unknown",
8757
+ rebuildStatus: "unavailable",
8758
+ failureReason: "embedding provider is not initialized"
8759
+ };
8760
+ }
8761
+ return views;
8762
+ }
8709
8763
  function rememberSearchDiagnostics(key, value) {
8710
8764
  if (!lastSearchDiagnosticsByProject.has(key) && lastSearchDiagnosticsByProject.size >= MAX_SEARCH_MODE_KEYS) {
8711
8765
  const oldest = lastSearchDiagnosticsByProject.keys().next().value;
@@ -157750,6 +157804,10 @@ async function buildTaskWorkset(input) {
157750
157804
  budget: { maxTokens }
157751
157805
  });
157752
157806
  const omittedReceipt = receiptOmissions(rendered.omittedItems, base.hiddenCautionMemoryCount);
157807
+ const derivedViews = {
157808
+ ...getSearchDerivedViews(),
157809
+ ...input.retrieval?.derivedViews ?? {}
157810
+ };
157753
157811
  const retrieval = {
157754
157812
  mode: input.retrieval?.mode ?? (input.semanticCode ? "hybrid" : "unknown"),
157755
157813
  ...input.retrieval?.codeProvider || input.providerQuality?.selected ? { codeProvider: input.retrieval?.codeProvider ?? input.providerQuality?.selected } : {},
@@ -157757,7 +157815,8 @@ async function buildTaskWorkset(input) {
157757
157815
  ...input.retrieval?.fallbackReason ? { fallbackReason: input.retrieval.fallbackReason } : {},
157758
157816
  candidateCount: governed.plan.decisions.length,
157759
157817
  selectedCount: rendered.selected.length,
157760
- omittedCount: omittedReceipt.reduce((total, omission) => total + omission.count, 0)
157818
+ omittedCount: omittedReceipt.reduce((total, omission) => total + omission.count, 0),
157819
+ derivedViews
157761
157820
  };
157762
157821
  const receipt = {
157763
157822
  version: "1.3",
@@ -157816,6 +157875,7 @@ var init_workset = __esm({
157816
157875
  init_workflows2();
157817
157876
  init_long_term();
157818
157877
  init_governor();
157878
+ init_orama_store();
157819
157879
  CONTINUATION_DETAIL_TOKEN_BUDGET = 20;
157820
157880
  }
157821
157881
  });
@@ -159115,6 +159175,60 @@ var init_project_context = __esm({
159115
159175
  }
159116
159176
  });
159117
159177
 
159178
+ // src/knowledge/context-receipt.ts
159179
+ var context_receipt_exports = {};
159180
+ __export(context_receipt_exports, {
159181
+ buildBoundedContextReceipt: () => buildBoundedContextReceipt,
159182
+ buildCodeGraphDerivedView: () => buildCodeGraphDerivedView
159183
+ });
159184
+ function buildCodeGraphDerivedView(input) {
159185
+ const provider2 = input.providerQuality;
159186
+ const snapshot = input.snapshot;
159187
+ const externalFailure = provider2?.external.state !== void 0 && !["ready", "disabled", "not-detected"].includes(provider2.external.state);
159188
+ if (snapshot?.id) {
159189
+ return {
159190
+ ...snapshot.sourceEpoch !== void 0 ? { generation: snapshot.sourceEpoch } : {},
159191
+ freshness: snapshot.incomplete ? "stale" : "current",
159192
+ rebuildStatus: snapshot.incomplete ? "failed" : "idle",
159193
+ ...snapshot.incomplete ? { failureReason: "latest CodeGraph snapshot is incomplete" } : externalFailure && provider2?.external.reason ? { failureReason: provider2.external.reason.slice(0, 240) } : {}
159194
+ };
159195
+ }
159196
+ return {
159197
+ freshness: "unknown",
159198
+ rebuildStatus: externalFailure ? "failed" : "unavailable",
159199
+ ...provider2?.external.reason ? { failureReason: provider2.external.reason.slice(0, 240) } : { failureReason: "CodeGraph snapshot is not initialized" }
159200
+ };
159201
+ }
159202
+ function buildBoundedContextReceipt(input) {
159203
+ const provider2 = input.providerQuality ?? input.workset.provenance.codeProvider;
159204
+ return {
159205
+ schemaVersion: "1",
159206
+ task: input.workset.task,
159207
+ brief: input.workset.prompt,
159208
+ receipt: input.workset.receipt,
159209
+ code: {
159210
+ selected: provider2?.selected ?? "lite",
159211
+ quality: provider2?.selectedQuality ?? "heuristic",
159212
+ externalState: provider2?.external.state ?? "not-detected",
159213
+ ...input.workset.provenance.snapshotId ? { snapshotId: input.workset.provenance.snapshotId } : {}
159214
+ },
159215
+ ...input.workset.agentLoadout ? { loadout: input.workset.agentLoadout } : {},
159216
+ ...input.workset.continuity ? {
159217
+ continuity: {
159218
+ taskId: input.workset.continuity.taskId,
159219
+ status: input.workset.continuity.status,
159220
+ outcome: input.workset.continuity.outcome
159221
+ }
159222
+ } : {}
159223
+ };
159224
+ }
159225
+ var init_context_receipt = __esm({
159226
+ "src/knowledge/context-receipt.ts"() {
159227
+ "use strict";
159228
+ init_esm_shims();
159229
+ }
159230
+ });
159231
+
159118
159232
  // src/store/compaction-checkpoint-store.ts
159119
159233
  var compaction_checkpoint_store_exports = {};
159120
159234
  __export(compaction_checkpoint_store_exports, {
@@ -160004,7 +160118,19 @@ async function buildAutoProjectContext(input) {
160004
160118
  retrieval: {
160005
160119
  mode: semanticOutline ? "hybrid" : "lexical",
160006
160120
  codeProvider: providerQuality2.selected,
160007
- ...externalCaution ? { fallbackReason: externalCaution } : {}
160121
+ ...externalCaution ? { fallbackReason: externalCaution } : {},
160122
+ derivedViews: {
160123
+ graph: buildCodeGraphDerivedView({
160124
+ providerQuality: providerQuality2,
160125
+ ...latestSnapshot ? {
160126
+ snapshot: {
160127
+ id: latestSnapshot.id,
160128
+ sourceEpoch: latestSnapshot.sourceEpoch,
160129
+ incomplete: latestSnapshot.completeness.skippedOversizedFiles > 0 || (latestSnapshot.completeness.unreadableFiles ?? 0) > 0 || latestSnapshot.completeness.removalScanDeferred
160130
+ }
160131
+ } : {}
160132
+ })
160133
+ }
160008
160134
  },
160009
160135
  currentFacts: worksetFactLines(currentFacts),
160010
160136
  ...continuation ? { continuation } : {},
@@ -160334,47 +160460,13 @@ var init_auto_context = __esm({
160334
160460
  init_long_term();
160335
160461
  init_visibility();
160336
160462
  init_session_store();
160463
+ init_context_receipt();
160337
160464
  init_task_lens();
160338
160465
  DEFAULT_MAX_AGE_MS = 10 * 60 * 1e3;
160339
160466
  COMPACT_CHECKPOINT_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
160340
160467
  }
160341
160468
  });
160342
160469
 
160343
- // src/knowledge/context-receipt.ts
160344
- var context_receipt_exports = {};
160345
- __export(context_receipt_exports, {
160346
- buildBoundedContextReceipt: () => buildBoundedContextReceipt
160347
- });
160348
- function buildBoundedContextReceipt(input) {
160349
- const provider2 = input.providerQuality ?? input.workset.provenance.codeProvider;
160350
- return {
160351
- schemaVersion: "1",
160352
- task: input.workset.task,
160353
- brief: input.workset.prompt,
160354
- receipt: input.workset.receipt,
160355
- code: {
160356
- selected: provider2?.selected ?? "lite",
160357
- quality: provider2?.selectedQuality ?? "heuristic",
160358
- externalState: provider2?.external.state ?? "not-detected",
160359
- ...input.workset.provenance.snapshotId ? { snapshotId: input.workset.provenance.snapshotId } : {}
160360
- },
160361
- ...input.workset.agentLoadout ? { loadout: input.workset.agentLoadout } : {},
160362
- ...input.workset.continuity ? {
160363
- continuity: {
160364
- taskId: input.workset.continuity.taskId,
160365
- status: input.workset.continuity.status,
160366
- outcome: input.workset.continuity.outcome
160367
- }
160368
- } : {}
160369
- };
160370
- }
160371
- var init_context_receipt = __esm({
160372
- "src/knowledge/context-receipt.ts"() {
160373
- "use strict";
160374
- init_esm_shims();
160375
- }
160376
- });
160377
-
160378
160470
  // src/codegraph/context-pack.ts
160379
160471
  var context_pack_exports = {};
160380
160472
  __export(context_pack_exports, {
@@ -160553,7 +160645,19 @@ async function attachTaskWorkset(input) {
160553
160645
  ...input.providerQuality ? { providerQuality: input.providerQuality } : {},
160554
160646
  retrieval: {
160555
160647
  mode: semanticCode ? "hybrid" : "unknown",
160556
- ...input.providerQuality?.selected ? { codeProvider: input.providerQuality.selected } : {}
160648
+ ...input.providerQuality?.selected ? { codeProvider: input.providerQuality.selected } : {},
160649
+ derivedViews: {
160650
+ graph: buildCodeGraphDerivedView({
160651
+ providerQuality: input.providerQuality,
160652
+ ...input.snapshot ? {
160653
+ snapshot: {
160654
+ id: input.snapshot.id,
160655
+ sourceEpoch: input.snapshot.sourceEpoch,
160656
+ incomplete: input.snapshot.incomplete
160657
+ }
160658
+ } : {}
160659
+ })
160660
+ }
160557
160661
  },
160558
160662
  reliableMemory: input.pack.memories.filter((memory) => memory.status === "current").map((memory) => ({
160559
160663
  id: memory.id,
@@ -160625,6 +160729,7 @@ var init_context_pack = __esm({
160625
160729
  "use strict";
160626
160730
  init_esm_shims();
160627
160731
  init_freshness2();
160732
+ init_context_receipt();
160628
160733
  init_workset();
160629
160734
  init_exclude3();
160630
160735
  init_semantic_context();
@@ -163801,7 +163906,8 @@ async function handleApi(req, res, dataDir, projectId, projectName, baseDir, pro
163801
163906
  "ANTHROPIC_API_KEY",
163802
163907
  ...resolved.memory.llm.provider === "openrouter" || resolved.memory.llm.baseUrl?.includes("openrouter.ai") ? ["OPENROUTER_API_KEY"] : [],
163803
163908
  ...resolved.memory.llm.provider === "requesty" ? ["REQUESTY_API_KEY"] : [],
163804
- ...resolved.memory.llm.provider === "apiroute" ? ["API_ROUTE_API_KEY"] : []
163909
+ ...resolved.memory.llm.provider === "apiroute" ? ["API_ROUTE_API_KEY"] : [],
163910
+ ...resolved.memory.llm.provider === "cheaperinference" ? ["CHEAPER_INFERENCE_API_KEY"] : []
163805
163911
  ];
163806
163912
  if (llmKey) {
163807
163913
  const src = resolveDashboardKeySource({ value: llmKey, envKeys: memoryKeyEnv, configSource });
@@ -165387,7 +165493,7 @@ async function analyzeImage(input) {
165387
165493
  const config = getLLMConfig();
165388
165494
  if (!OPENAI_COMPATIBLE_PROVIDERS.has(config.provider)) {
165389
165495
  throw new Error(
165390
- `Image analysis requires an OpenAI-compatible provider (openai, openrouter, requesty, apiroute, or custom). Current provider "${config.provider}" uses a different API shape. Set MEMORIX_LLM_PROVIDER=openai or configure an OpenAI-compatible base URL.`
165496
+ `Image analysis requires an OpenAI-compatible provider (openai, openrouter, requesty, apiroute, cheaperinference, or custom). Current provider "${config.provider}" uses a different API shape. Set MEMORIX_LLM_PROVIDER=openai or configure an OpenAI-compatible base URL.`
165391
165497
  );
165392
165498
  }
165393
165499
  const bytes = decodeBase64ImagePayload(input.base64, MAX_VISION_IMAGE_BYTES);
@@ -165426,7 +165532,7 @@ var init_image_loader = __esm({
165426
165532
  init_provider2();
165427
165533
  init_secret_filter();
165428
165534
  init_image_payload();
165429
- OPENAI_COMPATIBLE_PROVIDERS = /* @__PURE__ */ new Set(["openai", "openrouter", "requesty", "apiroute", "custom"]);
165535
+ OPENAI_COMPATIBLE_PROVIDERS = /* @__PURE__ */ new Set(["openai", "openrouter", "requesty", "apiroute", "cheaperinference", "custom"]);
165430
165536
  MAX_VISION_PROMPT_CHARS = 12e3;
165431
165537
  MAX_VISION_DESCRIPTION_CHARS = 12e3;
165432
165538
  MAX_VISION_LABELS = 50;
@@ -168118,6 +168224,14 @@ This project does have stored Memorix memories, but none matched the current que
168118
168224
  }
168119
168225
  const totalTokens = countTextTokens(formatted);
168120
168226
  const diagnostics = getLastSearchDiagnostics(options.projectId);
168227
+ const derivedViews = getSearchDerivedViews();
168228
+ if (diagnostics?.fallbackUsed && diagnostics.fallbackReason) {
168229
+ derivedViews.embedding = {
168230
+ freshness: "stale",
168231
+ rebuildStatus: "failed",
168232
+ failureReason: diagnostics.fallbackReason
168233
+ };
168234
+ }
168121
168235
  return {
168122
168236
  entries,
168123
168237
  formatted,
@@ -168132,6 +168246,7 @@ This project does have stored Memorix memories, but none matched the current que
168132
168246
  omittedByTokenBudget: diagnostics?.omittedByTokenBudget ?? 0,
168133
168247
  fallbackUsed: diagnostics?.fallbackUsed ?? false,
168134
168248
  ...diagnostics?.fallbackReason ? { fallbackReason: diagnostics.fallbackReason } : {},
168249
+ derivedViews,
168135
168250
  tokenCount: totalTokens,
168136
168251
  elapsedMs: Math.max(0, Date.now() - startedAt)
168137
168252
  }
@@ -171435,7 +171550,7 @@ var MCP_SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo";
171435
171550
  function getMcpServerInfo() {
171436
171551
  return {
171437
171552
  name: "memorix",
171438
- version: true ? "1.10.0" : "1.0.1"
171553
+ version: true ? "1.10.1" : "1.0.1"
171439
171554
  };
171440
171555
  }
171441
171556
  function createMcpDiscoverResult(capabilities, serverInfo) {
@@ -2407,7 +2407,8 @@ function getResolvedConfig(options = {}) {
2407
2407
  const isAtlasCloud = memoryLlmProvider === "atlascloud";
2408
2408
  const isRequesty = memoryLlmProvider === "requesty";
2409
2409
  const isApiRoute = memoryLlmProvider === "apiroute";
2410
- const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute;
2410
+ const isCheaperInference = memoryLlmProvider === "cheaperinference";
2411
+ const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute || isCheaperInference;
2411
2412
  const memoryLlmApiKey = first(
2412
2413
  process.env.MEMORIX_LLM_API_KEY,
2413
2414
  process.env.MEMORIX_API_KEY,
@@ -2415,7 +2416,7 @@ function getResolvedConfig(options = {}) {
2415
2416
  yaml.llm?.apiKey,
2416
2417
  legacy.llm?.apiKey,
2417
2418
  // Never borrow another provider's credentials for these gateway presets.
2418
- isAtlasCloud ? process.env.ATLASCLOUD_API_KEY : isRequesty ? process.env.REQUESTY_API_KEY : isApiRoute ? process.env.API_ROUTE_API_KEY : process.env.OPENAI_API_KEY,
2419
+ isAtlasCloud ? process.env.ATLASCLOUD_API_KEY : isRequesty ? process.env.REQUESTY_API_KEY : isApiRoute ? process.env.API_ROUTE_API_KEY : isCheaperInference ? process.env.CHEAPER_INFERENCE_API_KEY : process.env.OPENAI_API_KEY,
2419
2420
  usesPresetKeyOnly ? void 0 : process.env.ANTHROPIC_API_KEY,
2420
2421
  usesPresetKeyOnly ? void 0 : openRouterMemoryLlmApiKey
2421
2422
  );
@@ -2599,6 +2600,7 @@ function getEnvSourceNames() {
2599
2600
  "OPENROUTER_API_KEY",
2600
2601
  "REQUESTY_API_KEY",
2601
2602
  "API_ROUTE_API_KEY",
2603
+ "CHEAPER_INFERENCE_API_KEY",
2602
2604
  "ATLASCLOUD_API_KEY"
2603
2605
  ].filter((name) => process.env[name]);
2604
2606
  }
@@ -5593,6 +5595,7 @@ var init_provider2 = __esm({
5593
5595
  openrouter: { baseUrl: "https://openrouter.ai/api/v1", model: "openai/gpt-4.1-nano" },
5594
5596
  requesty: { baseUrl: "https://router.requesty.ai/v1", model: "openai/gpt-4.1-nano" },
5595
5597
  apiroute: { baseUrl: "https://global.api-route.com/v1", model: "deepseek-v4.1-flash" },
5598
+ cheaperinference: { baseUrl: "https://api.cheaperinference.com/v1", model: "gpt-5.4-mini" },
5596
5599
  atlascloud: { baseUrl: "https://api.atlascloud.ai/v1", model: "deepseek-ai/deepseek-v3.2" },
5597
5600
  custom: { baseUrl: "http://localhost:11434/v1", model: "llama3" }
5598
5601
  };
@@ -7155,6 +7158,7 @@ __export(orama_store_exports, {
7155
7158
  getLastSearchMode: () => getLastSearchMode,
7156
7159
  getObservationCount: () => getObservationCount,
7157
7160
  getObservationsByIds: () => getObservationsByIds,
7161
+ getSearchDerivedViews: () => getSearchDerivedViews,
7158
7162
  getTimeline: () => getTimeline,
7159
7163
  getVectorDimensions: () => getVectorDimensions,
7160
7164
  hasObservationVector: () => hasObservationVector,
@@ -7185,6 +7189,56 @@ function getLastSearchDiagnostics(projectId) {
7185
7189
  const diagnostics = lastSearchDiagnosticsByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY);
7186
7190
  return diagnostics ? { ...diagnostics } : void 0;
7187
7191
  }
7192
+ function getSearchDerivedViews() {
7193
+ const views = {};
7194
+ const store = getOptionalObservationStore();
7195
+ if (store) {
7196
+ try {
7197
+ const generation = store.getGeneration();
7198
+ if (store.hasLexicalIndex?.()) {
7199
+ views.fts = { generation, freshness: "current", rebuildStatus: "idle" };
7200
+ } else {
7201
+ views.fts = {
7202
+ generation,
7203
+ freshness: "unknown",
7204
+ rebuildStatus: "unavailable",
7205
+ failureReason: store.getBackendReason?.() ?? "persistent lexical index unavailable"
7206
+ };
7207
+ }
7208
+ } catch (error) {
7209
+ views.fts = {
7210
+ freshness: "unknown",
7211
+ rebuildStatus: "failed",
7212
+ failureReason: error instanceof Error ? error.message.slice(0, 240) : String(error).slice(0, 240)
7213
+ };
7214
+ }
7215
+ } else {
7216
+ views.fts = {
7217
+ freshness: "unknown",
7218
+ rebuildStatus: "unavailable",
7219
+ failureReason: "observation store is not initialized"
7220
+ };
7221
+ }
7222
+ views.orama = db ? { generation: dbGeneration, freshness: "current", rebuildStatus: "idle" } : {
7223
+ generation: dbGeneration,
7224
+ freshness: "unknown",
7225
+ rebuildStatus: "unavailable",
7226
+ failureReason: "Orama index is not initialized"
7227
+ };
7228
+ const configuredEmbeddingMode = process.env.MEMORIX_EMBEDDING?.trim().toLowerCase();
7229
+ if (configuredEmbeddingMode === "off") {
7230
+ views.embedding = { freshness: "current", rebuildStatus: "disabled" };
7231
+ } else if (embeddingEnabled) {
7232
+ views.embedding = { freshness: "current", rebuildStatus: "idle" };
7233
+ } else {
7234
+ views.embedding = {
7235
+ freshness: "unknown",
7236
+ rebuildStatus: "unavailable",
7237
+ failureReason: "embedding provider is not initialized"
7238
+ };
7239
+ }
7240
+ return views;
7241
+ }
7188
7242
  function rememberSearchDiagnostics(key, value) {
7189
7243
  if (!lastSearchDiagnosticsByProject.has(key) && lastSearchDiagnosticsByProject.size >= MAX_SEARCH_MODE_KEYS) {
7190
7244
  const oldest = lastSearchDiagnosticsByProject.keys().next().value;
@@ -133,7 +133,25 @@ engine, MCP `memorix_search`, and CLI `memory search --json`:
133
133
  - `mode`, `resultCount`, `selectedCount`, and `tokenCount`;
134
134
  - `candidateCount`, `omittedCount`, and `omittedByTokenBudget`;
135
135
  - `fallbackUsed` and an optional bounded `fallbackReason`;
136
+ - `derivedViews` for FTS, Orama, embedding, and CodeGraph generation,
137
+ freshness, rebuild status, and bounded failure reason;
136
138
  - request-level `elapsedMs`.
137
139
 
138
140
  The receipt remains metadata-only: query text, raw memory narratives, and local
139
141
  paths are not added to it.
142
+
143
+ ### Reproducible 1.9.11 to 1.10 Comparison
144
+
145
+ The same `scripts/benchmark-retrieval.mjs --records 1000 --runs 20` command was
146
+ run from the `v1.9.11` tag and the current 1.10 main line on Windows Node
147
+ `v22.22.3`, with embeddings and LLM disabled:
148
+
149
+ | Version | Seed/index | Specific p95 | Broad p95 |
150
+ | --- | ---: | ---: | ---: |
151
+ | 1.9.11 | 1,221.509ms | 9.283ms | 12.301ms |
152
+ | 1.10 main | 1,245.802ms | 8.925ms | 12.298ms |
153
+
154
+ The benchmark is a hot in-process SDK lexical measurement, not a cross-platform
155
+ SLO. The specific path improved by about 3.9% in this run and the broad path was
156
+ effectively unchanged; the result is retained as a baseline rather than a claim
157
+ of statistically significant performance improvement.
@@ -219,6 +219,31 @@ keys. Setting the key alone does not enable paid background memory processing.
219
219
  Embeddings and memcode's model registry are unchanged. Image analysis requires
220
220
  explicitly selecting a vision-capable model; the default is for text memory.
221
221
 
222
+ ### Cheaper Inference memory preset
223
+
224
+ [Cheaper Inference](https://cheaperinference.com) is available in `memorix init`
225
+ and the configuration TUI as an optional memory LLM preset:
226
+
227
+ ```toml
228
+ [memory.llm]
229
+ provider = "cheaperinference"
230
+ model = "gpt-5.4-mini"
231
+ ```
232
+
233
+ The preset uses `https://api.cheaperinference.com/v1` and the existing
234
+ OpenAI-compatible chat completion transport. Set `CHEAPER_INFERENCE_API_KEY` or
235
+ `MEMORIX_LLM_API_KEY`, or store `api_key` in your private global config. Keep
236
+ credentials out of project TOML. Explicit `model` and `base_url` overrides
237
+ still apply; use IDs from the endpoint's `/v1/models` catalog without adding
238
+ an extra vendor prefix.
239
+
240
+ `CHEAPER_INFERENCE_API_KEY` is used only when this memory preset is selected,
241
+ and the preset does not borrow OpenAI, Anthropic, OpenRouter, Requesty, API
242
+ Route, or Atlas Cloud keys. Setting the key alone does not enable paid
243
+ background memory processing. Embeddings and memcode's model registry are
244
+ unchanged. Image analysis requires explicitly selecting a vision-capable model;
245
+ the default is for text memory.
246
+
222
247
  ### OrcaRouter custom endpoint
223
248
 
224
249
  OrcaRouter works through the generic OpenAI-compatible gateway path. Keep the
@@ -13,9 +13,10 @@ Memorix is a TypeScript project built around:
13
13
 
14
14
  ## Current Development Baseline
15
15
 
16
- The next release line is **1.10.0** and package metadata is kept synchronized
17
- with the root package and MCP Registry manifest. Until the release tag and
18
- published artifacts exist, `1.9.12` remains the latest published baseline.
16
+ The current published release line is **1.10.0** and package metadata is kept
17
+ synchronized with the root package and MCP Registry manifest. The `1.10.1`
18
+ hardening candidate contains the derived-view receipt and Cheaper Inference
19
+ increments; the next larger feature phase follows the 1.11 relay-preview plan.
19
20
 
20
21
  Contributors should assume the following areas are part of the current release line:
21
22
 
package/docs/README.md CHANGED
@@ -127,8 +127,8 @@ Historical/deep-reference documents may describe older designs. If they conflict
127
127
 
128
128
  ## Current Product Line
129
129
 
130
- The latest published product line is **1.9.12**; the **1.10.0** release
131
- candidate adds the measured trustworthy-context and retrieval-receipt contract.
130
+ The latest published product line is **1.10.0**; `1.10.1` is the hardening
131
+ candidate for derived-view receipts and the optional Cheaper Inference preset.
132
132
  Multi-device store sync is opt-in and keeps local SQLite canonical; existing
133
133
  users do not upload anything until they configure a relay provider explicitly.
134
134
  The authoritative acceptance contract for the current implementation is
@@ -47,13 +47,13 @@ Memorix 已经超过“给 coding agent 加一个记忆工具”的阶段。当
47
47
 
48
48
  ### 1.1 当前事实
49
49
 
50
- 当前发布基线是 `v1.9.12`。1.9.12 已经完成 CJK 搜索、搜索回退、大库 alias
51
- 迁移、Node 26 Pi hooks、Qwen hooks、API Route provider、session label、发布
52
- provenance 收紧和后台更新脚本隔离,并通过了跨平台 CI、全量测试和 MCP smoke。
50
+ 当前发布基线是 `v1.10.0`。1.9.12 的 CJK 搜索、搜索回退、大库 alias 迁移、
51
+ Node 26 Pi hooks、Qwen hooks、API Route provider、session label、发布
52
+ provenance 收紧和后台更新脚本隔离,已经与 1.10 的可信上下文、检索收据、
53
+ 真实矩阵评估和容量门禁一起发布。
53
54
 
54
- `v1.9.12` 已从提交 `d5d8b5f` 发布到 npm、官方 MCP Registry 和 GitHub
55
- Release。其后 `main` 已进入 1.10 additive contract-convergence iteration,
56
- 当前工作区不再是 1.9.12 release preparation。
55
+ `v1.10.0` 已从提交 `f2b7555` 发布到 npm、官方 MCP Registry 和 GitHub
56
+ Release。后续 `main` 进入 1.11 的本地优先 relay 与协作预览准备阶段。
57
57
 
58
58
  1.9.12 已完成:
59
59
 
@@ -216,6 +216,9 @@ search mode、candidate/selected/omitted counts、token budget omissions、fallb
216
216
  reason、token count 和 elapsed time;查询文本与原始 memory 内容不进入 receipt。
217
217
  底层 Orama/SQLite search 现在保留 request-level diagnostics,使这些字段来自
218
218
  实际检索路径而不是调用方猜测。
219
+ Receipt 还通过 `derivedViews` 统一记录 FTS、Orama、embedding、CodeGraph 的
220
+ generation、freshness、rebuild status 和 bounded failure reason;这项补强已在
221
+ main 验证,但属于 1.10.0 之后的 Unreleased 增量。
219
222
 
220
223
  1.10 的真实任务矩阵已执行完成:20/20 cases passed。Windows Node 22.22.3、
221
224
  embeddings/LLM disabled 的基线为 memory hit precision/recall 1.00/1.00、
@@ -225,6 +228,10 @@ stale/conflict rejection 1.00/1.00、abstention precision 0.95,矩阵 p50/p95
225
228
  518.983ms/6ms,100k 为 1,099.809ms/7ms,两个 gate 都没有 failed checks。
226
229
  可复现入口为 `npm run gate:context-runtime`(20-case + 40k)以及
227
230
  `node scripts/large-store-gate.mjs --records 100000`(100k 容量门禁)。
231
+ 同一 `scripts/benchmark-retrieval.mjs --records 1000 --runs 20` 在 v1.9.11
232
+ 和当前 1.10 main 上复跑:specific p95 为 9.283ms -> 8.925ms,broad p95
233
+ 为 12.301ms -> 12.298ms;该结果证明热 lexical 路径没有回归,但不宣称
234
+ 统计显著的性能提升。
228
235
 
229
236
  ### 3.1 版本定位
230
237
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memorix",
3
3
  "mcpName": "io.github.AVIDS2/memorix",
4
- "version": "1.10.0",
4
+ "version": "1.10.1",
5
5
  "description": "Local-first shared memory layer for AI coding agents across MCP clients, Git history, reasoning context, and project sessions.",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0"
3
+ "version": "1.10.1"
4
4
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "memorix",
4
- "version": "1.10.0",
4
+ "version": "1.10.1",
5
5
  "description": "Shared workspace memory for Claude Code and other AI coding agents.",
6
6
  "author": {
7
7
  "name": "AVIDS2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Local-first project memory for CodeBuddy Code and other coding agents.",
5
5
  "author": {
6
6
  "name": "AVIDS2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Shared workspace memory for Codex and other AI coding agents.",
5
5
  "author": {
6
6
  "name": "AVIDS2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Shared local workspace memory for GitHub Copilot CLI and other AI coding agents.",
5
5
  "author": {
6
6
  "name": "AVIDS2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "mcpServers": {
5
5
  "memorix": {
6
6
  "command": "memorix",
@@ -1,5 +1,5 @@
1
1
  name: memorix
2
- version: "1.10.0"
2
+ version: "1.10.1"
3
3
  description: Shared workspace memory bridge for Hermes Agent.
4
4
  author: AVIDS2
5
5
  license: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix-omp-package",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Memorix shared workspace memory package for Oh-my-Pi.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Shared workspace memory for OpenClaw and other AI coding agents.",
5
5
  "author": {
6
6
  "name": "AVIDS2",