mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5104] [Issue]: Vectorized lorebook entries can silently fail to activate #2824
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#2824
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 @SpicyMarinara on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5104
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Vectorized lorebook entries can fail to activate even when the embedding endpoint is called successfully and the latest user message exactly matches the entry content. The failure is silent: no entry appears in Active Context or the assembled generation prompt, and the available logs do not explain why the match was rejected.
This appears to be an Engine-side embedding compatibility and provenance problem rather than simply poor embedding-model quality.
Expected behavior
An enabled, vectorized lorebook entry whose content exactly matches the current user message should be retrieved and injected into the roleplay context, even when the entry has no keyword triggers.
If stored vectors cannot be compared safely with the configured query embedding source, Marinara Engine should identify the mismatch and provide a useful warning instead of silently returning no matches.
Actual behavior
The embedding model is invoked, but no lorebook match is found:
Steps to reproduce
Rocks stones mountain ore.Casual-Autopsy/snowflake-arctic-embed-l-v2.0-gguf:Q8_0.Rocks stones mountain ore.Environment
Casual-Autopsy/snowflake-arctic-embed-l-v2.0-gguf:Q8_0Logs, screenshots, or video
The embedding backend logs show that the embedding model is invoked, but Marinara Engine reports no semantic lorebook match. No Engine-side error is emitted.
Additional context
Code inspection found several independent Engine-side failure risks:
selectLorebookVectorQueryTextinpackages/server/src/services/lorebook/embeddings.tsconcatenates the last 10 messages by default. In a new roleplay, the character opening and other history can dilute a short exact user query.packages/server/src/routes/lorebooks.routes.tsstores only the numeric vector. It does not persist the connection, provider, model, base URL, query/document formatting, pooling mode, or another embedding-space identifier.packages/server/src/services/memory-recall-embedding.ts. It can therefore compare stored vectors against a different model or configuration without detecting the mismatch when dimensions happen to agree.BaseLLMProvider.embedsends a generic OpenAI-compatible{ input, model }request for both indexed documents and retrieval queries. Snowflake Arctic Embed v2.0 documents an asymmetric retrieval format: queries require aquery:prefix while documents do not, and the model recommends CLS pooling. Marinara Engine currently has no way to express this distinction.packages/server/src/services/lorebook/keyword-scanner.tssilently treats unequal vector dimensions as similarity0and does not expose rejected candidate scores or reasons.Model documentation: https://huggingface.co/Snowflake/snowflake-arctic-embed-l-v2.0
Suggested acceptance criteria:
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Aug 15, 2026):
SpicyMarinara is taking this in
fix/5104-lorebook-vector-compat; a draft PR will be linked after the first compatibility slice is committed.