[GH-ISSUE #7626] [Feature]: Default embedding model in Connection defaults #4222

Closed
opened 2026-10-21 06:12:43 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ylli-selmani on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7626

Originally assigned to: @ylli-selmani on GitHub.

What problem does this solve?

Embeddings are configured per connection only (the Semantic Search (Embeddings) section of each connection). Connection defaults has rows for Main, Agents, Images, Videos, Audio and the Decision model, but none for embeddings.

Every embedding feature resolves its source from whichever connection happens to be in play: the chat's connection for Memory Recall, Advanced Memory, chat summary retrieval and lorebook semantic matching; the Long-term memory agent's connection (or the Main default) for the Long-term memory package; Professor Mari's connection for her "embeddings configured" check. If that connection has no embedding model, Marinara quietly falls back to the built-in local MiniLM model.

So if you forget the embedding model on one connection, or switch a chat to a connection with a different one, the query vectors land in a different space from the vectors you already built. Lorebook entries and memories are then skipped without an error (the "quiet failure mode" in docs/lorebooks/semantic-search.md). Keeping the same embedding model on every connection by hand is the only way to avoid that.

Proposed solution

Add an Embeddings row to Connection defaults, styled like the Decision model picker: one app-wide embedding source, picked from connections that have an embedding model, plus Local Model (sidecar) when it is available. Empty keeps today's behavior.

On the server, resolveMemoryRecallEmbeddingSource (packages/server/src/services/memory-recall-embedding.ts) gets one new branch: when the resolved connection has no embedding model or embedding connection of its own, use the default embedding source before falling back to the built-in local model. Settings on a connection itself still win, so existing setups keep their current behavior.

Almost every embedding feature already goes through that one resolver (Memory Recall, Advanced Memory, chat summary retrieval, lorebook semantic matching, the Long-term memory capability host, Professor Mari's check, the raw embed route), so they would all pick up the default without separate changes.

The lorebook Vectorize picker would preselect the default embedding source, so entries are vectorized with the same model that chat-time queries use.

Alternatives considered

  • Keep it per connection and document the pitfall better. That is what the docs do today, and it still relies on remembering every connection.
  • Make the default override per-connection settings everywhere. This gives one guaranteed vector space, but it silently changes behavior for anyone who deliberately uses different embedding models per connection.
  • A new defaultForEmbeddings flag column on connections, like defaultForAgents. A single app setting holding the selected connection id needs no schema change.

Additional context

None of the chat-level panels that depend on embeddings (Memory Recall, Advanced Memory Recall, Chat Summary's Semantic retrieval) show which embedding source they will use, so the connection editor is the only place to find out.

Related, seen while scoping (could be a separate issue):

  • The lorebook vectorize route (POST /lorebooks/:id/vectorize) builds its own provider from the picked connection's base URL and key and ignores that connection's Embedding connection override, while chat-time queries honor it. A connection that borrows another connection's key can vectorize into a different embedding space from the one it queries.
  • The lorebook vectorize picker is remembered per browser (localStorage), not saved on the lorebook.
  • The docs call the built-in local fallback Local Model (sidecar) in places. The code has two different local options: the llama.cpp sidecar (only used when picked explicitly) and the built-in ONNX MiniLM embedder (the silent fallback).

Related closed issues: #7042 (refresh LTM after embedding-connection changes), #5104 (vectorized entries silently failing to activate), #4843 (Memory Recall after changing embedding dimensions).

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 @ylli-selmani on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7626 Originally assigned to: @ylli-selmani on GitHub. ## What problem does this solve? Embeddings are configured per connection only (the **Semantic Search (Embeddings)** section of each connection). Connection defaults has rows for Main, Agents, Images, Videos, Audio and the Decision model, but none for embeddings. Every embedding feature resolves its source from whichever connection happens to be in play: the chat's connection for Memory Recall, Advanced Memory, chat summary retrieval and lorebook semantic matching; the Long-term memory agent's connection (or the Main default) for the Long-term memory package; Professor Mari's connection for her "embeddings configured" check. If that connection has no embedding model, Marinara quietly falls back to the built-in local MiniLM model. So if you forget the embedding model on one connection, or switch a chat to a connection with a different one, the query vectors land in a different space from the vectors you already built. Lorebook entries and memories are then skipped without an error (the "quiet failure mode" in `docs/lorebooks/semantic-search.md`). Keeping the same embedding model on every connection by hand is the only way to avoid that. ## Proposed solution Add an **Embeddings** row to Connection defaults, styled like the Decision model picker: one app-wide embedding source, picked from connections that have an embedding model, plus **Local Model (sidecar)** when it is available. Empty keeps today's behavior. On the server, `resolveMemoryRecallEmbeddingSource` (`packages/server/src/services/memory-recall-embedding.ts`) gets one new branch: when the resolved connection has no embedding model or embedding connection of its own, use the default embedding source before falling back to the built-in local model. Settings on a connection itself still win, so existing setups keep their current behavior. Almost every embedding feature already goes through that one resolver (Memory Recall, Advanced Memory, chat summary retrieval, lorebook semantic matching, the Long-term memory capability host, Professor Mari's check, the raw embed route), so they would all pick up the default without separate changes. The lorebook **Vectorize** picker would preselect the default embedding source, so entries are vectorized with the same model that chat-time queries use. ## Alternatives considered - Keep it per connection and document the pitfall better. That is what the docs do today, and it still relies on remembering every connection. - Make the default override per-connection settings everywhere. This gives one guaranteed vector space, but it silently changes behavior for anyone who deliberately uses different embedding models per connection. - A new `defaultForEmbeddings` flag column on connections, like `defaultForAgents`. A single app setting holding the selected connection id needs no schema change. ## Additional context None of the chat-level panels that depend on embeddings (Memory Recall, Advanced Memory Recall, Chat Summary's Semantic retrieval) show which embedding source they will use, so the connection editor is the only place to find out. Related, seen while scoping (could be a separate issue): - The lorebook vectorize route (`POST /lorebooks/:id/vectorize`) builds its own provider from the picked connection's base URL and key and ignores that connection's **Embedding connection** override, while chat-time queries honor it. A connection that borrows another connection's key can vectorize into a different embedding space from the one it queries. - The lorebook vectorize picker is remembered per browser (localStorage), not saved on the lorebook. - The docs call the built-in local fallback **Local Model (sidecar)** in places. The code has two different local options: the llama.cpp sidecar (only used when picked explicitly) and the built-in ONNX MiniLM embedder (the silent fallback). Related closed issues: #7042 (refresh LTM after embedding-connection changes), #5104 (vectorized entries silently failing to activate), #4843 (Memory Recall after changing embedding dimensions). ## 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.
Author
Owner

@ylli-selmani commented on GitHub (Oct 14, 2026):

huh, not sure why my agent assigned you too, @SpicyMarinara. it said 'because AGENTS.md asks for that.', but i haven't seen it before? anyway, sorry

<!-- gh-comment-id:6170738073 --> @ylli-selmani commented on GitHub (Oct 14, 2026): huh, not sure why my agent assigned you too, @SpicyMarinara. it said 'because AGENTS.md asks for that.', but i haven't seen it before? anyway, sorry
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-Engine#4222
No description provided.