mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #227] [MERGED] feat(lorebooks): add description field to lorebook entries (Part of Knowledge-Router Agent PRs) #4516
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#4516
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/227
Author: @cha1latte
Created: 4/25/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara
Base:
main← Head:feat/lorebook-entry-description📝 Commits (2)
4be14e7feat(lorebooks): add description field to lorebook entriesce3be2bfix(lorebooks): align CREATE TABLE with description column and update test fixture📊 Changes
7 files changed (+31 additions, -0 deletions)
View changed files
📝
packages/client/src/components/lorebooks/LorebookEditor.tsx(+16 -0)📝
packages/server/src/db/migrate.ts(+6 -0)📝
packages/server/src/db/schema/lorebooks.ts(+2 -0)📝
packages/server/src/services/storage/lorebooks.storage.ts(+2 -0)📝
packages/server/test/lorebook-processing.test.ts(+1 -0)📝
packages/shared/src/schemas/lorebook.schema.ts(+2 -0)📝
packages/shared/src/types/lorebook.ts(+2 -0)📄 Description
Part 1 of #226 — schema groundwork for the upcoming
knowledge-routeragent.Summary
Adds a
descriptioncolumn tolorebook_entriesand a textarea for it in the entry editor. The field is short AI-facing summary text (one or two sentences) that the futureknowledge-routeragent will use to decide which entries are relevant to the current scene — without paying the cost of summarizing every entry's full content.This PR is schema-only. No agent yet, no behavior change for existing flows. The field defaults to empty and is invisible to all current code paths.
Why
The existing
knowledge-retrievalagent summarizes every enabled entry from the configured source lorebooks before generation. For large lorebooks (One Piece, Wheel of Time, etc.) this gets chunked and adds significant latency and token cost — and forconstant: trueentries, it duplicates work the standard activation pipeline already does. Theknowledge-routeragent (coming in the next PR) will instead read short descriptions and pick entry IDs to inject verbatim. This PR gives users a place to write those descriptions.See issue #226 for the full design and the maintainer's Discord invitation.
Changes
packages/server/src/db/schema/lorebooks.tsdescriptioncolumn onlorebookEntries, defaults to""packages/server/src/db/migrate.tsALTER TABLEmigration entrypackages/shared/src/schemas/lorebook.schema.tsdescriptionfield on create + update Zod schemaspackages/shared/src/types/lorebook.tsdescription: stringonLorebookEntrypackages/server/src/services/storage/lorebooks.storage.tscreateEntry/updateEntrypackages/client/src/components/lorebooks/LorebookEditor.tsxKnown limitations
knowledge-routeragent will fall back to entry name + first 1-2 keys when description is empty, so old lorebooks still work, just less precisely. A future "lorebook description backfill" agent could auto-populate them; out of scope here.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.