[GH-ISSUE #854] [Issue]: Knowledge Retrieval agent roleplays in-character instead of summarizing #409

Closed
opened 2026-10-20 17:28:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @cha1latte on GitHub (May 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/854

Originally assigned to: @Promansis on GitHub.

Summary

The Knowledge Retrieval agent can roleplay in-character instead of summarizing source material. A user report indicates this is caused by the non-user-editable prompt formatting for conversation data.

Source: Discord report from Danshi. https://discord.com/channels/1417099416812392641/1504387432898887751

Expected behavior

The Knowledge Retrieval agent should summarize or retrieve from the supplied source material, not produce an in-character RP response.

Actual behavior

With the default agent prompt preset, the Knowledge Retrieval agent often responds in-character. In the reporter's test setup, 9 out of 10 default-prompt runs produced in-character RP output instead of the requested knowledge retrieval summary.

Steps to reproduce

  1. Run Marinara Engine 1.5.9.
  2. Use RP chat with the Knowledge Retrieval agent.
  3. Use a lorebook describing locations, around 2100 tokens.
  4. Continue RP for around 10 messages of 2 to 3 paragraphs each, with characters moving through the locations in the lorebook.
  5. Send the last 5 conversation messages, around 1200 tokens, to the Knowledge Retrieval agent.
  6. Compare behavior with the default agent prompt preset.
  7. Observe that the agent may answer in-character instead of summarizing the source material.

Marinara Engine version

1.5.9

Install type

Not specified.

OS + version

Not specified.

Browser or app shell

Not specified.

Screenshots or video

Not a visual/UI issue.

Logs

No logs included.

Additional context

Mode: RP chat.

Agent: Knowledge Retrieval.

Model used in reporter's test: gemma-4-E2B-it-Q8_0.

Reporter's diagnosis/fix proposal:

  • Strip <|turn>user ...<turn|><|turn>model ...<turn|> tags from conversation data.
  • Format conversation messages as {{user}}: [...] and {char}: [...].
  • Encapsulate conversation data in a <conversation_messages> tag.
  • Move Fulfill the requested task and return the output in the format specified: from the start of the <agent> section into a user message at the end of the prompt.

Reporter's test result:

Default Agent Prompt Preset, 10 runs:

  • Summarized source data + lore: 1
  • Summarized source data + lore + conversation: 0
  • In-character RP response: 9

Custom Agent Prompt Preset, 10 runs:

  • Summarized source data + lore: 8
  • Summarized source data + lore + conversation: 2
  • In-character RP response: 0

Reporter additionally recommends removing the <lore> section from the Knowledge Retrieval agent prompt preset, or explicitly instructing the agent not to summarize <lore> or <conversation_messages>. They also noted that lore already sent to the main model should be stripped from <source_material> sent to the agent to avoid duplication.

The Discord report referenced an attached custom prompt preset text file, but no uploadable file was provided to Codex. Filing the details visible in the report.

Template check

  • I provided the required summary, behavior, reproduction, and environment details.
  • If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
Originally created by @cha1latte on GitHub (May 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/854 Originally assigned to: @Promansis on GitHub. ### Summary The Knowledge Retrieval agent can roleplay in-character instead of summarizing source material. A user report indicates this is caused by the non-user-editable prompt formatting for conversation data. Source: Discord report from Danshi. https://discord.com/channels/1417099416812392641/1504387432898887751 ### Expected behavior The Knowledge Retrieval agent should summarize or retrieve from the supplied source material, not produce an in-character RP response. ### Actual behavior With the default agent prompt preset, the Knowledge Retrieval agent often responds in-character. In the reporter's test setup, 9 out of 10 default-prompt runs produced in-character RP output instead of the requested knowledge retrieval summary. ### Steps to reproduce 1. Run Marinara Engine 1.5.9. 2. Use RP chat with the Knowledge Retrieval agent. 3. Use a lorebook describing locations, around 2100 tokens. 4. Continue RP for around 10 messages of 2 to 3 paragraphs each, with characters moving through the locations in the lorebook. 5. Send the last 5 conversation messages, around 1200 tokens, to the Knowledge Retrieval agent. 6. Compare behavior with the default agent prompt preset. 7. Observe that the agent may answer in-character instead of summarizing the source material. ### Marinara Engine version 1.5.9 ### Install type Not specified. ### OS + version Not specified. ### Browser or app shell Not specified. ### Screenshots or video Not a visual/UI issue. ### Logs No logs included. ### Additional context Mode: RP chat. Agent: Knowledge Retrieval. Model used in reporter's test: gemma-4-E2B-it-Q8_0. Reporter's diagnosis/fix proposal: - Strip `<|turn>user ...<turn|><|turn>model ...<turn|>` tags from conversation data. - Format conversation messages as `{{user}}: [...]` and `{char}: [...]`. - Encapsulate conversation data in a `<conversation_messages>` tag. - Move `Fulfill the requested task and return the output in the format specified:` from the start of the `<agent>` section into a user message at the end of the prompt. Reporter's test result: Default Agent Prompt Preset, 10 runs: - Summarized source data + lore: 1 - Summarized source data + lore + conversation: 0 - In-character RP response: 9 Custom Agent Prompt Preset, 10 runs: - Summarized source data + lore: 8 - Summarized source data + lore + conversation: 2 - In-character RP response: 0 Reporter additionally recommends removing the `<lore>` section from the Knowledge Retrieval agent prompt preset, or explicitly instructing the agent not to summarize `<lore>` or `<conversation_messages>`. They also noted that lore already sent to the main model should be stripped from `<source_material>` sent to the agent to avoid duplication. The Discord report referenced an attached custom prompt preset text file, but no uploadable file was provided to Codex. Filing the details visible in the report. ### Template check - [ ] I provided the required summary, behavior, reproduction, and environment details. - [ ] If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
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#409
No description provided.