[GH-ISSUE #3913] [Issue]: Character-tag lorebook filters apply entries to all characters #2117

Closed
opened 2026-10-21 05:45:31 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Lorebook entries filtered by character tags are injected for every character in group CONVO or RP sessions instead of only the matching character.

Expected behavior

Each character should receive only lorebook entries whose character_tag context filter matches that character. Test_Pasta_Lover should receive the "loves pasta" entry, while Test_Pasta_Hater should receive the "hates pasta" entry.

Actual behavior

Both the "loves pasta" and "hates pasta" entries are injected into the section for both characters, potentially causing character confusion in group chats.

Steps to reproduce

  1. Create a character named "Test_Pasta_Lover" and add the character tag "loves_pasta".
  2. Create a character named "Test_Pasta_Hater" and add the character tag "hates_pasta".
  3. Create a lorebook named "Test".
  4. Add a "Loves Pasta" entry with content "{{char}} loves pasta." and a character_tag context filter for "loves_pasta".
  5. Add a "Hates Pasta" entry with content "{{char}} hates pasta." and a character_tag context filter for "hates_pasta".
  6. Add both characters and the lorebook to a CONVO or RP session.
  7. Interact with the characters and inspect the prompt's sections.

Environment

  • Marinara Engine version: Not provided
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Observed prompt:

Test_Pasta_Lover loves pasta.

Test_Pasta_Lover hates pasta.
Test_Pasta_Hater loves pasta.
Test_Pasta_Hater hates pasta.

Screenshots:

  1. https://cdn.discordapp.com/attachments/1529168779244994581/1529168779668492448/Screenshot_2026-07-21_124142.png?ex=6a60f4e7&is=6a5fa367&hm=03786d2b5d0c0f0511c16170804ee599f53f2db35b05c834ca73c298d574c959&
  2. https://cdn.discordapp.com/attachments/1529168779244994581/1529168780411015331/Screenshot_2026-07-21_124303.png?ex=6a60f4e7&is=6a5fa367&hm=c46a44ec1a77fd571fb56210fe6a936489fb93953707e45f95ad7d133e47265c&
  3. https://cdn.discordapp.com/attachments/1529168779244994581/1529168780796629073/Screenshot_2026-07-21_124338.png?ex=6a60f4e7&is=6a5fa367&hm=3941ecf938334a50779bb02b7eeef64ed0a46702b8c1513b5b71c0b68007495d&
  4. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781216190585/Screenshot_2026-07-21_124454.png?ex=6a60f4e8&is=6a5fa368&hm=d1c91fa945d41eb6f8390f9b05e5c2eef506174b6605c1a44630e7ea2f253293&
  5. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781572571176/Screenshot_2026-07-21_124515.png?ex=6a60f4e8&is=6a5fa368&hm=3aa74527c7713a308e62a25f0e5f4f00fde728be6b65f7230915a49cb2879168&
  6. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781845205084/Screenshot_2026-07-21_124710.png?ex=6a60f4e8&is=6a5fa368&hm=360b3875ca05626900c671a400e665dfbc222adeb3bf6e4d994179a026f95113&

Additional context

The reporter suggests treating lorebook entries containing {{char}} differently from generic knowledge entries. A generic entry defining pasta without {{char}} would be appropriate to inject for all characters, but character-specific entries should respect their character_tag filters.

Discord thread: [Bug] Lorebook entries trigger on all characters
Discord thread link: https://discord.com/channels/1417099416812392641/1529168779244994581
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (1 message)
[2026-07-21T16:50:47.554Z] AgentX: **Steps to reproduce:**

Steps to recreate:

1. Create Character named "Test_Pasta_Lover". Add character tag of "loves_pasta".
2. Create Character named "Test_Pasta_Hater". Add character tag of "hates_pasta".
3. Create Lorebook named "Test". 
4. Add entry of "Loves Pasta" with context filter of "loves_pasta" on character_tag. Context is "{{char}} loves pasta."
5. Add entry of "Hates Pasta" with context filter of "hates_pasta" on character_tag. Context is "{{char}} hates pasta."
6. Add both characters and lorebook to CONVO or RP mode.
7. Interact and inspect prompt <lore> section.

Prompt sent to LLM looks like:
` ` `
<lore>\n    Test_Pasta_Lover loves pasta.\n\n    Test_Pasta_Lover hates pasta.\n</lore>
<lore>\n    Test_Pasta_Hater loves pasta.\n\n    Test_Pasta_Hater hates pasta.\n</lore>
` ` `

I think this is why characters sometimes may get confused when talking to them during group chats, when using lorebook entries unique to each character. Screenshots attached.

I feel lorebook entries that use {{char}} macros might need to be treated differently than "knowledge" articles. For example, if there was a generic entry about "pasta" that defines what pasta is (without using {{char}}), then that would be fine to be injected into the <lore>.

[attached image 1: https://cdn.discordapp.com/attachments/1529168779244994581/1529168779668492448/Screenshot_2026-07-21_124142.png?ex=6a60f4e7&is=6a5fa367&hm=03786d2b5d0c0f0511c16170804ee599f53f2db35b05c834ca73c298d574c959&]
[attached image 2: https://cdn.discordapp.com/attachments/1529168779244994581/1529168780411015331/Screenshot_2026-07-21_124303.png?ex=6a60f4e7&is=6a5fa367&hm=c46a44ec1a77fd571fb56210fe6a936489fb93953707e45f95ad7d133e47265c&]
[attached image 3: https://cdn.discordapp.com/attachments/1529168779244994581/1529168780796629073/Screenshot_2026-07-21_124338.png?ex=6a60f4e7&is=6a5fa367&hm=3941ecf938334a50779bb02b7eeef64ed0a46702b8c1513b5b71c0b68007495d&]
[attached image 4: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781216190585/Screenshot_2026-07-21_124454.png?ex=6a60f4e8&is=6a5fa368&hm=d1c91fa945d41eb6f8390f9b05e5c2eef506174b6605c1a44630e7ea2f253293&]
[attached image 5: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781572571176/Screenshot_2026-07-21_124515.png?ex=6a60f4e8&is=6a5fa368&hm=3aa74527c7713a308e62a25f0e5f4f00fde728be6b65f7230915a49cb2879168&]
[attached image 6: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781845205084/Screenshot_2026-07-21_124710.png?ex=6a60f4e8&is=6a5fa368&hm=360b3875ca05626900c671a400e665dfbc222adeb3bf6e4d994179a026f95113&]
[Discord message: https://discord.com/channels/1417099416812392641/1529168779244994581/1529168779244994581]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Jul 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3913 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Lorebook entries filtered by character tags are injected for every character in group CONVO or RP sessions instead of only the matching character. ## Expected behavior Each character should receive only lorebook entries whose character_tag context filter matches that character. Test_Pasta_Lover should receive the "loves pasta" entry, while Test_Pasta_Hater should receive the "hates pasta" entry. ## Actual behavior Both the "loves pasta" and "hates pasta" entries are injected into the <lore> section for both characters, potentially causing character confusion in group chats. ## Steps to reproduce 1. Create a character named "Test_Pasta_Lover" and add the character tag "loves_pasta". 2. Create a character named "Test_Pasta_Hater" and add the character tag "hates_pasta". 3. Create a lorebook named "Test". 4. Add a "Loves Pasta" entry with content "{{char}} loves pasta." and a character_tag context filter for "loves_pasta". 5. Add a "Hates Pasta" entry with content "{{char}} hates pasta." and a character_tag context filter for "hates_pasta". 6. Add both characters and the lorebook to a CONVO or RP session. 7. Interact with the characters and inspect the prompt's <lore> sections. ## Environment - Marinara Engine version: Not provided - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Observed prompt: <lore> Test_Pasta_Lover loves pasta. Test_Pasta_Lover hates pasta. </lore> <lore> Test_Pasta_Hater loves pasta. Test_Pasta_Hater hates pasta. </lore> Screenshots: 1. https://cdn.discordapp.com/attachments/1529168779244994581/1529168779668492448/Screenshot_2026-07-21_124142.png?ex=6a60f4e7&is=6a5fa367&hm=03786d2b5d0c0f0511c16170804ee599f53f2db35b05c834ca73c298d574c959& 2. https://cdn.discordapp.com/attachments/1529168779244994581/1529168780411015331/Screenshot_2026-07-21_124303.png?ex=6a60f4e7&is=6a5fa367&hm=c46a44ec1a77fd571fb56210fe6a936489fb93953707e45f95ad7d133e47265c& 3. https://cdn.discordapp.com/attachments/1529168779244994581/1529168780796629073/Screenshot_2026-07-21_124338.png?ex=6a60f4e7&is=6a5fa367&hm=3941ecf938334a50779bb02b7eeef64ed0a46702b8c1513b5b71c0b68007495d& 4. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781216190585/Screenshot_2026-07-21_124454.png?ex=6a60f4e8&is=6a5fa368&hm=d1c91fa945d41eb6f8390f9b05e5c2eef506174b6605c1a44630e7ea2f253293& 5. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781572571176/Screenshot_2026-07-21_124515.png?ex=6a60f4e8&is=6a5fa368&hm=3aa74527c7713a308e62a25f0e5f4f00fde728be6b65f7230915a49cb2879168& 6. https://cdn.discordapp.com/attachments/1529168779244994581/1529168781845205084/Screenshot_2026-07-21_124710.png?ex=6a60f4e8&is=6a5fa368&hm=360b3875ca05626900c671a400e665dfbc222adeb3bf6e4d994179a026f95113& ## Additional context The reporter suggests treating lorebook entries containing {{char}} differently from generic knowledge entries. A generic entry defining pasta without {{char}} would be appropriate to inject for all characters, but character-specific entries should respect their character_tag filters. Discord thread: [Bug] Lorebook entries trigger on all characters Discord thread link: https://discord.com/channels/1417099416812392641/1529168779244994581 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (1 message)</summary> ```text [2026-07-21T16:50:47.554Z] AgentX: **Steps to reproduce:** Steps to recreate: 1. Create Character named "Test_Pasta_Lover". Add character tag of "loves_pasta". 2. Create Character named "Test_Pasta_Hater". Add character tag of "hates_pasta". 3. Create Lorebook named "Test". 4. Add entry of "Loves Pasta" with context filter of "loves_pasta" on character_tag. Context is "{{char}} loves pasta." 5. Add entry of "Hates Pasta" with context filter of "hates_pasta" on character_tag. Context is "{{char}} hates pasta." 6. Add both characters and lorebook to CONVO or RP mode. 7. Interact and inspect prompt <lore> section. Prompt sent to LLM looks like: ` ` ` <lore>\n Test_Pasta_Lover loves pasta.\n\n Test_Pasta_Lover hates pasta.\n</lore> <lore>\n Test_Pasta_Hater loves pasta.\n\n Test_Pasta_Hater hates pasta.\n</lore> ` ` ` I think this is why characters sometimes may get confused when talking to them during group chats, when using lorebook entries unique to each character. Screenshots attached. I feel lorebook entries that use {{char}} macros might need to be treated differently than "knowledge" articles. For example, if there was a generic entry about "pasta" that defines what pasta is (without using {{char}}), then that would be fine to be injected into the <lore>. [attached image 1: https://cdn.discordapp.com/attachments/1529168779244994581/1529168779668492448/Screenshot_2026-07-21_124142.png?ex=6a60f4e7&is=6a5fa367&hm=03786d2b5d0c0f0511c16170804ee599f53f2db35b05c834ca73c298d574c959&] [attached image 2: https://cdn.discordapp.com/attachments/1529168779244994581/1529168780411015331/Screenshot_2026-07-21_124303.png?ex=6a60f4e7&is=6a5fa367&hm=c46a44ec1a77fd571fb56210fe6a936489fb93953707e45f95ad7d133e47265c&] [attached image 3: https://cdn.discordapp.com/attachments/1529168779244994581/1529168780796629073/Screenshot_2026-07-21_124338.png?ex=6a60f4e7&is=6a5fa367&hm=3941ecf938334a50779bb02b7eeef64ed0a46702b8c1513b5b71c0b68007495d&] [attached image 4: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781216190585/Screenshot_2026-07-21_124454.png?ex=6a60f4e8&is=6a5fa368&hm=d1c91fa945d41eb6f8390f9b05e5c2eef506174b6605c1a44630e7ea2f253293&] [attached image 5: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781572571176/Screenshot_2026-07-21_124515.png?ex=6a60f4e8&is=6a5fa368&hm=3aa74527c7713a308e62a25f0e5f4f00fde728be6b65f7230915a49cb2879168&] [attached image 6: https://cdn.discordapp.com/attachments/1529168779244994581/1529168781845205084/Screenshot_2026-07-21_124710.png?ex=6a60f4e8&is=6a5fa368&hm=360b3875ca05626900c671a400e665dfbc222adeb3bf6e4d994179a026f95113&] [Discord message: https://discord.com/channels/1417099416812392641/1529168779244994581/1529168779244994581] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:45:31 +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#2117
No description provided.