[GH-ISSUE #939] [Feature]: Add opt-in semantic recall for roleplay rolling summaries #458

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

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

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Long roleplay chats can accumulate split rolling summary entries, but Roleplay currently injects the compiled full summary every turn by default. That preserves continuity, but it can become heavy and can over-steer turns with irrelevant summary details.

Proposed solution

Add an opt-in Roleplay summary context mode that embeds enabled chatMetadata.summaryEntries individually and recalls only relevant entries for the latest user turn.

Default behavior should remain unchanged:

  • Enabled summaryEntries compile into chatMetadata.summary.
  • The compiled full summary is injected every turn.

New optional Roleplay modes:

  • Full summary
  • Semantic recall
  • Full summary + semantic recall

Semantic recall should inject a separate <recalled_summaries> block rather than merging with raw message memory recall.

Alternatives considered

Not enough space to write all that. If you want a novel though, just ask.

Additional context

First PR Scope:

  • Roleplay-only summary recall.
  • summaryEntries only.
  • Opt-in only; existing chats stay on full-summary injection.
  • Reuse the existing memory recall embedding path.
  • Store summary recall rows in memory_chunks with typed source metadata.
  • Keep message memory recall and summary recall source-filtered from each other.
  • Add a refresh endpoint for rebuilding summary recall chunks.
  • Add basic UI controls in chat settings.
  • Update memory/roleplay docs.

Manual verification should include:

  • Full summary mode keeps existing prompt behavior.
  • Semantic mode suppresses the full compiled summary and injects only recalled summaries when matches exist.
  • Full + semantic mode injects both.
  • Editing, disabling, or deleting split summary entries updates the summary recall index.
  • Message memory recall does not return summary chunks.
  • Summary recall chunks are visible as summary memory in the memories modal.

Automated coverage should include focused service tests for summary chunk creation, stale removal, edited-entry re-embedding, and source filtering.

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 @Promansis on GitHub (May 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/939 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Long roleplay chats can accumulate split rolling summary entries, but Roleplay currently injects the compiled full summary every turn by default. That preserves continuity, but it can become heavy and can over-steer turns with irrelevant summary details. ## Proposed solution Add an opt-in Roleplay summary context mode that embeds enabled `chatMetadata.summaryEntries` individually and recalls only relevant entries for the latest user turn. Default behavior should remain unchanged: - Enabled `summaryEntries` compile into `chatMetadata.summary`. - The compiled full summary is injected every turn. New optional Roleplay modes: - Full summary - Semantic recall - Full summary + semantic recall Semantic recall should inject a separate `<recalled_summaries>` block rather than merging with raw message memory recall. ## Alternatives considered <!-- Any other approaches you thought about? --> Not enough space to write all that. If you want a novel though, just ask. ## Additional context First PR Scope: - Roleplay-only summary recall. - `summaryEntries` only. - Opt-in only; existing chats stay on full-summary injection. - Reuse the existing memory recall embedding path. - Store summary recall rows in `memory_chunks` with typed source metadata. - Keep message memory recall and summary recall source-filtered from each other. - Add a refresh endpoint for rebuilding summary recall chunks. - Add basic UI controls in chat settings. - Update memory/roleplay docs. <!-- Optional: mockups, related issues, references, or examples --> Manual verification should include: - Full summary mode keeps existing prompt behavior. - Semantic mode suppresses the full compiled summary and injects only recalled summaries when matches exist. - Full + semantic mode injects both. - Editing, disabling, or deleting split summary entries updates the summary recall index. - Message memory recall does not return summary chunks. - Summary recall chunks are visible as summary memory in the memories modal. Automated coverage should include focused service tests for summary chunk creation, stale removal, edited-entry re-embedding, and source filtering. ## 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.
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#458
No description provided.