[GH-ISSUE #2049] [Issue]: Memory recall: Prevent "swipe" pollution and implement "Read Behind" offset #1001

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

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

Originally assigned to: @cha1latte on GitHub.

Summary

When utilizing the memory recall (vector storage) system, the engine currently appears to commit the latest generated message directly to memory. This causes a major issue during "swipes" (generating alternative responses):

  1. A draft/swipe is generated and immediately saved to the vector database.
  2. If the user decides to swipe for a new response, the memory recall pulls information from the now-discarded previous swipe. This causes the character to echo themselves or introduce narrative details from an "alternative reality" that was swiped away.
  3. In addition, recalling memories that are already within the active context window is redundant and wastes token count.

We need a system where:

  • Storage only commits finalized messages (once a swipe is accepted/locked).
  • A "Read Behind" offset system is implemented (similar to Lorebooks you have already implemented) so the recall agent ignores the most recent N messages. This prevents redundant injections of memories that are already visible in the active context.
  • Maybe have the ability to modify the text in it too! because otherwise I'm obligated to delete the entire chunk instead of deleting one specific part of it.

Expected behavior

  • Memory storage should not commit the active, unfinalized message. Discarded swipes should never be saved to the database.
  • Memory recall should have a configurable "Read Behind" threshold to prevent duplicate retrieval of information already present in the active context size.

Actual behavior

  • Sometimes generated swipe on the latest message is immediately memorized.
  • Subsequent swipes pull data from the discarded swipes, leading to immediate repetition, echo loops, and narrative bleed.
  • Token budget is wasted by injecting memories of events that are already present in the immediate chat context.

Steps to reproduce

  1. Generate a message from a character.
  2. Swipe to generate an alternative response.
  3. Observe that the new swipe SOMETIMES echoes or references specific details that only existed in the first (now discarded) swipe, because it was already stored in the vector database.

Additional context

Implementing a "Read Behind" slider or offset limit—much like Lorebook —would solve both the token redundancy issue and the swipe pollution.

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 @Navgner on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2049 Originally assigned to: @cha1latte on GitHub. ## Summary When utilizing the memory recall (vector storage) system, the engine currently appears to commit the latest generated message directly to memory. This causes a major issue during "swipes" (generating alternative responses): 1. A draft/swipe is generated and immediately saved to the vector database. 2. If the user decides to swipe for a new response, the memory recall pulls information from the *now-discarded* previous swipe. This causes the character to echo themselves or introduce narrative details from an "alternative reality" that was swiped away. 3. In addition, recalling memories that are already within the active context window is redundant and wastes token count. We need a system where: - Storage only commits finalized messages (once a swipe is accepted/locked). - A "Read Behind" offset system is implemented (similar to Lorebooks you have already implemented) so the recall agent ignores the most recent $N$ messages. This prevents redundant injections of memories that are already visible in the active context. - Maybe have the ability to modify the text in it too! because otherwise I'm obligated to delete the entire chunk instead of deleting one specific part of it. ## Expected behavior - Memory storage should not commit the active, unfinalized message. Discarded swipes should never be saved to the database. - Memory recall should have a configurable "Read Behind" threshold to prevent duplicate retrieval of information already present in the active context size. ## Actual behavior - Sometimes generated swipe on the latest message is immediately memorized. - Subsequent swipes pull data from the discarded swipes, leading to immediate repetition, echo loops, and narrative bleed. - Token budget is wasted by injecting memories of events that are already present in the immediate chat context. ## Steps to reproduce 1. Generate a message from a character. 2. Swipe to generate an alternative response. 3. Observe that the new swipe SOMETIMES echoes or references specific details that only existed in the *first* (now discarded) swipe, because it was already stored in the vector database. ## Additional context Implementing a "Read Behind" slider or offset limit—much like Lorebook —would solve both the token redundancy issue and the swipe pollution. ## 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:25:00 +07:00
  • closed this issue
  • added the
    bug
    label
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#1001
No description provided.