memorix 1.9.12 → 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 (59) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/README.md +2 -0
  3. package/README.zh-CN.md +2 -0
  4. package/dist/cli/index.js +720 -142
  5. package/dist/index.d.ts +46 -0
  6. package/dist/index.js +426 -67
  7. package/dist/maintenance-runner.js +199 -5
  8. package/dist/media-audio-runner.js +199 -5
  9. package/dist/media-video-runner.js +199 -5
  10. package/dist/memcode/index.js +124 -8
  11. package/dist/memcode-runtime/CHANGELOG.md +31 -1
  12. package/dist/sdk.js +425 -66
  13. package/dist/vector-backfill-runner.js +199 -5
  14. package/docs/1.2.0-EVALUATION-HARNESS.md +106 -0
  15. package/docs/1.3-MEMORY-ARCHITECTURE.md +31 -0
  16. package/docs/API_REFERENCE.md +19 -0
  17. package/docs/CONFIGURATION.md +25 -0
  18. package/docs/DEVELOPMENT.md +17 -3
  19. package/docs/INTEGRATIONS.md +25 -0
  20. package/docs/PERFORMANCE.md +21 -6
  21. package/docs/README.md +4 -4
  22. package/docs/ROADMAP-1.9.12-2.0.md +99 -7
  23. package/package.json +3 -1
  24. package/plugins/antigravity/memorix/plugin.json +1 -1
  25. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  26. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  27. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  28. package/plugins/copilot/memorix/plugin.json +1 -1
  29. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  30. package/plugins/hermes/memorix/plugin.yaml +1 -1
  31. package/plugins/omp/memorix/package.json +1 -1
  32. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  33. package/plugins/pi/memorix/package.json +1 -1
  34. package/server.json +2 -2
  35. package/src/cli/commands/agent-integrations.ts +164 -7
  36. package/src/cli/commands/init.ts +6 -2
  37. package/src/cli/commands/memory.ts +1 -1
  38. package/src/cli/commands/serve-http.ts +30 -1
  39. package/src/cli/commands/setup.ts +5 -21
  40. package/src/cli/tui/ConfigureView.tsx +2 -0
  41. package/src/codegraph/auto-context.ts +22 -0
  42. package/src/codegraph/context-pack.ts +19 -0
  43. package/src/compact/engine.ts +54 -2
  44. package/src/config/dotenv-loader.ts +1 -0
  45. package/src/config/resolved-config.ts +5 -2
  46. package/src/config/yaml-loader.ts +2 -2
  47. package/src/dashboard/server.ts +3 -0
  48. package/src/evaluation/context-task-matrix.ts +247 -0
  49. package/src/evaluation/context-task-runner.ts +175 -0
  50. package/src/integrations/registry.ts +191 -4
  51. package/src/knowledge/context-assembly.ts +46 -2
  52. package/src/knowledge/context-receipt.ts +32 -0
  53. package/src/knowledge/workset.ts +43 -3
  54. package/src/llm/provider.ts +2 -1
  55. package/src/multimodal/image-loader.ts +2 -2
  56. package/src/search/derived-view-receipt.ts +22 -0
  57. package/src/server/request-context.ts +96 -0
  58. package/src/server.ts +16 -4
  59. package/src/store/orama-store.ts +116 -0
@@ -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
  };
@@ -7151,9 +7154,11 @@ __export(orama_store_exports, {
7151
7154
  getActiveSemanticIndexProfile: () => getActiveSemanticIndexProfile,
7152
7155
  getDb: () => getDb,
7153
7156
  getDeferredCachedVectorHydration: () => getDeferredCachedVectorHydration,
7157
+ getLastSearchDiagnostics: () => getLastSearchDiagnostics,
7154
7158
  getLastSearchMode: () => getLastSearchMode,
7155
7159
  getObservationCount: () => getObservationCount,
7156
7160
  getObservationsByIds: () => getObservationsByIds,
7161
+ getSearchDerivedViews: () => getSearchDerivedViews,
7157
7162
  getTimeline: () => getTimeline,
7158
7163
  getVectorDimensions: () => getVectorDimensions,
7159
7164
  hasObservationVector: () => hasObservationVector,
@@ -7180,6 +7185,68 @@ function rememberSearchMode(key, value) {
7180
7185
  function getLastSearchMode(projectId) {
7181
7186
  return lastSearchModeByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY) ?? "fulltext";
7182
7187
  }
7188
+ function getLastSearchDiagnostics(projectId) {
7189
+ const diagnostics = lastSearchDiagnosticsByProject.get(projectId ?? SEARCH_MODE_DEFAULT_KEY);
7190
+ return diagnostics ? { ...diagnostics } : void 0;
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
+ }
7242
+ function rememberSearchDiagnostics(key, value) {
7243
+ if (!lastSearchDiagnosticsByProject.has(key) && lastSearchDiagnosticsByProject.size >= MAX_SEARCH_MODE_KEYS) {
7244
+ const oldest = lastSearchDiagnosticsByProject.keys().next().value;
7245
+ if (oldest !== void 0) lastSearchDiagnosticsByProject.delete(oldest);
7246
+ }
7247
+ lastSearchDiagnosticsByProject.delete(key);
7248
+ lastSearchDiagnosticsByProject.set(key, value);
7249
+ }
7183
7250
  function getOptionalObservationStore() {
7184
7251
  try {
7185
7252
  return getObservationStore();
@@ -7462,6 +7529,7 @@ async function resetDb() {
7462
7529
  indexEmbeddingProvider = null;
7463
7530
  deferredCachedVectorHydration = null;
7464
7531
  lastSearchModeByProject.clear();
7532
+ lastSearchDiagnosticsByProject.clear();
7465
7533
  }
7466
7534
  function isEmbeddingEnabled() {
7467
7535
  return embeddingEnabled;
@@ -7679,6 +7747,7 @@ async function removeObservation(oramaId) {
7679
7747
  await remove2(database, oramaId);
7680
7748
  }
7681
7749
  async function searchObservations(options) {
7750
+ const searchStartedAt = Date.now();
7682
7751
  const perf = !!process.env.MEMORIX_PERF;
7683
7752
  const t0 = perf ? performance.now() : 0;
7684
7753
  const mark = (label) => {
@@ -7754,6 +7823,8 @@ async function searchObservations(options) {
7754
7823
  let queryVector = null;
7755
7824
  let embeddingProviderForSearch = null;
7756
7825
  let embeddingUnavailable = false;
7826
+ let fallbackUsed = false;
7827
+ let fallbackReason;
7757
7828
  if (quality !== "fast" && embeddingEnabled && hasQuery && tier !== "fast") {
7758
7829
  try {
7759
7830
  const provider2 = await getEmbeddingProvider();
@@ -7762,6 +7833,8 @@ async function searchObservations(options) {
7762
7833
  const activeVectorDimensions = getVectorDimensions();
7763
7834
  if (activeVectorDimensions !== null && provider2.dimensions !== activeVectorDimensions) {
7764
7835
  embeddingUnavailable = true;
7836
+ fallbackUsed = true;
7837
+ fallbackReason = "embedding dimension mismatch; lexical search used";
7765
7838
  rememberSearchMode(
7766
7839
  modeKey,
7767
7840
  `fulltext (embedding dimension mismatch: provider ${provider2.dimensions}d vs index ${activeVectorDimensions}d)`
@@ -7803,9 +7876,13 @@ async function searchObservations(options) {
7803
7876
  }
7804
7877
  } else {
7805
7878
  embeddingUnavailable = true;
7879
+ fallbackUsed = true;
7880
+ fallbackReason = "embedding provider unavailable; lexical search used";
7806
7881
  }
7807
7882
  } catch (error) {
7808
7883
  embeddingUnavailable = true;
7884
+ fallbackUsed = true;
7885
+ fallbackReason = "embedding failed or timed out; lexical search used";
7809
7886
  rememberSearchMode(modeKey, "fulltext (embedding unavailable)");
7810
7887
  console.error("[memorix] Embedding failed or timed out, falling back to fulltext search");
7811
7888
  }
@@ -7855,6 +7932,8 @@ async function searchObservations(options) {
7855
7932
  similarity: 0.25
7856
7933
  };
7857
7934
  rememberSearchMode(modeKey, "vector-only (hybrid empty fallback)");
7935
+ fallbackUsed = true;
7936
+ fallbackReason = "hybrid search returned no results; vector-only fallback used";
7858
7937
  results = await search(database, vectorOnlyParams);
7859
7938
  } catch {
7860
7939
  }
@@ -8128,6 +8207,7 @@ async function searchObservations(options) {
8128
8207
  mark(`rerank(skipped,tier=${tier})`);
8129
8208
  }
8130
8209
  let entries = intermediate.map(({ rawTime: _, _isCommandLog: _c, ...rest }) => rest);
8210
+ const candidateCount = entries.length;
8131
8211
  for (const hit of results.hits) {
8132
8212
  const doc = hit.document;
8133
8213
  if (canReadObservation(doc, options.reader, projectIds ?? void 0)) rememberObservationDoc(doc);
@@ -8170,9 +8250,22 @@ async function searchObservations(options) {
8170
8250
  }
8171
8251
  }
8172
8252
  }
8253
+ const beforeTokenBudget = entries.length;
8173
8254
  if (options.maxTokens && options.maxTokens > 0) {
8174
8255
  entries = applyTokenBudget(entries, options.maxTokens);
8175
8256
  }
8257
+ rememberSearchDiagnostics(modeKey, {
8258
+ version: "1",
8259
+ mode: getLastSearchMode(options.projectId),
8260
+ rawCandidateCount: results.hits.length,
8261
+ candidateCount,
8262
+ selectedCount: entries.length,
8263
+ omittedCount: Math.max(0, candidateCount - entries.length),
8264
+ omittedByTokenBudget: Math.max(0, beforeTokenBudget - entries.length),
8265
+ fallbackUsed,
8266
+ ...fallbackReason ? { fallbackReason } : {},
8267
+ elapsedMs: Math.max(0, Date.now() - searchStartedAt)
8268
+ });
8176
8269
  if (options.trackAccess !== false) {
8177
8270
  const returnedKeys = new Set(entries.map((entry) => makeEntryKey(entry.projectId, entry.id)));
8178
8271
  const hitDocs = results.hits.map((hit) => ({ id: hit.id, doc: hit.document })).filter(({ doc }) => returnedKeys.has(makeEntryKey(doc.projectId, doc.observationId)));
@@ -8288,7 +8381,7 @@ function formatTime(isoDate) {
8288
8381
  return isoDate;
8289
8382
  }
8290
8383
  }
8291
- var db, dbInitPromise, dbGeneration, embeddingEnabled, embeddingDimensions, indexEmbeddingProvider, deferredCachedVectorHydration, NON_CJK_HYBRID_SIMILARITY, CJK_RUN, lastSearchModeByProject, SEARCH_MODE_DEFAULT_KEY, MAX_SEARCH_MODE_KEYS, COMMAND_LOG_TITLE, COMMAND_STYLE_TITLE, COMMAND_LIKE_QUERY2, COMMAND_INTENT_QUERY, NATURAL_LANGUAGE_MARKERS;
8384
+ var db, dbInitPromise, dbGeneration, embeddingEnabled, embeddingDimensions, indexEmbeddingProvider, deferredCachedVectorHydration, NON_CJK_HYBRID_SIMILARITY, CJK_RUN, lastSearchModeByProject, lastSearchDiagnosticsByProject, SEARCH_MODE_DEFAULT_KEY, MAX_SEARCH_MODE_KEYS, COMMAND_LOG_TITLE, COMMAND_STYLE_TITLE, COMMAND_LIKE_QUERY2, COMMAND_INTENT_QUERY, NATURAL_LANGUAGE_MARKERS;
8292
8385
  var init_orama_store = __esm({
8293
8386
  "src/store/orama-store.ts"() {
8294
8387
  "use strict";
@@ -8314,6 +8407,7 @@ var init_orama_store = __esm({
8314
8407
  NON_CJK_HYBRID_SIMILARITY = 0.45;
8315
8408
  CJK_RUN = /[\u3400-\u4dbf\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]+/gu;
8316
8409
  lastSearchModeByProject = /* @__PURE__ */ new Map();
8410
+ lastSearchDiagnosticsByProject = /* @__PURE__ */ new Map();
8317
8411
  SEARCH_MODE_DEFAULT_KEY = "__global__";
8318
8412
  MAX_SEARCH_MODE_KEYS = 4096;
8319
8413
  COMMAND_LOG_TITLE = /^(Ran:|Command:|Executed:)\s/i;
@@ -35999,6 +36093,25 @@ var init_models_generated = __esm({
35999
36093
  }
36000
36094
  },
36001
36095
  "minimax": {
36096
+ "MiniMax-M3.1-Flash": {
36097
+ id: "MiniMax-M3.1-Flash",
36098
+ name: "MiniMax-M3.1-Flash",
36099
+ api: "anthropic-messages",
36100
+ provider: "minimax",
36101
+ baseUrl: "https://api.minimax.io/anthropic",
36102
+ compat: { "forceAdaptiveThinking": true },
36103
+ reasoning: true,
36104
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
36105
+ input: ["text", "image", "video"],
36106
+ cost: {
36107
+ input: 0.15,
36108
+ output: 0.6,
36109
+ cacheRead: 0.015,
36110
+ cacheWrite: 0
36111
+ },
36112
+ contextWindow: 1e6,
36113
+ maxTokens: 524288
36114
+ },
36002
36115
  "MiniMax-M2.7": {
36003
36116
  id: "MiniMax-M2.7",
36004
36117
  name: "MiniMax-M2.7",
@@ -36039,6 +36152,7 @@ var init_models_generated = __esm({
36039
36152
  api: "anthropic-messages",
36040
36153
  provider: "minimax",
36041
36154
  baseUrl: "https://api.minimax.io/anthropic",
36155
+ compat: { "forceAdaptiveThinking": true },
36042
36156
  reasoning: true,
36043
36157
  input: ["text", "image", "video"],
36044
36158
  cost: {
@@ -36048,10 +36162,29 @@ var init_models_generated = __esm({
36048
36162
  cacheWrite: 0
36049
36163
  },
36050
36164
  contextWindow: 1e6,
36051
- maxTokens: 128e3
36165
+ maxTokens: 524288
36052
36166
  }
36053
36167
  },
36054
36168
  "minimax-cn": {
36169
+ "MiniMax-M3.1-Flash": {
36170
+ id: "MiniMax-M3.1-Flash",
36171
+ name: "MiniMax-M3.1-Flash",
36172
+ api: "anthropic-messages",
36173
+ provider: "minimax-cn",
36174
+ baseUrl: "https://api.minimaxi.com/anthropic",
36175
+ compat: { "forceAdaptiveThinking": true },
36176
+ reasoning: true,
36177
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
36178
+ input: ["text", "image", "video"],
36179
+ cost: {
36180
+ input: 0.15,
36181
+ output: 0.6,
36182
+ cacheRead: 0.015,
36183
+ cacheWrite: 0
36184
+ },
36185
+ contextWindow: 1e6,
36186
+ maxTokens: 524288
36187
+ },
36055
36188
  "MiniMax-M2.7": {
36056
36189
  id: "MiniMax-M2.7",
36057
36190
  name: "MiniMax-M2.7",
@@ -36092,6 +36225,7 @@ var init_models_generated = __esm({
36092
36225
  api: "anthropic-messages",
36093
36226
  provider: "minimax-cn",
36094
36227
  baseUrl: "https://api.minimaxi.com/anthropic",
36228
+ compat: { "forceAdaptiveThinking": true },
36095
36229
  reasoning: true,
36096
36230
  input: ["text", "image", "video"],
36097
36231
  cost: {
@@ -36101,7 +36235,7 @@ var init_models_generated = __esm({
36101
36235
  cacheWrite: 0
36102
36236
  },
36103
36237
  contextWindow: 1e6,
36104
- maxTokens: 128e3
36238
+ maxTokens: 524288
36105
36239
  }
36106
36240
  },
36107
36241
  "mistral": {
@@ -39222,6 +39356,24 @@ var init_models_generated = __esm({
39222
39356
  }
39223
39357
  },
39224
39358
  "openrouter": {
39359
+ "minimax/minimax-m3.1-flash:free": {
39360
+ id: "minimax/minimax-m3.1-flash:free",
39361
+ name: "MiniMax: MiniMax M3.1 Flash (free)",
39362
+ api: "openai-completions",
39363
+ provider: "openrouter",
39364
+ baseUrl: "https://openrouter.ai/api/v1",
39365
+ reasoning: true,
39366
+ thinkingLevelMap: { "off": null, "minimal": null, "low": "low", "medium": "medium", "high": "high", "xhigh": "xhigh" },
39367
+ input: ["text", "image"],
39368
+ cost: {
39369
+ input: 0,
39370
+ output: 0,
39371
+ cacheRead: 0,
39372
+ cacheWrite: 0
39373
+ },
39374
+ contextWindow: 1e6,
39375
+ maxTokens: 524288
39376
+ },
39225
39377
  "ai21/jamba-large-1.7": {
39226
39378
  id: "ai21/jamba-large-1.7",
39227
39379
  name: "AI21: Jamba Large 1.7",
@@ -47923,6 +48075,14 @@ var init_models_generated = __esm({
47923
48075
  }
47924
48076
  });
47925
48077
 
48078
+ // packages/ai/dist/minimax-models.js
48079
+ var init_minimax_models = __esm({
48080
+ "packages/ai/dist/minimax-models.js"() {
48081
+ "use strict";
48082
+ init_esm_shims();
48083
+ }
48084
+ });
48085
+
47926
48086
  // packages/ai/dist/models.js
47927
48087
  function calculateCost(model, usage) {
47928
48088
  usage.cost.input = model.cost.input / 1e6 * usage.input;
@@ -47969,6 +48129,8 @@ var init_models2 = __esm({
47969
48129
  "use strict";
47970
48130
  init_esm_shims();
47971
48131
  init_models_generated();
48132
+ init_minimax_models();
48133
+ init_minimax_models();
47972
48134
  modelRegistry = /* @__PURE__ */ new Map();
47973
48135
  for (const [provider2, models] of Object.entries(MODELS)) {
47974
48136
  const providerModels = /* @__PURE__ */ new Map();
@@ -55922,6 +56084,25 @@ function buildParams2(model, context, isOAuthToken2, options) {
55922
56084
  params.tool_choice = options.toolChoice;
55923
56085
  }
55924
56086
  }
56087
+ return normalizeMiniMaxParams(model, params, options);
56088
+ }
56089
+ function normalizeMiniMaxParams(model, params, options) {
56090
+ if (model.provider !== "minimax" && model.provider !== "minimax-cn")
56091
+ return params;
56092
+ if (params.model === "MiniMax-M3.1-Flash") {
56093
+ const effort = params.output_config?.effort ?? options?.effort ?? "max";
56094
+ const normalized = { ...params, thinking: { type: "adaptive" } };
56095
+ normalized.output_config = {
56096
+ ...params.output_config,
56097
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
56098
+ };
56099
+ delete normalized.service_tier;
56100
+ delete normalized.reasoning_split;
56101
+ return normalized;
56102
+ }
56103
+ if (params.model === "MiniMax-M3" && params.thinking) {
56104
+ return { ...params, thinking: { type: params.thinking.type === "disabled" ? "disabled" : "adaptive" } };
56105
+ }
55925
56106
  return params;
55926
56107
  }
55927
56108
  function normalizeToolCallId(id) {
@@ -56228,6 +56409,7 @@ var init_anthropic = __esm({
56228
56409
  if (nextParams !== void 0) {
56229
56410
  params = nextParams;
56230
56411
  }
56412
+ params = normalizeMiniMaxParams(model, params, options);
56231
56413
  const requestOptions = {
56232
56414
  ...options?.signal ? { signal: options.signal } : {},
56233
56415
  ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
@@ -138998,6 +139180,18 @@ var init_openai_completions = __esm({
138998
139180
  if (nextParams !== void 0) {
138999
139181
  params = nextParams;
139000
139182
  }
139183
+ if (model.provider === "openrouter" && new URL(model.baseUrl).hostname === "openrouter.ai" && params.model === "minimax/minimax-m3.1-flash:free") {
139184
+ const flash = params;
139185
+ const effort = flash.reasoning?.effort ?? "max";
139186
+ flash.reasoning = {
139187
+ ...flash.reasoning,
139188
+ enabled: true,
139189
+ effort: ["low", "medium", "high", "xhigh", "max"].includes(effort) ? effort : "max"
139190
+ };
139191
+ delete flash.reasoning_effort;
139192
+ delete flash.reasoning_split;
139193
+ delete flash.service_tier;
139194
+ }
139001
139195
  const requestOptions = {
139002
139196
  ...options?.signal ? { signal: options.signal } : {},
139003
139197
  ...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
@@ -49,3 +49,109 @@ The current-context baseline test runs the existing Auto Context path against
49
49
  real local fixture repositories. Future phases must add their real Workset
50
50
  adapter to this harness before claiming retrieval, wiki, workflow, or provider
51
51
  quality improvements.
52
+
53
+ ## 1.10 Task Matrix
54
+
55
+ The 1.10 contract adds a deterministic task matrix in
56
+ `src/evaluation/context-task-matrix.ts` and
57
+ `tests/evaluation/context-task-matrix.test.ts`. It contains 20 cases across
58
+ continuity, retrieval, safety, runtime, and integration boundaries. The cases
59
+ cover first setup, cross-host recovery, stale and conflicting evidence, CJK and
60
+ large-store retrieval, embedding fallback, poisoning and abstention, project
61
+ isolation, HTTP session/handle expiry, project switches, and adapter doctor
62
+ parity.
63
+
64
+ Every case records the same metric contract: first-action correctness, recovery
65
+ success, memory hit precision/recall, stale and conflict rejection, abstention
66
+ precision, input/output tokens, p50/p95 latency, RSS, fallback/degraded counts,
67
+ and review cost. The matrix is a testable specification; it does not contain
68
+ measured scores. Run its contract gate with:
69
+
70
+ ~~~powershell
71
+ npm run gate:context-matrix
72
+ ~~~
73
+
74
+ The runtime gate executes the same 20 cases against real Workset, compact
75
+ retrieval, CodeGraph freshness, binding-store, and adapter-registry paths. It
76
+ also runs the packed 40k large-store transport gate and injects its measured
77
+ context latency/RSS into the large-store case:
78
+
79
+ ~~~powershell
80
+ npm run gate:context-runtime
81
+ ~~~
82
+
83
+ This is intentionally a separate release gate from the ordinary test suite:
84
+ it rebuilds the packed runtime and seeds 40,000 records across SDK, HTTP MCP,
85
+ stdio hook, and reopen paths. The normal suite still runs the pure runner
86
+ contract and skips the capacity-sized fixture.
87
+
88
+ ### Current Retrieval Baseline
89
+
90
+ The existing deterministic session replay exam provides the first measured
91
+ baseline for the 1.10 matrix. With embeddings disabled, four fixed questions
92
+ achieved 4/4 hit rate, a maximum turn size of 277 tokens, and zero over-budget
93
+ turns. The no-dedup comparison showed 4 duplicate displays out of 16 (25%);
94
+ the surfaced-ID dedup path showed 3 out of 16 (18.75%) while retaining 4/4
95
+ hits. This is a retrieval/session baseline for the mapped continuity and
96
+ retrieval cases, not a score for the remaining matrix cases.
97
+
98
+ ### Measured 1.10 Runtime Baseline
99
+
100
+ Measured on Windows Node `v22.22.3`, `win32-x64`, with embeddings disabled and
101
+ LLM refinement disabled on 2026-10-23:
102
+
103
+ | Result | Measurement |
104
+ | --- | --- |
105
+ | Matrix cases | 20/20 passed |
106
+ | Memory hit precision/recall | 1.00 / 1.00 |
107
+ | Stale/conflict rejection | 1.00 / 1.00 |
108
+ | Abstention precision | 0.95 |
109
+ | Matrix latency | p50 2ms / p95 255ms |
110
+ | Matrix peak RSS | 428,867,584 bytes |
111
+ | 40k seed/index | 45,571.959ms |
112
+ | 40k SDK search | 30.378ms |
113
+ | 40k MCP context / receipt assembly | 518.983ms / 6ms |
114
+ | 40k peak RSS | 409.0MB |
115
+ | 40k SDK reopen | 85.095ms |
116
+ | 100k seed/index | 113,048.097ms |
117
+ | 100k SDK search | 39.71ms |
118
+ | 100k MCP context / receipt assembly | 1,099.809ms / 7ms |
119
+ | 100k peak RSS | 409.4MB |
120
+
121
+ The 40k and 100k large-store gates both returned `ok: true`, with no failed
122
+ checks. The 100k run reopened 100,001 rows after the MCP and hook writes; the
123
+ 40k run reopened 40,001 rows. These are local capacity observations, not
124
+ cross-platform SLOs. The runtime report is produced by
125
+ `src/evaluation/context-task-runner.ts` and
126
+ `tests/evaluation/context-task-runtime.test.ts`.
127
+
128
+ ### Retrieval Receipt Contract
129
+
130
+ Schema version `1` receipts now share these measured fields across compact
131
+ engine, MCP `memorix_search`, and CLI `memory search --json`:
132
+
133
+ - `mode`, `resultCount`, `selectedCount`, and `tokenCount`;
134
+ - `candidateCount`, `omittedCount`, and `omittedByTokenBudget`;
135
+ - `fallbackUsed` and an optional bounded `fallbackReason`;
136
+ - `derivedViews` for FTS, Orama, embedding, and CodeGraph generation,
137
+ freshness, rebuild status, and bounded failure reason;
138
+ - request-level `elapsedMs`.
139
+
140
+ The receipt remains metadata-only: query text, raw memory narratives, and local
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.
@@ -60,6 +60,37 @@ Task Workset assembled for one task from current code facts, continuation
60
60
  evidence, source-qualified knowledge, and relevant durable memories under a
61
61
  strict token budget.
62
62
 
63
+ ## Memory Ownership Matrix
64
+
65
+ This matrix is the ownership contract for the current product line. A consumer
66
+ may read a projection from another layer, but it must not silently promote that
67
+ projection or replace the layer that owns its truth. `Task Workset` is a derived
68
+ delivery view and is intentionally absent from the persisted kinds below.
69
+
70
+ | Type | Write owner | Verification owner | Default reader | Automatic promotion |
71
+ | --- | --- | --- | --- | --- |
72
+ | Observation | explicit MCP/CLI writes, agent writes, hooks, and Git Memory capture | admission gate, evidence cards, current Code Memory qualification, and visibility rules | task context and deliberate search/detail | source-dependent; hook and model-derived candidates wait for qualification |
73
+ | Reasoning | session/task capture and explicit agent reasoning writes | session outcome, verification events, feedback, and task continuity | handoff, session context, and task context | never as verified durable knowledge without explicit evidence |
74
+ | Claim | explicit/manual entry, Git evidence, or reviewed derivation | claim review plus attached evidence and conflict state | evidence-aware task context and knowledge workspace | no automatic promotion |
75
+ | Wiki / Workflow | reviewed workspace proposal or deliberate workflow import | document review, lint, commit/source checks, and workflow verification gates | task lens and explicit knowledge/workflow operations | no automatic overwrite of claims or manually edited pages |
76
+ | Session / Team | session lifecycle and coordination runtime | lifecycle closure, task outcome, heartbeat/lock state, and handoff verification | active handoff, coordination views, and session recovery | summaries may create observations, but do not become verified facts automatically |
77
+ | Long-term memory | explicit promotion from evidence or deliberate manual capture | qualification, evidence references, scope/owner rules, and explicit review | bounded durable context when the task and scope allow it | only when the promotion conditions and review state are satisfied |
78
+ | CodeGraph | source refresh and provider adapters | complete snapshot, parser/provider health, and current worktree comparison | code context and CodeGraph diagnostics | never copies source truth into memory automatically |
79
+
80
+ The following rules apply across rows:
81
+
82
+ 1. A source may propose or reference another type, but the receiving type owns
83
+ its own lifecycle and verification state.
84
+ 2. `candidate`, `qualified`, `approved`, `stale`, `conflict`, and `blocked` are
85
+ lifecycle/evidence facts; they must not be collapsed into one unexplained
86
+ trust score.
87
+ 3. A default context builder may include only records that pass its admission,
88
+ visibility, freshness, and task-scope rules. Omitted or abstained evidence
89
+ belongs in the delivery receipt.
90
+ 4. Adding a new persisted memory type requires documenting why an existing row
91
+ cannot own the data and adding its writer, verifier, reader, and promotion
92
+ path to this matrix first.
93
+
63
94
  ### Kinds
64
95
 
65
96
  - **Episodic**: a bounded event or handoff, such as a completed debugging
@@ -419,6 +419,12 @@ Global example:
419
419
  }
420
420
  ```
421
421
 
422
+ Successful MCP searches include a machine-readable `structuredContent.retrieval`
423
+ receipt with schema version `1`, the selected search mode, result count, output
424
+ token count, and measured search/format elapsed time. `memorix memory search
425
+ --json` exposes the same receipt under `retrieval`; the human-readable table
426
+ remains unchanged. The receipt contains no query text or raw memory content.
427
+
422
428
  ### `memorix_detail`
423
429
 
424
430
  Fetch full observation, mini-skill, or curated long-term memory detail.
@@ -560,6 +566,19 @@ Behavior:
560
566
 
561
567
  In HTTP service mode, pass `projectRoot` as the absolute workspace or repo root whenever the client knows it. `projectRoot` is the detection anchor; project identity still comes from Git.
562
568
 
569
+ Every successful `memorix_session_start` response also includes a machine-readable
570
+ `structuredContent.binding` receipt. It contains `version`, `state`, `source`,
571
+ `explicit`, the resolved `projectId`, a hash of the verified project root, a hash
572
+ of the active data directory, verified Git remote state (`gitRemote.state`, with
573
+ remote hash and host when present), a project handle lease (`handle.state`, with
574
+ creation, last-use, expiry, and handle hash when present), and the transport label
575
+ (`legacy-http`, `stateless-http`, `stdio`, or `unknown`). The receipt is safe for
576
+ diagnostics and handoffs: it does not include local paths, remote URLs, MCP
577
+ session IDs, or project handles. An expired handle is reported as `expired` when
578
+ the adapter can still inspect its metadata; requests carrying an invalid or
579
+ expired handle fail closed before business tools run. The text response still
580
+ includes the human-readable binding state.
581
+
563
582
  ### `memorix_session_end`
564
583
 
565
584
  End the active session with a summary.
@@ -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 current release candidate is **1.9.12**. The published baseline remains
17
- **1.9.11** until the release is published. Package metadata is kept
18
- synchronized with the root package and MCP Registry manifest.
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
 
@@ -102,6 +103,19 @@ memorix background start
102
103
  memorix status
103
104
  ```
104
105
 
106
+ For the 1.10 context contract and capacity gates, run the deterministic matrix
107
+ and the packed 40k transport fixture:
108
+
109
+ ```bash
110
+ npm run gate:context-matrix
111
+ npm run gate:context-runtime
112
+ node scripts/large-store-gate.mjs --records 100000
113
+ ```
114
+
115
+ `gate:context-runtime` rebuilds the packed runtime before running its fixture.
116
+ The 100k command is a separate capacity check because it takes materially
117
+ longer and is not part of the ordinary `npm test` loop.
118
+
105
119
  ---
106
120
 
107
121
  ## 3. Recommended Development Loop