mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7626] [Feature]: Default embedding model in Connection defaults #4222
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4222
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
defaultForEmbeddingsflag column on connections, likedefaultForAgents. 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):
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.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:
@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