mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5464] [Feature]: Lorebook Total Entries Macro #3031
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#3031
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 @ylli-selmani on GitHub (Aug 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5464
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Currently the Lorebook Keeper (or a custom agent with Lorebook Edit abilities) has no real way to 'know' what order a new entry should get, which is why they either default to 100, or are handed an explicit number through the
"order": integer,'field in their prompt.However, if the Agent had the total number of entries inside a Lorebook, it could theoretically always increment the order by +1, ensuring that newer entries are placed lower in the final prompt. This could allow one to create an automatic Memory/Event Lorebook with a chronological flow of insertion. (e.g Day 1/Oldest sits at the top, while Day 100/Newest sits at the bottom.) Especially useful when paired with the
{{outlet::name}}to fully contain a specific lorebook to a prompt section, without any pollution.Proposed solution
Simply implement a macro that resolves to the total number of entries inside a lorebook, making use of the unique Lorebook ID each one has =>
{{lorebookSize::lorebookID}} -> e.g 100.Alternatives considered
Some form of toggle placed inside the "Lorebook Write" section inside an agent's settings, that would automatically increment the default order of a new entry. However, since macros are already well established, and the agent's 'updates'-array has a dedicated field for 'order of injection', this seemed like the easiest implementation to me.
Additional context
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: