[PR #4814] [MERGED] docs(lorebooks): authoring strategy, a worked example, and macro guidance #6505

Closed
opened 2026-10-23 04:11:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4814
Author: @kolacheee
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @kolacheee

Base: staging ← Head: docs/4792-lorebook-authoring-strategy


📝 Commits (7)

  • 031c964 docs(lorebooks): add authoring strategy, a worked example, and macro guidance
  • f670cb1 docs(lorebooks): add a per-parameter use-case reference
  • d8a588e docs(lorebooks): character-filter per-generation note, weighted random, common pitfalls
  • 3035739 docs(lorebooks): add reusing-lore-across-chats guidance and an authoring checklist
  • 5bed85b docs(lorebooks): address CodeRabbit review on #4814
  • 7fdacdd Merge branch 'staging' into docs/4792-lorebook-authoring-strategy
  • 1545113 docs(lorebooks): complete the semantic-search note in the 'never fires' pitfall

📊 Changes

2 files changed (+263 additions, -1 deletions)

View changed files

📝 docs/lorebooks/entries.md (+262 -0)
📝 docs/lorebooks/overview.md (+1 -1)

📄 Description

Linked issue

Closes #4792

Why this change

The lorebook docs explained what every control does, but every worked example was skeletal (name + keys + content) and there was no guidance on when to reach for each control. This adds authoring strategy, a non-skeletal worked example, and macro guidance so authors — and Professor Mari, once she is pointed at docs_read (see #4791 / #4796) — have something better than the lowest-common-denominator entry to imitate.

What changed

  • entries.md — Authoring strategy section: maps each situation to the right control ("when should the AI see this fact?"), plus healthy-lorebook habits, and a "structure lore as a tree" pattern — hub entries that list their members/cities, with recursion left off so a passing mention of the group does not cascade the whole subtree into the prompt.
  • entries.md — Worked example: a non-skeletal gothic-Wallachia setting that builds from a Constant premise through keyed entries, a multi-control entry (Selective + secondary keys + Whole Words + Order + Description) with a per-control justification, and a Group + Probability pair — directly modeling stacked advanced parameters.
  • entries.md — @ Depth caution: it injects text inside the chat history and reads like an interruption, so it is flagged as a sparing, purposeful tool rather than a default.
  • entries.md — "Using macros in entry content": entry content is macro-expanded before injection; {{// comment}} is stripped from the output; and — correcting a common misconception — recursion re-scans the expanded content, so a macro's output can feed recursion but a stripped {{// comment}} cannot.
  • overview.md: points to the new authoring guidance.

Every mechanics claim was verified against the code (constant activation, whole-word matching, selective + selectiveLogic, group mutual-exclusion, order + budget trimming, depth injection, probability, semantic/embedding requirement, Description → Knowledge Router, and the macro + recursion behavior).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated (run locally, green — boxes left unticked for the human to confirm):

  • docs-language regression passes across all 11 language packs (en, de, es, fr, hi, ja, ko, pl, pt-br, ru, zh-hans).
  • All internal links in the changed files resolve to existing docs.

Worth a human pass:

  • Read the new sections in the rendered docs viewer for tone/flow and to confirm the blockquote @ Depth example renders cleanly.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

This is a docs-only change under docs/lorebooks/. The 11 translated packs on the docs-i18n branch need to be updated to match — tracked as the [docs-i18n] follow-up issue #4815. No version bump.

Summary by CodeRabbit

  • Documentation
    • Added guidance on using @ Depth, including examples of content inserted between chat messages.
    • Added comprehensive lorebook authoring strategies, covering entry types, keywords, grouping, semantic matching, organization, reuse, macros, recursion, pitfalls, and a checklist.
    • Added a worked gothic-horror example demonstrating multiple entry configurations.
    • Updated the first-entry tutorial to reference the new strategy and example sections.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4814 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/9/2026 **Status:** ✅ Merged **Merged:** 8/9/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `docs/4792-lorebook-authoring-strategy` --- ### 📝 Commits (7) - [`031c964`](https://github.com/Pasta-Devs/Marinara-Engine/commit/031c9641ea0330c8969a436448b1221d2060370a) docs(lorebooks): add authoring strategy, a worked example, and macro guidance - [`f670cb1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f670cb117bba7d16c49783a94a11ee88db24b6dd) docs(lorebooks): add a per-parameter use-case reference - [`d8a588e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d8a588ebd3a309459fc7cea9fa7b1d1bd6fab5ad) docs(lorebooks): character-filter per-generation note, weighted random, common pitfalls - [`3035739`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3035739029f9827f1a73d64679d8f2cb763854e0) docs(lorebooks): add reusing-lore-across-chats guidance and an authoring checklist - [`5bed85b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5bed85baad82669e51a0466d3ac148a7c2ea3944) docs(lorebooks): address CodeRabbit review on #4814 - [`7fdacdd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7fdacdd8c87f5a5560bb9529636ff554e9bd72b0) Merge branch 'staging' into docs/4792-lorebook-authoring-strategy - [`1545113`](https://github.com/Pasta-Devs/Marinara-Engine/commit/15451131b760435f391d677abd7849a839be536a) docs(lorebooks): complete the semantic-search note in the 'never fires' pitfall ### 📊 Changes **2 files changed** (+263 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/lorebooks/entries.md` (+262 -0) 📝 `docs/lorebooks/overview.md` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #4792 ## Why this change The lorebook docs explained what every control does, but every worked example was skeletal (name + keys + content) and there was no guidance on *when* to reach for each control. This adds authoring strategy, a non-skeletal worked example, and macro guidance so authors — and Professor Mari, once she is pointed at `docs_read` (see #4791 / #4796) — have something better than the lowest-common-denominator entry to imitate. ## What changed - **`entries.md` — Authoring strategy section**: maps each situation to the right control ("when should the AI see this fact?"), plus healthy-lorebook habits, and a **"structure lore as a tree"** pattern — hub entries that list their members/cities, with recursion left off so a passing mention of the group does not cascade the whole subtree into the prompt. - **`entries.md` — Worked example**: a non-skeletal gothic-Wallachia setting that builds from a `Constant` premise through keyed entries, a **multi-control entry** (Selective + secondary keys + Whole Words + Order + Description) with a per-control justification, and a `Group` + `Probability` pair — directly modeling stacked advanced parameters. - **`entries.md` — `@ Depth` caution**: it injects text *inside* the chat history and reads like an interruption, so it is flagged as a sparing, purposeful tool rather than a default. - **`entries.md` — "Using macros in entry content"**: entry content is macro-expanded before injection; `{{// comment}}` is stripped from the output; and — correcting a common misconception — recursion re-scans the *expanded* content, so a macro's output can feed recursion but a stripped `{{// comment}}` cannot. - **`overview.md`**: points to the new authoring guidance. Every mechanics claim was verified against the code (constant activation, whole-word matching, selective + `selectiveLogic`, group mutual-exclusion, order + budget trimming, depth injection, probability, semantic/embedding requirement, Description → Knowledge Router, and the macro + recursion behavior). ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated (run locally, green — boxes left unticked for the human to confirm): - `docs-language` regression passes across all 11 language packs (en, de, es, fr, hi, ja, ko, pl, pt-br, ru, zh-hans). - All internal links in the changed files resolve to existing docs. Worth a human pass: - Read the new sections in the rendered docs viewer for tone/flow and to confirm the blockquote `@ Depth` example renders cleanly. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) This is a docs-only change under `docs/lorebooks/`. The 11 translated packs on the `docs-i18n` branch need to be updated to match — tracked as the `[docs-i18n]` follow-up issue #4815. No version bump. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added guidance on using `@ Depth`, including examples of content inserted between chat messages. * Added comprehensive lorebook authoring strategies, covering entry types, keywords, grouping, semantic matching, organization, reuse, macros, recursion, pitfalls, and a checklist. * Added a worked gothic-horror example demonstrating multiple entry configurations. * Updated the first-entry tutorial to reference the new strategy and example sections. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6505
No description provided.