mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7628] [Issue]: Lorebook Vectorize ignores the connection's Embedding Connection override #4223
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#4223
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/7628
Originally assigned to: @ylli-selmani on GitHub.
Summary
The lorebook Vectorize button builds its embedding request from the picked connection's own base URL and API key and ignores that connection's Embedding Connection setting. Chat-time queries do honor that setting, so the stored vectors and the query vectors can come from different endpoints and end up in different embedding spaces.
Expected behavior
Vectorizing a lorebook with a connection resolves the embedding source the same way chat-time semantic matching does: the Embedding Connection override supplies the key and base URL (and its own embedding model, if it has one), so entries and queries share one embedding space.
Actual behavior
POST /lorebooks/:id/vectorize(packages/server/src/routes/lorebooks.routes.ts) callscreateLLMProviderwith the picked connection'sembeddingBaseUrlorbaseUrland itsapiKey, and uses the model the client sent. It never readsembeddingConnectionId. Chat-time matching goes throughresolveMemoryRecallEmbeddingSource(packages/server/src/services/memory-recall-embedding.ts), which does read it.Because the base URL is part of the embedding space id, the two can disagree. Entries whose space id doesn't match the query's are then skipped in semantic matching, without an error.
Also, the Vectorize picker lists only connections whose own embedding model field is filled in. A connection that gets its model only from its Embedding Connection (empty model field, Embedding Connection set) doesn't appear in the picker at all.
Steps to reproduce
Found by reading the code on
staging(c599d1ef2), not reproduced in the app yet.Environment
stagingatc599d1ef2)Logs, screenshots, or video
None yet; this came from code reading while scoping #7626.
Additional context
Found while scoping #7626 (default embedding model). Routing the vectorize route through
resolveMemoryRecallEmbeddingSourcewould fix both this and the picker gap, and would let the new default apply to vectorizing too.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: