[GH-ISSUE #1304] [Feature]: Long-Term Memory: show which embedding source it uses and how to change it #666

Closed
opened 2026-10-20 17:29:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1304

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Users can't tell which embedding model Long-Term Memory uses, or how to change it. This matters most for non-English vaults (#1295, sections 4 and 5).

  • The status only says available or unavailable. It shows "Semantic search available/unavailable" with no model name ([ActivityView.tsx L1208-L1214](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ActivityView.tsx#L1208-L1214), [LongTermMemoryDetail.tsx L410-L414](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/LongTermMemoryDetail.tsx#L410-L414)).
  • The status can be stale. embeddingsAvailable is Boolean(index?.embeddings.embeddedChunkCount) (routes.ts L549).```` It keeps saying "available" after the embedding source changes: until the next recall rebuilds the index, or indefinitely if that rebuild failed and the auto-upgrade guard is set. Meanwhile recall reports semanticOutcome: "incompatible".
  • The embedding connection can't be chosen from LTM's own UI.
    • Embeddings come from the Engine agent config for long-term-memory, falling back to the default connection (Engine capability-module-runtime.service.ts L103-L113).`````
    • LTM's agent page opens in FeatureAgentDetailHost, which has no connection picker, unlike the Connection Override in AgentEditor that built-in agents get.
    • The "Extraction connection" in Memory Settings ([MemorySettings.tsx L1187-L1197](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx#L1187-L1197)) only affects extraction, not embeddings.
    • In practice, the only UI that sets LTM's connection is Connections → "apply to all agents", which changes every agent at once.
  • The default is English-only, and nothing says so. The built-in fallback is Xenova/all-MiniLM-L6-v2, which was trained on English. For Korean and other non-English vaults the vector lane adds little.

Proposed package or change

Package: long-term-memory. The minimum is a small server, client and docs change, with no Engine change.

  1. Status route (routes.ts ~L549),``````` adding the new fields to ltmStatusResponseSchema:
    • embeddingSource: the current resolvePackageEmbeddingAdapter() label, for example "Built-in local MiniLM", "Local Model sidecar" or "My connection (multilingual-e5-large)".
    • indexedEmbeddingSource: index.embeddings.model, the label already stored at rebuild (rebuild.ts L152).````````
    • embeddingsAvailable should also require index.embeddings.spaceId === adapter.spaceId, so a switched source no longer reads as available.
  2. Client:
    • Show the source on the health line, for example "Semantic search available · Built-in local MiniLM".
    • When the indexed source and the current source differ, say the vault will be re-embedded on the next recall or reindex.
  3. Help text under "Extraction connection" in MemorySettings.tsx: "Only used for extraction. Recall embeddings use the Long-Term Memory agent's connection (Connections → Semantic Search (Embeddings))."
  4. Guidance, as in-app help near the semantic status plus a short section in docs/ARCHITECTURE.md:
    • Which connection drives embeddings.
    • The default MiniLM is English-only.
    • For Korean, Japanese, Chinese or mixed-language vaults, set a multilingual embedding model on that connection, such as BAAI/bge-m3 (no prefixes) or multilingual-e5 (needs #1302 and Pasta-Devs/Marinara-Engine#7429).
    • Switching models re-embeds the vault.
    • BM25 and keyword lanes only match within one language. With a multilingual model, the vector lane is the only cross-language bridge (#1295, section 5).

Optional, larger: an "Embedding connection" select in LTM's settings that sends PATCH /api/agents/type/long-term-memory with { connectionId }. The Engine already wraps that route with the LTM refresh hook (Engine agents.routes.ts L507-L523, and #1303 for the package side). This would give LTM the per-agent override other agents have. It needs checking whether package client code may call that Engine route.

Why should this be optional?

This changes an existing optional package, not the Engine core. Everything in the minimum stays inside LTM's own status route, UI strings and docs. The Engine already resolves the embedding source; LTM just doesn't show it.

Alternatives considered

  • An LTM-specific embedding model picker: not needed. Engine connections already configure embedding models; what's missing is visibility and a way to pick LTM's connection without changing every agent.
  • Shipping a multilingual model as the built-in default: a much larger download, and it's Engine-owned (local-embedder.ts), so it's out of scope here.
  • Docs only: cheapest, but users still couldn't tell what is active or whether the index matches it.

Additional context

  • #1295 (Korean recall), sections 4 and 5, and its Suggested Investigation question 3. A picker isn't required, but the source must be visible, and today the connection is only individually settable through the Connections bulk action.
  • Related fixes: #1302 and Pasta-Devs/Marinara-Engine#7429 (query/document input type), and #1303 (refresh hook).
  • Source inspection at Agents 11c8a563e7ef33b03442909814366f11330e1aad and Engine ecd62a2e4678d82fae753dd19f0f15cfbe48bba0; not reproduced in a running install.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1304 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Users can't tell which embedding model Long-Term Memory uses, or how to change it. This matters most for non-English vaults (#1295, sections 4 and 5). - **The status only says available or unavailable.** It shows "Semantic search available/unavailable" with no model name (``[ActivityView.tsx L1208-L1214](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/ActivityView.tsx#L1208-L1214),`` ```[LongTermMemoryDetail.tsx L410-L414](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/LongTermMemoryDetail.tsx#L410-L414)).``` - **The status can be stale.** `embeddingsAvailable` is `Boolean(index?.embeddings.embeddedChunkCount)` ([routes.ts L549](````https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts#L549)).```` It keeps saying "available" after the embedding source changes: until the next recall rebuilds the index, or indefinitely if that rebuild failed and the auto-upgrade guard is set. Meanwhile recall reports `semanticOutcome: "incompatible"`. - **The embedding connection can't be chosen from LTM's own UI.** - Embeddings come from the Engine agent config for `long-term-memory`, falling back to the default connection ([Engine capability-module-runtime.service.ts L103-L113](`````https://github.com/Pasta-Devs/Marinara-Engine/blob/ecd62a2e4678d82fae753dd19f0f15cfbe48bba0/packages/server/src/services/capability-packages/capability-module-runtime.service.ts#L103-L113)).````` - LTM's agent page opens in `FeatureAgentDetailHost`, which has no connection picker, unlike the Connection Override in `AgentEditor` that built-in agents get. - The "Extraction connection" in Memory Settings (``````[MemorySettings.tsx L1187-L1197](https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx#L1187-L1197))`````` only affects extraction, not embeddings. - In practice, the only UI that sets LTM's connection is Connections → "apply to all agents", which changes every agent at once. - **The default is English-only, and nothing says so.** The built-in fallback is `Xenova/all-MiniLM-L6-v2`, which was trained on English. For Korean and other non-English vaults the vector lane adds little. ## Proposed package or change Package: `long-term-memory`. The minimum is a small server, client and docs change, with no Engine change. 1. **Status route** ([routes.ts ~L549](```````https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts#L549)),``````` adding the new fields to `ltmStatusResponseSchema`: - `embeddingSource`: the current `resolvePackageEmbeddingAdapter()` `label`, for example "Built-in local MiniLM", "Local Model sidecar" or "My connection (multilingual-e5-large)". - `indexedEmbeddingSource`: `index.embeddings.model`, the label already stored at rebuild ([rebuild.ts L152](````````https://github.com/Pasta-Devs/Marinara-Agents/blob/11c8a563e7ef33b03442909814366f11330e1aad/packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/rebuild.ts#L152)).```````` - `embeddingsAvailable` should also require `index.embeddings.spaceId === adapter.spaceId`, so a switched source no longer reads as available. 2. **Client:** - Show the source on the health line, for example "Semantic search available · Built-in local MiniLM". - When the indexed source and the current source differ, say the vault will be re-embedded on the next recall or reindex. 3. **Help text** under "Extraction connection" in `MemorySettings.tsx`: "Only used for extraction. Recall embeddings use the Long-Term Memory agent's connection (Connections → Semantic Search (Embeddings))." 4. **Guidance**, as in-app help near the semantic status plus a short section in `docs/ARCHITECTURE.md`: - Which connection drives embeddings. - The default MiniLM is English-only. - For Korean, Japanese, Chinese or mixed-language vaults, set a multilingual embedding model on that connection, such as `BAAI/bge-m3` (no prefixes) or multilingual-e5 (needs #1302 and Pasta-Devs/Marinara-Engine#7429). - Switching models re-embeds the vault. - BM25 and keyword lanes only match within one language. With a multilingual model, the vector lane is the only cross-language bridge (#1295, section 5). **Optional, larger:** an "Embedding connection" select in LTM's settings that sends `PATCH /api/agents/type/long-term-memory` with `{ connectionId }`. The Engine already wraps that route with the LTM refresh hook (Engine `agents.routes.ts` L507-L523, and #1303 for the package side). This would give LTM the per-agent override other agents have. It needs checking whether package client code may call that Engine route. ## Why should this be optional? This changes an existing optional package, not the Engine core. Everything in the minimum stays inside LTM's own status route, UI strings and docs. The Engine already resolves the embedding source; LTM just doesn't show it. ## Alternatives considered - **An LTM-specific embedding model picker:** not needed. Engine connections already configure embedding models; what's missing is visibility and a way to pick LTM's connection without changing every agent. - **Shipping a multilingual model as the built-in default:** a much larger download, and it's Engine-owned (`local-embedder.ts`), so it's out of scope here. - **Docs only:** cheapest, but users still couldn't tell what is active or whether the index matches it. ## Additional context - #1295 (Korean recall), sections 4 and 5, and its Suggested Investigation question 3. A picker isn't required, but the source must be visible, and today the connection is only individually settable through the Connections bulk action. - Related fixes: #1302 and Pasta-Devs/Marinara-Engine#7429 (query/document input type), and #1303 (refresh hook). - Source inspection at Agents `11c8a563e7ef33b03442909814366f11330e1aad` and Engine `ecd62a2e4678d82fae753dd19f0f15cfbe48bba0`; not reproduced in a running install. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:33 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#666
No description provided.