[GH-ISSUE #8145] [Feature]: Attach a per-chat lorebook to each writing and tracking agent #7581

Closed
opened 2026-10-24 04:04:28 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8145

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

A writing or tracking agent may need reference information from a particular lorebook without adding that lorebook to every agent's context or to the main reply. Users also need different attachments for the same agent in different chats.

Proposed solution

Add an optional lorebook attachment to every writing and tracking agent, configured in Chat Settings → Agents → the specific agent's menu.

  • Show a toggle labelled "Attach lorebook for the specific agent", off by default.
  • When enabled, show a dropdown directly below it to select one lorebook.
  • Save both the enabled state and selected lorebook per chat and per agent. Changing one chat's attachment must not change the agent's global definition or another chat.
  • Use the selected lorebook as an additional source of information for that agent. Entries should activate through the ordinary lorebook trigger rules for the context the agent receives, rather than injecting the entire book unconditionally.
  • Keep this attachment scoped to the selected agent. It must not automatically activate the lorebook for the main reply or unrelated agents.
  • Grouped agents are the exception: when the selected agent runs in a group with other agents, the activated entries may be available in that group's normal shared context.
  • Turning the toggle off stops this attachment from contributing reference context.
  • Cover all writing and tracking agents through the shared host setting, rather than adding this option only to one particular agent.

Handle an empty lorebook library and a deleted or unavailable selected lorebook clearly. Keep the controls usable on mobile and consistent with the active theme; localize new UI text.

Alternatives considered

Attaching the lorebook to the whole chat does not provide the requested agent-specific scope. A global agent setting does not provide the requested per-chat configuration.

Existing custom-agent lorebook triggering may provide reusable plumbing, but it does not replace this requested per-chat control and coverage for every writing and tracking agent.

Additional context

Requested by and assigned to @SpicyMarinara. This issue records the feature request; implementation has not started.

This belongs in Marinara Engine because it concerns Chat Settings, per-chat persistence, lorebook activation and agent/group prompt orchestration. Reuse the existing lorebook scanner and agent-context mechanisms where appropriate.

Suggested verification for implementation:

  • Two agents in one chat can select different lorebooks without leaking attached entries into each other's independent calls or the main reply.
  • The same agent can have different selections in two chats; both survive reload.
  • Default-off and subsequently disabled attachments contribute no additional lorebook entries.
  • Matching and non-matching entries follow ordinary trigger rules, and grouped execution respects its shared context.
  • Every writing and tracking agent exposes the setting; empty/deleted selections, mobile layout and theme appearance are covered.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8145 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? A writing or tracking agent may need reference information from a particular lorebook without adding that lorebook to every agent's context or to the main reply. Users also need different attachments for the same agent in different chats. ## Proposed solution Add an optional lorebook attachment to **every writing and tracking agent**, configured in **Chat Settings → Agents → the specific agent's menu**. - Show a toggle labelled **"Attach lorebook for the specific agent"**, **off by default**. - When enabled, show a dropdown directly below it to select **one lorebook**. - Save both the enabled state and selected lorebook **per chat and per agent**. Changing one chat's attachment must not change the agent's global definition or another chat. - Use the selected lorebook as an additional source of information for that agent. Entries should activate through the ordinary lorebook trigger rules for the context the agent receives, rather than injecting the entire book unconditionally. - Keep this attachment scoped to the selected agent. It must not automatically activate the lorebook for the main reply or unrelated agents. - **Grouped agents are the exception:** when the selected agent runs in a group with other agents, the activated entries may be available in that group's normal shared context. - Turning the toggle off stops this attachment from contributing reference context. - Cover all writing and tracking agents through the shared host setting, rather than adding this option only to one particular agent. Handle an empty lorebook library and a deleted or unavailable selected lorebook clearly. Keep the controls usable on mobile and consistent with the active theme; localize new UI text. ## Alternatives considered Attaching the lorebook to the whole chat does not provide the requested agent-specific scope. A global agent setting does not provide the requested per-chat configuration. Existing custom-agent lorebook triggering may provide reusable plumbing, but it does not replace this requested per-chat control and coverage for every writing and tracking agent. ## Additional context Requested by and assigned to **@SpicyMarinara**. This issue records the feature request; implementation has not started. This belongs in Marinara Engine because it concerns Chat Settings, per-chat persistence, lorebook activation and agent/group prompt orchestration. Reuse the existing lorebook scanner and agent-context mechanisms where appropriate. Suggested verification for implementation: - Two agents in one chat can select different lorebooks without leaking attached entries into each other's independent calls or the main reply. - The same agent can have different selections in two chats; both survive reload. - Default-off and subsequently disabled attachments contribute no additional lorebook entries. - Matching and non-matching entries follow ordinary trigger rules, and grouped execution respects its shared context. - Every writing and tracking agent exposes the setting; empty/deleted selections, mobile layout and theme appearance are covered. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 23, 2026):

@SpicyMarinara (Codex) is implementing the per-chat lorebook attachment flow in #8153. It covers official writing/tracking agents and custom agents, reusing existing trigger machinery and preserving agent/group context boundaries. The custom-agent creation notice portion of #8148 is separately owned by #8150. No contributor-covered issue work is being duplicated.

<!-- gh-comment-id:6361085390 --> @SpicyMarinara commented on GitHub (Oct 23, 2026): @SpicyMarinara (Codex) is implementing the per-chat lorebook attachment flow in #8153. It covers official writing/tracking agents and custom agents, reusing existing trigger machinery and preserving agent/group context boundaries. The custom-agent creation notice portion of #8148 is separately owned by #8150. No contributor-covered issue work is being duplicated.
bsakaguchi 2026-11-07 16:42:10 +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#7581
No description provided.