memorix 1.10.2 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +3 -1
  3. package/README.zh-CN.md +3 -1
  4. package/dist/cli/index.js +397 -215
  5. package/dist/cli/memcode.js +0 -0
  6. package/dist/index.js +150 -38
  7. package/dist/maintenance-runner.js +108 -22
  8. package/dist/media-audio-runner.js +108 -22
  9. package/dist/media-video-runner.js +108 -22
  10. package/dist/memcode-runtime/CHANGELOG.md +20 -0
  11. package/dist/sdk.js +149 -37
  12. package/dist/types.d.ts +1 -1
  13. package/dist/vector-backfill-runner.js +108 -22
  14. package/docs/CONFIGURATION.md +34 -0
  15. package/docs/DEVELOPMENT.md +1 -1
  16. package/docs/INTEGRATIONS.md +1 -1
  17. package/docs/README.md +2 -1
  18. package/docs/ROADMAP-1.9.12-2.0.md +1 -1
  19. package/docs/SETUP.md +19 -4
  20. package/package.json +1 -1
  21. package/plugins/antigravity/memorix/plugin.json +1 -1
  22. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  23. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  24. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  25. package/plugins/copilot/memorix/plugin.json +1 -1
  26. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  27. package/plugins/hermes/memorix/plugin.yaml +1 -1
  28. package/plugins/omp/memorix/package.json +1 -1
  29. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  30. package/plugins/pi/memorix/package.json +1 -1
  31. package/server.json +2 -2
  32. package/src/cli/commands/agent-integrations.ts +1 -1
  33. package/src/cli/commands/background.ts +1 -1
  34. package/src/cli/commands/context.ts +3 -2
  35. package/src/cli/commands/doctor.ts +9 -0
  36. package/src/cli/commands/explain.ts +3 -2
  37. package/src/cli/commands/init.ts +6 -2
  38. package/src/cli/commands/setup.ts +9 -6
  39. package/src/cli/commands/uninstall.ts +15 -0
  40. package/src/cli/tui/App.tsx +9 -16
  41. package/src/cli/tui/ConfigureView.tsx +2 -0
  42. package/src/codegraph/auto-context.ts +1 -1
  43. package/src/codegraph/store.ts +37 -0
  44. package/src/codegraph/types.ts +3 -0
  45. package/src/config/dotenv-loader.ts +1 -0
  46. package/src/config/resolved-config.ts +7 -2
  47. package/src/config/toml-loader.ts +1 -0
  48. package/src/config/yaml-loader.ts +4 -2
  49. package/src/dashboard/server.ts +5 -6
  50. package/src/hooks/handler.ts +0 -1
  51. package/src/integrations/registry.ts +2 -1
  52. package/src/llm/provider.ts +2 -1
  53. package/src/memory/observations.ts +61 -17
  54. package/src/multimodal/image-loader.ts +2 -2
  55. package/src/runtime/open-browser.ts +25 -0
  56. package/src/server.ts +2 -2
  57. package/src/store/orama-store.ts +27 -3
  58. package/src/types.ts +1 -1
  59. package/src/workspace/mcp-adapters/pi.ts +58 -0
  60. package/plugins/pi/memorix/skills/memorix-git-memory/SKILL.md +0 -26
  61. package/plugins/pi/memorix/skills/memorix-memory/SKILL.md +0 -51
  62. package/plugins/pi/memorix/skills/memorix-mini-skills/SKILL.md +0 -31
  63. package/plugins/pi/memorix/skills/memorix-orchestrate/SKILL.md +0 -28
  64. package/plugins/pi/memorix/skills/memorix-reasoning/SKILL.md +0 -30
  65. package/plugins/pi/memorix/skills/memorix-sessions/SKILL.md +0 -25
  66. package/plugins/pi/memorix/skills/memorix-troubleshooting/SKILL.md +0 -27
@@ -2408,7 +2408,8 @@ function getResolvedConfig(options = {}) {
2408
2408
  const isRequesty = memoryLlmProvider === "requesty";
2409
2409
  const isApiRoute = memoryLlmProvider === "apiroute";
2410
2410
  const isCheaperInference = memoryLlmProvider === "cheaperinference";
2411
- const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute || isCheaperInference;
2411
+ const isRuncrate = memoryLlmProvider === "runcrate";
2412
+ const usesPresetKeyOnly = isAtlasCloud || isRequesty || isApiRoute || isCheaperInference || isRuncrate;
2412
2413
  const memoryLlmApiKey = first(
2413
2414
  process.env.MEMORIX_LLM_API_KEY,
2414
2415
  process.env.MEMORIX_API_KEY,
@@ -2416,7 +2417,7 @@ function getResolvedConfig(options = {}) {
2416
2417
  yaml.llm?.apiKey,
2417
2418
  legacy.llm?.apiKey,
2418
2419
  // Never borrow another provider's credentials for these gateway presets.
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,
2420
+ 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 : isRuncrate ? process.env.RUNCRATE_API_KEY : process.env.OPENAI_API_KEY,
2420
2421
  usesPresetKeyOnly ? void 0 : process.env.ANTHROPIC_API_KEY,
2421
2422
  usesPresetKeyOnly ? void 0 : openRouterMemoryLlmApiKey
2422
2423
  );
@@ -2487,6 +2488,7 @@ function getResolvedConfig(options = {}) {
2487
2488
  codegraph: {
2488
2489
  excludePatterns: firstArray(toml.codegraph?.exclude_patterns, yaml.codegraph?.excludePatterns),
2489
2490
  maxFileBytes: firstNumber(toml.codegraph?.max_file_bytes, yaml.codegraph?.maxFileBytes),
2491
+ autoRefresh: first(toml.codegraph?.auto_refresh, yaml.codegraph?.autoRefresh, "auto"),
2490
2492
  externalContext: first(
2491
2493
  normalizeExternalContext(process.env.MEMORIX_CODEGRAPH_EXTERNAL_CONTEXT),
2492
2494
  toml.codegraph?.external_context,
@@ -2601,6 +2603,7 @@ function getEnvSourceNames() {
2601
2603
  "REQUESTY_API_KEY",
2602
2604
  "API_ROUTE_API_KEY",
2603
2605
  "CHEAPER_INFERENCE_API_KEY",
2606
+ "RUNCRATE_API_KEY",
2604
2607
  "ATLASCLOUD_API_KEY"
2605
2608
  ].filter((name) => process.env[name]);
2606
2609
  }
@@ -5596,6 +5599,7 @@ var init_provider2 = __esm({
5596
5599
  requesty: { baseUrl: "https://router.requesty.ai/v1", model: "openai/gpt-4.1-nano" },
5597
5600
  apiroute: { baseUrl: "https://global.api-route.com/v1", model: "deepseek-v4.1-flash" },
5598
5601
  cheaperinference: { baseUrl: "https://api.cheaperinference.com/v1", model: "gpt-5.4-mini" },
5602
+ runcrate: { baseUrl: "https://api.runcrate.ai/v1", model: "deepseek-ai/DeepSeek-V4.1-Flash" },
5599
5603
  atlascloud: { baseUrl: "https://api.atlascloud.ai/v1", model: "deepseek-ai/deepseek-v3.2" },
5600
5604
  custom: { baseUrl: "http://localhost:11434/v1", model: "llama3" }
5601
5605
  };
@@ -7303,10 +7307,18 @@ __export(orama_store_exports, {
7303
7307
  queueSemanticVector: () => queueSemanticVector,
7304
7308
  removeObservation: () => removeObservation,
7305
7309
  resetDb: () => resetDb,
7310
+ resolveSearchFuzzyTolerance: () => resolveSearchFuzzyTolerance,
7306
7311
  searchObservations: () => searchObservations,
7307
7312
  updateObservationMetadata: () => updateObservationMetadata
7308
7313
  });
7309
7314
  import { components, create, insert as insert2, insertMultiple, search, remove as remove2, update, count, getByID } from "@orama/orama";
7315
+ function resolveSearchFuzzyTolerance(query, quality) {
7316
+ if (quality === "fast") return void 0;
7317
+ const characters = [...query];
7318
+ const cjkCount = characters.filter((char) => /[\u3400-\u4dbf\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]/u.test(char)).length;
7319
+ if (characters.length > 0 && cjkCount / characters.length > 0.3) return void 0;
7320
+ return query.length > 6 ? 2 : 1;
7321
+ }
7310
7322
  function rememberSearchMode(key, value) {
7311
7323
  if (!lastSearchModeByProject.has(key) && lastSearchModeByProject.size >= MAX_SEARCH_MODE_KEYS) {
7312
7324
  const oldest = lastSearchModeByProject.keys().next().value;
@@ -7952,7 +7964,10 @@ async function searchObservations(options) {
7952
7964
  // Fuzzy tolerance: allow 1-char typos for short queries, 2 for longer
7953
7965
  // Fuzzy matching is useful for ordinary recall, but grows sharply with
7954
7966
  // corpus size. The fast profile deliberately uses exact lexical matching.
7955
- ...hasQuery && quality !== "fast" ? { tolerance: originalQuery.length > 6 ? 2 : 1 } : {}
7967
+ ...hasQuery ? (() => {
7968
+ const tolerance = resolveSearchFuzzyTolerance(originalQuery, quality);
7969
+ return tolerance === void 0 ? {} : { tolerance };
7970
+ })() : {}
7956
7971
  };
7957
7972
  let queryVector = null;
7958
7973
  let embeddingProviderForSearch = null;
@@ -8183,14 +8198,16 @@ async function searchObservations(options) {
8183
8198
  filesModified: doc.filesModified?.split?.("\n") ?? (Array.isArray(doc.filesModified) ? doc.filesModified : [])
8184
8199
  });
8185
8200
  }
8201
+ const topScore = Math.max(...intermediate.map((entry) => entry.score));
8202
+ const affinityTieWindow = topScore * 0.92;
8186
8203
  intermediate = intermediate.map((entry) => {
8187
8204
  const memory = memoryContentMap.get(entry.id);
8188
8205
  if (!memory) return entry;
8189
8206
  const { score: affinityScore } = calculateProjectAffinity(memory, affinityContext);
8207
+ if (entry.score < affinityTieWindow) return entry;
8190
8208
  return {
8191
8209
  ...entry,
8192
- score: entry.score * affinityScore
8193
- // Apply affinity as multiplier
8210
+ score: entry.score * (0.98 + affinityScore * 0.02)
8194
8211
  };
8195
8212
  });
8196
8213
  intermediate.sort((a, b) => b.score - a.score);
@@ -147188,6 +147205,7 @@ var init_store = __esm({
147188
147205
  recordCodeStateSnapshot(input) {
147189
147206
  const id = randomUUID11();
147190
147207
  let snapshot;
147208
+ let compactNeeded = false;
147191
147209
  const tx = this.db.transaction(() => {
147192
147210
  const previous = this.db.prepare(
147193
147211
  "SELECT id, sourceEpoch FROM code_state_snapshots WHERE projectId = ? ORDER BY sourceEpoch DESC LIMIT 1"
@@ -147231,6 +147249,26 @@ var init_store = __esm({
147231
147249
  for (const file of snapshotFileRows) {
147232
147250
  insertSnapshotFile.run(id, file.projectId, file.id, file.path, file.contentHash);
147233
147251
  }
147252
+ const staleSymbolIds = this.db.prepare(
147253
+ "SELECT id FROM code_symbols WHERE projectId = ? AND stale = 1"
147254
+ ).all(input.projectId).map((row) => row.id);
147255
+ if (staleSymbolIds.length > 0) {
147256
+ const placeholders = staleSymbolIds.map(() => "?").join(", ");
147257
+ this.db.prepare(
147258
+ `DELETE FROM code_edges WHERE projectId = ? AND (fromSymbolId IN (${placeholders}) OR toSymbolId IN (${placeholders}))`
147259
+ ).run(input.projectId, ...staleSymbolIds, ...staleSymbolIds);
147260
+ this.db.prepare("DELETE FROM code_symbols WHERE projectId = ? AND stale = 1").run(input.projectId);
147261
+ compactNeeded = true;
147262
+ }
147263
+ const oldSnapshots = this.db.prepare(
147264
+ "SELECT id FROM code_state_snapshots WHERE projectId = ? ORDER BY sourceEpoch DESC LIMIT -1 OFFSET 2"
147265
+ ).all(input.projectId).map((row) => row.id);
147266
+ if (oldSnapshots.length > 0) {
147267
+ const placeholders = oldSnapshots.map(() => "?").join(", ");
147268
+ this.db.prepare(`DELETE FROM code_state_snapshot_files WHERE snapshotId IN (${placeholders})`).run(...oldSnapshots);
147269
+ this.db.prepare(`DELETE FROM code_state_snapshots WHERE id IN (${placeholders})`).run(...oldSnapshots);
147270
+ compactNeeded = true;
147271
+ }
147234
147272
  snapshot = {
147235
147273
  ...input,
147236
147274
  id,
@@ -147239,11 +147277,24 @@ var init_store = __esm({
147239
147277
  };
147240
147278
  });
147241
147279
  tx();
147280
+ if (compactNeeded) this.compactStorage();
147242
147281
  return snapshot;
147243
147282
  }
147283
+ /** Reclaim WAL/free pages after a derived codegraph sweep. */
147284
+ compactStorage() {
147285
+ try {
147286
+ this.db.pragma("wal_checkpoint(TRUNCATE)");
147287
+ } catch {
147288
+ }
147289
+ try {
147290
+ this.db.exec("VACUUM");
147291
+ } catch {
147292
+ }
147293
+ }
147244
147294
  status(projectId) {
147245
147295
  const files = this.db.prepare(`SELECT COUNT(*) AS count FROM code_files WHERE projectId = ?`).get(projectId).count;
147246
147296
  const symbols = this.db.prepare(`SELECT COUNT(*) AS count FROM code_symbols WHERE projectId = ? AND stale = 0`).get(projectId).count;
147297
+ const staleSymbols = this.db.prepare(`SELECT COUNT(*) AS count FROM code_symbols WHERE projectId = ? AND stale = 1`).get(projectId).count;
147247
147298
  const edges = this.db.prepare(`SELECT COUNT(*) AS count FROM code_edges WHERE projectId = ?`).get(projectId).count;
147248
147299
  const refs = this.db.prepare(`SELECT COUNT(*) AS count FROM observation_code_refs WHERE projectId = ?`).get(projectId).count;
147249
147300
  const semanticSymbols = this.db.prepare(`SELECT COUNT(*) AS count FROM code_symbols WHERE projectId = ? AND stale = 0 AND source = 'typescript-compiler'`).get(projectId).count;
@@ -147251,6 +147302,8 @@ var init_store = __esm({
147251
147302
  const parserErrors = this.db.prepare(`SELECT COUNT(*) AS count FROM code_files WHERE projectId = ? AND parserError IS NOT NULL`).get(projectId).count;
147252
147303
  const latest = this.db.prepare(`SELECT MAX(indexedAt) AS indexedAt FROM code_files WHERE projectId = ?`).get(projectId);
147253
147304
  const latestSnapshot = this.latestSnapshot(projectId);
147305
+ const snapshots = this.db.prepare(`SELECT COUNT(*) AS count FROM code_state_snapshots WHERE projectId = ?`).get(projectId).count;
147306
+ const snapshotFiles = this.db.prepare(`SELECT COUNT(*) AS count FROM code_state_snapshot_files WHERE projectId = ?`).get(projectId).count;
147254
147307
  return {
147255
147308
  provider: "lite",
147256
147309
  files,
@@ -147260,6 +147313,9 @@ var init_store = __esm({
147260
147313
  semanticSymbols,
147261
147314
  semanticEdges,
147262
147315
  parserErrors,
147316
+ staleSymbols,
147317
+ snapshots,
147318
+ snapshotFiles,
147263
147319
  ...latest?.indexedAt ? { indexedAt: latest.indexedAt } : {},
147264
147320
  ...latestSnapshot ? { latestSnapshot } : {}
147265
147321
  };
@@ -151585,10 +151641,22 @@ function resetObservationRuntime() {
151585
151641
  loadedObservationStore = null;
151586
151642
  embeddingWriteMode = "background";
151587
151643
  embeddingWorkerProjectRoot = void 0;
151588
- vectorMissingIds.clear();
151644
+ clearVectorMissingIds();
151589
151645
  vectorSchemaUpgradePromise = null;
151590
151646
  embeddingFailureLogTimestamps.clear();
151591
151647
  }
151648
+ function markVectorMissing(observationId2, projectId) {
151649
+ vectorMissingIds.add(observationId2);
151650
+ vectorMissingProjectIds.set(observationId2, projectId);
151651
+ }
151652
+ function clearVectorMissing(observationId2) {
151653
+ vectorMissingIds.delete(observationId2);
151654
+ vectorMissingProjectIds.delete(observationId2);
151655
+ }
151656
+ function clearVectorMissingIds() {
151657
+ vectorMissingIds.clear();
151658
+ vectorMissingProjectIds.clear();
151659
+ }
151592
151660
  function logEmbeddingFailureOnce(key, message) {
151593
151661
  const now3 = Date.now();
151594
151662
  const last = embeddingFailureLogTimestamps.get(key) ?? 0;
@@ -151708,10 +151776,13 @@ function isVectorCompatibleWithCurrentIndex(embedding) {
151708
151776
  }
151709
151777
  async function upgradeVectorSchemaAfterFirstEmbedding(embedding) {
151710
151778
  if (isVectorCompatibleWithCurrentIndex(embedding)) return true;
151711
- if (getVectorDimensions() !== null || !embedding.every(Number.isFinite)) return false;
151779
+ if (!embedding.every(Number.isFinite)) return false;
151712
151780
  const targetProjectDir = projectDir;
151713
151781
  if (!vectorSchemaUpgradePromise) {
151714
- vectorSchemaUpgradePromise = reindexObservations().then(() => projectDir === targetProjectDir && isVectorCompatibleWithCurrentIndex(embedding)).catch(() => false).finally(() => {
151782
+ vectorSchemaUpgradePromise = getDb().then(async () => {
151783
+ if (getVectorDimensions() === null && observations.length > 0) await reindexObservations();
151784
+ return projectDir === targetProjectDir && isVectorCompatibleWithCurrentIndex(embedding);
151785
+ }).catch(() => false).finally(() => {
151715
151786
  vectorSchemaUpgradePromise = null;
151716
151787
  });
151717
151788
  }
@@ -151751,9 +151822,9 @@ async function initObservations(dir, options = {}) {
151751
151822
  }
151752
151823
  function scheduleObservationEmbedding(input) {
151753
151824
  const { observationId: observationId2, projectId, searchableText, doc } = input;
151754
- vectorMissingIds.add(observationId2);
151825
+ markVectorMissing(observationId2, projectId);
151755
151826
  if (isEmbeddingExplicitlyDisabled()) {
151756
- vectorMissingIds.delete(observationId2);
151827
+ clearVectorMissing(observationId2);
151757
151828
  return;
151758
151829
  }
151759
151830
  if (embeddingWriteMode === "deferred") {
@@ -151788,13 +151859,13 @@ function scheduleObservationEmbedding(input) {
151788
151859
  vector: embedding
151789
151860
  });
151790
151861
  }
151791
- vectorMissingIds.delete(observationId2);
151862
+ clearVectorMissing(observationId2);
151792
151863
  } catch {
151793
151864
  console.error(`[memorix] Embedding index update failed for obs-${observationId2} (kept in backfill queue)`);
151794
151865
  queueVectorBackfill(projectId);
151795
151866
  }
151796
151867
  } else if (isEmbeddingExplicitlyDisabled()) {
151797
- vectorMissingIds.delete(observationId2);
151868
+ clearVectorMissing(observationId2);
151798
151869
  } else {
151799
151870
  queueVectorBackfill(projectId);
151800
151871
  logEmbeddingFailureOnce(
@@ -152354,7 +152425,7 @@ async function reindexObservations() {
152354
152425
  if (observations.length === 0) return 0;
152355
152426
  await resetDb();
152356
152427
  searchIndexPrepared = false;
152357
- vectorMissingIds.clear();
152428
+ clearVectorMissingIds();
152358
152429
  let embeddings = observations.map(() => null);
152359
152430
  const provider2 = await getEmbeddingProvider();
152360
152431
  const canBatchEmbedAtStartup = provider2 !== null && !provider2.name.startsWith("api-");
@@ -152419,7 +152490,7 @@ async function reindexObservations() {
152419
152490
  };
152420
152491
  await insertObservation(doc);
152421
152492
  if (!compatibleEmbedding && !isEmbeddingExplicitlyDisabled()) {
152422
- vectorMissingIds.add(obs.id);
152493
+ markVectorMissing(obs.id, obs.projectId);
152423
152494
  }
152424
152495
  count2++;
152425
152496
  } catch (err) {
@@ -152436,7 +152507,17 @@ async function prepareSearchIndex(options = {}) {
152436
152507
  if (!isEmbeddingExplicitlyDisabled()) {
152437
152508
  const store = getObservationStore();
152438
152509
  const projects = await store.listProjectIds?.() ?? [];
152439
- for (const projectId of projects) queueVectorBackfill(projectId);
152510
+ await getDb({ allowNetworkProbe: false }).catch(() => void 0);
152511
+ const persistedIds = projectDir ? await getPersistentSemanticVectorIds(projectDir).catch(() => null) : null;
152512
+ for (const projectId of projects) {
152513
+ const projectObservations = await store.loadByProject(projectId);
152514
+ for (const observation of projectObservations) {
152515
+ if (!persistedIds?.has(observation.id)) markVectorMissing(observation.id, observation.projectId);
152516
+ }
152517
+ if (projectObservations.some((observation) => !persistedIds?.has(observation.id))) {
152518
+ queueVectorBackfill(projectId);
152519
+ }
152520
+ }
152440
152521
  }
152441
152522
  return 0;
152442
152523
  }
@@ -152450,13 +152531,13 @@ async function prepareSearchIndex(options = {}) {
152450
152531
  const hydratedProjectDir = projectDir;
152451
152532
  const queueMissingVectors = async () => {
152452
152533
  if (!hydratedProjectDir || projectDir !== hydratedProjectDir) return;
152453
- vectorMissingIds.clear();
152534
+ clearVectorMissingIds();
152454
152535
  if (!isEmbeddingExplicitlyDisabled()) {
152455
152536
  const persistedSemanticIds = await getPersistentSemanticVectorIds(hydratedProjectDir).catch(() => null);
152456
152537
  const projectsWithMissingVectors = /* @__PURE__ */ new Set();
152457
152538
  for (const obs of observations) {
152458
152539
  if (!hasObservationVector(obs.projectId, obs.id) && !persistedSemanticIds?.has(obs.id)) {
152459
- vectorMissingIds.add(obs.id);
152540
+ markVectorMissing(obs.id, obs.projectId);
152460
152541
  projectsWithMissingVectors.add(obs.projectId);
152461
152542
  }
152462
152543
  }
@@ -152474,6 +152555,9 @@ async function prepareSearchIndex(options = {}) {
152474
152555
  }
152475
152556
  function getVectorMissingIds(projectId) {
152476
152557
  if (!projectId) return [...vectorMissingIds];
152558
+ if (!corpusLoaded) {
152559
+ return [...vectorMissingIds].filter((id) => vectorMissingProjectIds.get(id) === projectId);
152560
+ }
152477
152561
  const observationById = new Map(observations.map((observation) => [observation.id, observation]));
152478
152562
  return [...vectorMissingIds].filter((id) => observationById.get(id)?.projectId === projectId);
152479
152563
  }
@@ -152511,7 +152595,8 @@ async function backfillVectorEmbeddings(options = {}) {
152511
152595
  return { attempted: 0, succeeded: 0, failed: 0 };
152512
152596
  }
152513
152597
  vectorBackfillRunning = true;
152514
- const observationById = new Map(observations.map((observation) => [observation.id, observation]));
152598
+ const sourceObservations = corpusLoaded ? observations : options.projectId ? await getObservationStore().loadByProject(options.projectId, { status: "active" }) : await getObservationStore().loadAll();
152599
+ const observationById = new Map(sourceObservations.map((observation) => [observation.id, observation]));
152515
152600
  const limit2 = Number.isFinite(options.limit) ? Math.max(1, Math.floor(options.limit)) : Number.POSITIVE_INFINITY;
152516
152601
  const ids = [...vectorMissingIds].filter((id) => !options.projectId || observationById.get(id)?.projectId === options.projectId).slice(0, limit2);
152517
152602
  let succeeded = 0;
@@ -152524,7 +152609,7 @@ async function backfillVectorEmbeddings(options = {}) {
152524
152609
  for (const id of ids) {
152525
152610
  const observation = observationById.get(id);
152526
152611
  if (!observation) {
152527
- vectorMissingIds.delete(id);
152612
+ clearVectorMissing(id);
152528
152613
  continue;
152529
152614
  }
152530
152615
  candidates.push({
@@ -152542,7 +152627,7 @@ async function backfillVectorEmbeddings(options = {}) {
152542
152627
  const provider2 = await getEmbeddingProvider();
152543
152628
  if (!provider2) {
152544
152629
  if (isEmbeddingExplicitlyDisabled()) {
152545
- for (const candidate of candidates) vectorMissingIds.delete(candidate.id);
152630
+ for (const candidate of candidates) clearVectorMissing(candidate.id);
152546
152631
  } else {
152547
152632
  recordFailure("embedding provider unavailable");
152548
152633
  failed += candidates.length;
@@ -152619,7 +152704,7 @@ async function backfillVectorEmbeddings(options = {}) {
152619
152704
  vector: embedding
152620
152705
  });
152621
152706
  }
152622
- vectorMissingIds.delete(id);
152707
+ clearVectorMissing(id);
152623
152708
  succeeded++;
152624
152709
  } catch (error) {
152625
152710
  recordFailure(vectorBackfillError(error));
@@ -152644,7 +152729,7 @@ async function backfillVectorEmbeddings(options = {}) {
152644
152729
  ...lastFailure ? { lastError: lastFailure } : {}
152645
152730
  };
152646
152731
  }
152647
- var observations, nextId, projectDir, searchIndexPrepared, embeddingWriteMode, embeddingWorkerProjectRoot, corpusLoaded, largeCorpusLazyMode, loadedObservationStore, DEFAULT_ORAMA_HYDRATION_THRESHOLD, vectorMissingIds, vectorBackfillRunning, vectorSchemaUpgradePromise, lastVectorBackfill, embeddingFailureLogTimestamps, EMBEDDING_FAILURE_LOG_COOLDOWN_MS, MAX_EMBEDDING_FAILURE_KEYS;
152732
+ var observations, nextId, projectDir, searchIndexPrepared, embeddingWriteMode, embeddingWorkerProjectRoot, corpusLoaded, largeCorpusLazyMode, loadedObservationStore, DEFAULT_ORAMA_HYDRATION_THRESHOLD, vectorMissingIds, vectorMissingProjectIds, vectorBackfillRunning, vectorSchemaUpgradePromise, lastVectorBackfill, embeddingFailureLogTimestamps, EMBEDDING_FAILURE_LOG_COOLDOWN_MS, MAX_EMBEDDING_FAILURE_KEYS;
152648
152733
  var init_observations = __esm({
152649
152734
  "src/memory/observations.ts"() {
152650
152735
  "use strict";
@@ -152669,6 +152754,7 @@ var init_observations = __esm({
152669
152754
  loadedObservationStore = null;
152670
152755
  DEFAULT_ORAMA_HYDRATION_THRESHOLD = 1e4;
152671
152756
  vectorMissingIds = /* @__PURE__ */ new Set();
152757
+ vectorMissingProjectIds = /* @__PURE__ */ new Map();
152672
152758
  vectorBackfillRunning = false;
152673
152759
  vectorSchemaUpgradePromise = null;
152674
152760
  lastVectorBackfill = null;
@@ -6,6 +6,26 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  No unreleased changes.
8
8
 
9
+ ## [1.10.3] - 2026-11-05
10
+
11
+ ### Added
12
+ - Pi 1.0+ native MCP setup through project or user `mcp.json`, with stdio and
13
+ HTTP transports alongside the existing extension and shared skills (#367).
14
+
15
+ ### Fixed
16
+ - CodeGraph now retains two snapshots, sweeps stale derived symbols and edges,
17
+ compacts SQLite after cleanup, and supports `codegraph.auto_refresh`.
18
+ - Lazy large-corpus mode now initializes vector schema and backfills missing
19
+ vectors from durable SQLite/Lance state (#374).
20
+ - CJK-heavy search avoids fuzzy traversal over character and bigram tokens;
21
+ project affinity is bounded to a tie-break so strong lexical matches stay on
22
+ top (#373, #375).
23
+ - Dashboard and TUI browser launches no longer interpolate URLs into shell
24
+ commands; release workflows retain the existing tested action references.
25
+ - **Runcrate memory preset** -- optional background memory LLM processing
26
+ through an OpenAI-compatible endpoint for open-weight models, with an isolated
27
+ `RUNCRATE_API_KEY`, CLI/TUI setup and bilingual configuration guidance.
28
+
9
29
  ## [1.10.2] - 2026-10-30
10
30
 
11
31
  ### Fixed