[GH-ISSUE #7270] [Feature]: Let the Helper combine summaries with private character sections when compacting Advanced Memory #4058

Closed
opened 2026-10-21 06:09:55 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Reported by Mari while testing Advanced Memory in Roleplay:

When it's time to compact constant summaries, I noticed we never use the combine summaries option. Wish the helper model had that tool at hand to combine memories in order to shorten them, aside from standard compacting (we already have the combine summaries built in, with a separate prompt).

When Advanced Memory's constant Chat Summaries go over 70% of Summary and recall budget, compaction asks the Helper to shorten them. But it skips every summary whose text differs between characters, meaning any summary with a private {{#if char == "Name"}}…{{/if}} section. In a group chat that is most of the summaries Advanced Memory writes, because scene recaps put private facts in those sections. So those summaries are never combined or shortened, only the plain ones are, and a character can stay over the budget while later replies keep paying to shorten the plain summaries again.

Proposed solution

Let compaction send the Helper the summaries Advanced Memory wrote itself, with their character conditions intact, together with the plain summaries the same characters can read. The Helper then combines them into one shorter summary using the existing Combine summaries prompt, and is told to keep each private fact inside a section with exactly its original condition.

  • Before saving, check that the result still has the same private sections (the same groups of readers) as the summaries it replaces. If it does not, keep the originals and shorten only the plain summaries, as today.
  • Leave summaries you wrote or edited yourself as they are.
  • Parts of a summary not meant for a character are still never shown to that character.

Alternatives considered

  • Combining summaries read by different characters into one entry. It would not make any character's memory shorter, because each character only reads their own sections, and it would make every character's summary claim message ranges they never saw. That can stop Advanced Memory from writing their own summary of those messages later.
  • A separate setting or a new prompt. Not needed: the existing Combine summaries prompt is already part of every compaction request.

Additional context

Code: updateConstantSummariesAfterGeneration in packages/server/src/services/advanced-memory.ts, which skips audience-dependent templates with a ponytail: note. The docs in docs/agents/memory.md say these summaries "need a manual edit".

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 (Oct 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7270 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Reported by Mari while testing Advanced Memory in Roleplay: > When it's time to compact constant summaries, I noticed we never use the combine summaries option. Wish the helper model had that tool at hand to combine memories in order to shorten them, aside from standard compacting (we already have the combine summaries built in, with a separate prompt). When Advanced Memory's constant Chat Summaries go over 70% of **Summary and recall budget**, compaction asks the Helper to shorten them. But it skips every summary whose text differs between characters, meaning any summary with a private `{{#if char == "Name"}}…{{/if}}` section. In a group chat that is most of the summaries Advanced Memory writes, because scene recaps put private facts in those sections. So those summaries are never combined or shortened, only the plain ones are, and a character can stay over the budget while later replies keep paying to shorten the plain summaries again. ## Proposed solution Let compaction send the Helper the summaries Advanced Memory wrote itself, with their character conditions intact, together with the plain summaries the same characters can read. The Helper then combines them into one shorter summary using the existing **Combine summaries** prompt, and is told to keep each private fact inside a section with exactly its original condition. - Before saving, check that the result still has the same private sections (the same groups of readers) as the summaries it replaces. If it does not, keep the originals and shorten only the plain summaries, as today. - Leave summaries you wrote or edited yourself as they are. - Parts of a summary not meant for a character are still never shown to that character. ## Alternatives considered - Combining summaries read by different characters into one entry. It would not make any character's memory shorter, because each character only reads their own sections, and it would make every character's summary claim message ranges they never saw. That can stop Advanced Memory from writing their own summary of those messages later. - A separate setting or a new prompt. Not needed: the existing Combine summaries prompt is already part of every compaction request. ## Additional context Code: `updateConstantSummariesAfterGeneration` in `packages/server/src/services/advanced-memory.ts`, which skips audience-dependent templates with a `ponytail:` note. The docs in `docs/agents/memory.md` say these summaries "need a manual edit". ## 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 06:09:55 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 7, 2026):

Fixed on staging by #7275. Ships to main with the next promotion.

<!-- gh-comment-id:6049027838 --> @SpicyMarinara commented on GitHub (Oct 7, 2026): Fixed on `staging` by #7275. Ships to `main` with the next promotion.
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#4058
No description provided.