mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3627] [Issue]: Semantic search threshold causes unconditional or no lorebook injection #1964
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#1964
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 (Jul 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3627
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Vectorized lorebook entries are injected without a relevant mention when the semantic search score threshold is 0.97 or lower. At thresholds from 0.98 to 1.0, entries are not injected even when words from their definitions are used.
Expected behavior
Semantic search should scan the conversation history and inject only lorebook entries relevant to the current context.
Actual behavior
At a score threshold of 0.97 or lower, vectorized entries are injected regardless of context, including in the first message. At thresholds from 0.98 to 1.0, entries are never injected, even when testing words from the entry definition.
Steps to reproduce
Environment
Logs, screenshots, or video
Screenshots: https://cdn.discordapp.com/attachments/1526770145895252029/1526770146436186262/kO875MHOavE3.png?ex=6a583b00&is=6a56e980&hm=042f3f3aede67dd7cd058a2f76dc7c4a75751f90d74c1358398f85bb62fa41e6&; https://cdn.discordapp.com/attachments/1526770145895252029/1526770147522646056/s.png?ex=6a583b01&is=6a56e981&hm=472b4e669dd67f902437df7969f4b97cffa8e7f4c59fa44c5ecabed18e8ca817&; https://cdn.discordapp.com/attachments/1526770145895252029/1526799367183274026/image.png?ex=6a585637&is=6a5704b7&hm=530137258c34e86f91b28d0d4c0c9675519d4e4dfb6366f02e3dd7f61d920a39&
Additional context
Reported as an addition to https://github.com/Pasta-Devs/Marinara-Engine/issues/3511. The embedding model was not changed. Unrelated injection can spoil RP content and force the user to swipe; in the minimal example, the person did not have a bottle and was not drinking.
Discord thread: Semantic search - useless?
Discord thread link: https://discord.com/channels/1417099416812392641/1526770145895252029
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (4 messages)
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 (Jul 15, 2026):
Claiming this for implementation on
agent/fix-3627-3631-open-issues. I will preserve the current staging prompt and lorebook behavior while adding focused semantic-match regression coverage.@SpicyMarinara commented on GitHub (Jul 15, 2026):
Addressed in #3632. Semantic similarity is now calibrated against a neutral embedding baseline, with prompt regression coverage for clustered raw scores.