mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #226] [Feature]: Add knowledge-router agent: lower-cost alternative to knowledge-retrieval #87
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#87
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 @cha1latte on GitHub (Apr 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/226
Background
In Discord, a user proposed a leaner alternative to the existing
knowledge-retrievalagent. SpicyMarinara replied:(link to Discord thread)
I'd like to take this on. Opening this issue as a tracking hub for the design and the PRs that will land it.
Problem
The current
knowledge-retrievalagent has two costs that grow with lorebook size:constant: trueare already injected by standard lorebook activation, but they also get re-summarized by the retrieval agent. Same content, two copies, two token bills.Proposed solution
A new agent type
knowledge-routerthat routes to entries instead of extracting from them.Pipeline:
name + description. Skipconstant: trueentries (already in context).AgentResultof typecontext_injection.Both agents coexist. Users who prefer the current behavior keep it. The agent settings UI will warn if both are enabled in the same pipeline.
Schema change
Lorebook entries don't currently have a description field. Adding one:
description: textonlorebookEntries, default empty string.Implementation plan
Splitting into three reviewable PRs that land in order:
descriptionknowledge-routeragent: prompt, type registration, server wiring, tests, benchmarkEach PR will reference this issue.
Out of scope
embeddingcolumn on entries (separate purpose, not repurposed here).knowledge-retrievalitself.Design decisions
Empty descriptions: fall back to
name + first 1-2 keys, don't skip.Skipping silently makes entries invisible to the router — a footgun users won't notice until a scene breaks. Names + keys usually carry enough signal ("Luffy" + keys
luffy, monkey d luffy, straw hattells the LLM what it is). The description-coverage badge in PR 3 nudges users toward filling them in over time.Recommended model: pinned capable model, soft warning on
auto-model.The agent emits strict JSON, and
auto-modelroutes opaquely (currently to Gemini Pro, but that can change). The settings panel defaults the agent's model picker to a pinned recommendation (Claude Sonnet+, GPT-4 class, Gemini Pro) and shows a soft warning — not a block — if the user picksauto-model. Mirrors how other strict-JSON agents in the codebase are already handled.Description field is opt-in, not required. The router catalog uses
entry.descriptionwhen filled in, and falls back to the first ~60 tokens ofentry.content(then name + keys) when blank. This keeps the router useful out of the box for casual users while letting power users tune precision by writing tight summaries.Benchmarks: split between CI and manual.
This keeps CI fast and deterministic while still producing the data that turns a claim into evidence.