[GH-ISSUE #3190] [Issue]: Knowledge Router's output doesn't appear anywhere #1713

Closed
opened 2026-10-21 05:41:56 +07:00 by bsakaguchi · 10 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The issue I reported in #2874 is still happening (I don't have permission to reopen it, though).

Now I can't get it to work even in a fresh chat, or with a tiny (5 entries) lorebook.

Steps to reproduce

  1. Knowledge Router enabled, prompt section included in preset, Lorebook manually connected.
  2. API call goes through.
  3. Prompt inspector doesn't display the output.

Environment

  • Marinara Engine version: 2.0.9
  • Install type: Installer
  • OS + version: Windows 11 Pro
  • Browser or app shell: Browser

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 @WaterBloom on GitHub (Jul 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3190 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The issue I reported in #2874 is still happening (I don't have permission to reopen it, though). Now I can't get it to work even in a fresh chat, or with a tiny (5 entries) lorebook. ## Steps to reproduce 1. Knowledge Router enabled, prompt section included in preset, Lorebook manually connected. 2. API call goes through. 3. Prompt inspector doesn't display the output. ## Environment - Marinara Engine version: 2.0.9 - Install type: Installer - OS + version: Windows 11 Pro - Browser or app shell: Browser ## 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:41:56 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

You mean, it doesn't recall any lorebook entries? Maybe it didn't find any entries worth recalling? I'll ensure it's included in the debug agent outputs in the agents button so you can verify what it returned.

<!-- gh-comment-id:4881564788 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): You mean, it doesn't recall any lorebook entries? Maybe it didn't find any entries worth recalling? I'll ensure it's included in the debug agent outputs in the agents button so you can verify what it returned.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Addressed in draft PR #3199.

<!-- gh-comment-id:4881612836 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Addressed in draft PR #3199.
Author
Owner

@WaterBloom commented on GitHub (Jul 4, 2026):

@SpicyMarinara Hello! Thank you for checking in.

I mean the entire section (of Knowledge Router) doesn't show up, no matter what.

I listed a few things I tried in the old issue, but here's what I've tested recently, hopefully it can clarify:

  1. I added plain text to my preset, to the Knowledge Router section (just something short, like This where additional lore will be... {{agent::knowledge-router}}). When Knowledge Router is disabled in the chat, the section shows up with my text. When the agent is enabled, the entire section vanishes, text included.
  2. On top of normal Lorebook stuff, I included test entries ("always relevant when X character is present in the scene" etc. in the description), reinforcing it to the best of my ability so it would surface.
  3. I also included LLM instructions in the test entry. The main model writing the scene always ignored these, so I'm pretty sure it's not just sneakily passing in the background (i.e. it's not just the prompt inspector being broken, it genuinely doesn't get sent to the writing model).
  4. And the main clue it is surfacing entries correctly: my API call shows input and output tokens. I disabled other agents and used different model just for this, so I can be 100% sure it's Knowledge Router. This API call usually returns anywhere between 500-2500 tokens, so it's finding something.

Appreciate the extra diagnostic option, thank you!

<!-- gh-comment-id:4881707797 --> @WaterBloom commented on GitHub (Jul 4, 2026): @SpicyMarinara Hello! Thank you for checking in. I mean the entire section (of Knowledge Router) doesn't show up, no matter what. I listed a few things I tried in the old issue, but here's what I've tested recently, hopefully it can clarify: 1. I added plain text to my preset, to the Knowledge Router section (just something short, like `This where additional lore will be... {{agent::knowledge-router}}`). When Knowledge Router is disabled in the chat, the section shows up with my text. When the agent is enabled, the _entire_ section vanishes, text included. 3. On top of normal Lorebook stuff, I included **test entries** ("always relevant when X character is present in the scene" etc. in the description), reinforcing it to the best of my ability so it would surface. 4. I also included **LLM instructions** in the test entry. The main model writing the scene always ignored these, so I'm pretty sure it's not just sneakily passing in the background (i.e. it's not just the prompt inspector being broken, it genuinely doesn't get sent to the writing model). 5. And the main clue it is surfacing entries correctly: my API call shows input and output tokens. I disabled other agents and used different model just for this, so I can be 100% sure it's Knowledge Router. **This API call usually returns anywhere between 500-2500 tokens**, so it's finding something. Appreciate the extra diagnostic option, thank you!
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Pookie, I think you're misunderstanding how KR works. It decided which lorebook entries to include, so you will only potentially see lorebook entries activated in your roleplay.

<!-- gh-comment-id:4881718491 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Pookie, I think you're misunderstanding how KR works. It decided which lorebook entries to include, so you will only potentially see lorebook entries activated in your roleplay.
Author
Owner

@WaterBloom commented on GitHub (Jul 4, 2026):

Pardon? I understand that part, of course. :/ It does not activate any. No matter how relevant to the scene.

<!-- gh-comment-id:4881722148 --> @WaterBloom commented on GitHub (Jul 4, 2026): Pardon? I understand that part, of course. :/ It does not activate _any_. No matter how relevant to the scene.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Check on staging what output it returns in the agent menu in the top left corner!

<!-- gh-comment-id:4881730397 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Check on staging what output it returns in the agent menu in the top left corner!
Author
Owner

@WaterBloom commented on GitHub (Jul 4, 2026):

@SpicyMarinara I'm unsure if I can access the staging version yet (restarted server anyways), but this is what happens in my fresh test chat:

Left menu: agents thinking... running... Then No agent activity yet.

My provider:

  • (Knowledge Router) API call: 8,713 → 1,082 token output
  • (Writing) API call: 7,456 → 1,154 (this part works)

So again, it is flagging the entries as relevant, because otherwise it wouldn't output 1k tokens, right?
I sent another reply, intentionally mentioning more characters that exist in the Lorebook. The next reply had this:

(Knowledge Router) API call: 8,698 input → 2,426 token output

You can see it's bigger output, so I think it correctly found their own entries.

It's just still not showing up in the assembled prompt.

<!-- gh-comment-id:4881865454 --> @WaterBloom commented on GitHub (Jul 4, 2026): @SpicyMarinara I'm unsure if I can access the staging version yet (restarted server anyways), but this is what happens in my fresh test chat: Left menu: _agents thinking... running..._ Then _No agent activity yet._ My provider: - **_(Knowledge Router) API call: 8,713 → 1,082 token output_** - (Writing) API call: 7,456 → 1,154 (this part works) So again, it is flagging the entries as relevant, because otherwise it wouldn't output 1k tokens, right? I sent another reply, intentionally mentioning more characters that exist in the Lorebook. The next reply had this: **_(Knowledge Router) API call: 8,698 input → 2,426 token output_** You can see it's bigger output, so I think it correctly found their own entries. It's just still not showing up in the assembled prompt.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Okay, thank you. Now let me investigate why they're not showing. I assume they're not showing in Active Context either? Are they sent to the model in the logs in the console?

<!-- gh-comment-id:4881915181 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Okay, thank you. Now let me investigate why they're not showing. I assume they're not showing in Active Context either? Are they sent to the model in the logs in the console?
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Opened draft PR #3205 with a narrower fix for the disappearing Knowledge Router section and parser aliases. The fix keeps surrounding preset text when the router resolves empty, prunes macro-only sections cleanly, and accepts common selected-ID JSON shapes so routed entries become actual prompt injections.

<!-- gh-comment-id:4881950630 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Opened draft PR #3205 with a narrower fix for the disappearing Knowledge Router section and parser aliases. The fix keeps surrounding preset text when the router resolves empty, prunes macro-only sections cleanly, and accepts common selected-ID JSON shapes so routed entries become actual prompt injections.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Check on staging again.

<!-- gh-comment-id:4881981177 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Check on staging again.
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#1713
No description provided.