mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #927] [Feature]: Use semantic lorebook candidates for Knowledge Router #452
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#452
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 @Promansis on GitHub (May 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/927
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
The Knowledge Router currently depends heavily on the source lorebook candidate list and keyword activation behavior. For large lorebooks, this can make routing less precise and more expensive because the router may need to consider too many entries, while also missing entries that are relevant by meaning but not by exact trigger keys.
This is especially noticeable for lorebooks where entry names, descriptions, or content are semantically related to the current scene, but the conversation does not contain the exact configured key phrase.
Proposed solution
Add a semantic candidate-preparation layer for Knowledge Router lorebook entries.
The router should be able to:
Alternatives considered
A keyword-only router path is simpler, but it can miss relevant lorebook entries unless users maintain very broad key lists.
Routing over every eligible lorebook entry preserves coverage, but it can produce oversized catalogs and make the router less reliable on large source lorebooks.
Additional context
This should integrate with the existing memory recall embedding source rather than introducing a separate embedding configuration path.
The implementation should include tests for embedding text construction, embedding warmup behavior, cosine similarity, semantic top-K ranking, fallback behavior, and router candidate merging.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: