mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6495
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4779
Author: @kolacheee
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @kolacheee
Base:
staging← Head:feat/4768-relevance-ranked-names📝 Commits (6)
b9429cefeat(mari): rank the available-names list by conversation relevance (#4768)b1c81a9fix(mari): address adversarial review of the relevance-ranked list5c0779bMerge branch 'staging' into feat/4768-relevance-ranked-names06ee63bfix(mari): address CodeRabbit review of the #4768 semantic PR6ff68f4Merge branch 'staging' into feat/4768-relevance-ranked-names670f2aafix(mari): address CodeRabbit review of the relevance-ranked PR (#4768)📊 Changes
4 files changed (+193 additions, -1 deletions)
View changed files
📝
package.json(+1 -1)📝
packages/server/src/routes/generate.routes.ts(+12 -0)📝
packages/server/src/routes/generate/professor-mari-prompt-context.ts(+0 -0)➕
scripts/regressions/professor-mari-relevance-names.regression.ts(+180 -0)📄 Description
Linked issue
Part of #4768 (phase 3 — makes the injected list carry its weight now that fetch does resolution).
Why this change
Phase 2 (#4778) gave Mari's
[fetch:]full-library resolution (exact → substring → semantic), which made the injected<available_names>list mostly redundant for finding things — its remaining job is awareness. But it was still an alphabetical slice of up to 100/type, which is both the recurring token cost the issue flagged and an arbitrary ordering (the entities you're actually discussing are rarely the alphabetically-first ones).What changed
When the conversation can be embedded, the
<available_names>list is now ranked by semantic relevance to the current message and trimmed to a small top-K (default 12/type) — the entities that matter right now — instead of an alphabetical 100. Cheaper on a large library, and the names Mari sees are the relevant ones. Fetch still resolves the long tail, so nothing is lost.Design points that keep it cheap and honest (all tightened by an adversarial review before this went up):
Known follow-up (noted, not blocking): the ranking re-scans the entity tables in-memory each pass (bounded, O(n), cheap next to the embed the memo removed); a lighter read-only projection could remove even that.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated (green), not a substitute for the human pass:
pnpm checkgreen; fullregression:issues+regression:prompt+professor-marilanes green.professor-mari-relevance-namesregression (real DB + deterministic stub embedder): relevance-first ordering, re-ranking as the conversation changes, cold-library → alphabetical (not creation-order), the alphabetical/empty-query degrade paths, and query-embedded-once-per-turn memoization. The phase-1professor-mari-prompt-contextregression still passes unchanged (the alphabetical path is the preserved floor).Human pass needed (needs a real embedder + LLM):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Prompt-internal behavior; no user docs reference the name-list ordering.
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.