[PR #389] [MERGED] feat(conversation): define expected content for keyDetails and summary in the automatic summarization prompts #4601

Closed
opened 2026-10-22 04:09:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/389
Author: @JorgeLTE
Created: 5/4/2026
Status: ✅ Merged
Merged: 5/4/2026
Merged by: @SpicyMarinara

Base: main ← Head: feat/conversation-summary-prompts


📝 Commits (1)

  • 821b5ba feat(conversation): split facts and atmosphere in summary prompts

📊 Changes

1 file changed (+26 additions, -9 deletions)

View changed files

📝 packages/server/src/services/conversation/auto-summary.service.ts (+26 -9)

📄 Description

'Closes #391'

Why this change

Refines the day and week conversation summarization prompts so that the narrative summary and the bulleted keyDetails no longer cover the same ground.

The problem: the previous prompts asked both fields to capture "topics, key moments, important exchanges" — so they overlapped heavily. In practice this meant duplicate content sitting in context.

What changed

The fix: reframe the two fields by what only one of them can express:

  • keyDetails (unchanged) — discrete, retrievable facts: promises, plans, named info, decisions, unresolved threads.
  • summary — atmospheric/episodic context: setting, character state, tonal register, recurring patterns. Now explicitly instructed not to restate items from keyDetails.

Day and week prompts also now emit keyDetails first, so the model writes the facts before composing the summary — gives the atmosphere pass a clean view of what's already covered, and avoids the forward reference in the "do not restate keyDetails" instruction.

Day prompt

  • Reframed as terse field notes (1-3 brief sentences) rather than literary prose. Day summaries are ephemeral (rolled into the week summary) and primarily exist to feed the week summarizer, so a note-style register fits the artifact and uses fewer tokens.
  • Avoid/Prefer contrast and a terse example added to anchor the register.

Week prompt

  • Reframed as terse atmospheric notes (3-5 brief sentences) capturing the week's ARC rather than its events.
  • Bullets reframed around tonal evolution / recurring patterns / relationship developments instead of "topics + events".

Example summary output before change (Notice duplication and bloat)

Summary:
Bob shared two major breakthroughs with Alice. First, he told his singing teacher about his concert dream and vocaloid/utaite culture, and the teacher (a fellow anime nerd) agreed to focus their classes on concert prep, eliminating Bob's need to split time with certification exam work. Second, Bob discovered his concept of head voice was flawed—he'd been mixing in chest voice—and correcting this unlocked his registry flips on 'I'm Invincible' and shifted his entire vocal understanding. Alice was thrilled and emotionally supportive throughout. Bob then left to check on a friend at a nearby bar, noting he's currently put off by alcohol after previous tequila incidents.

Key Details:

  • Bob told his singing teacher about his concert dream and vocaloid/utaite culture; the teacher is now tailoring classes to concert prep.
  • Bob is setting aside the singing certification exam to focus on the concert.
  • Bob's singing teacher is a fellow anime nerd.
  • Bob had a fundamental vocal breakthrough: he realized his head voice had chest mixed in; correcting this unlocked registry flips and other vocal issues.
  • Bob is now able to do the registry flips on 'I'm Invincible' (Alice song).
  • Bob is currently grossed out by alcohol and says "tequila Bob" won't return for a long time.
  • Bob left to check on a friend at a nearby bar.
  • Alice mentioned she was going through recordings and being self-critical about them.

Example summary output after change

Summary:
Brief evening chat. Bob hyped about two breakthroughs, Alice validating and excited throughout. Warm and affectionate, quick pace. Bob left to check on a friend at a bar.

Key Details:

  • Bob told his singing teacher about his concert dream and vocaloid/utaite culture — the teacher agreed to focus classes on concert prep instead of the certification exam.
  • Bob had a vocal breakthrough: he realized his head voice concept was flawed (mixing in chest) and now understands true head voice, which is fixing registry flips and other issues.
  • Bob is currently not into alcohol after previous tequila incidents.
  • Bob went to check on a friend at a nearby bar.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
    • I'm having issues building docker before and after my changes on Windows.
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md
  • Manually verify a day summary
  • Manually verify a week consolidation

Docs and release impact

  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced auto-summary generation for conversations with improved formatting and structure. Key details now appear first in summaries, followed by more concise, field-notes style content. Summaries better avoid redundancy between sections across both daily and weekly summary generation.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/389 **Author:** [@JorgeLTE](https://github.com/JorgeLTE) **Created:** 5/4/2026 **Status:** ✅ Merged **Merged:** 5/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `feat/conversation-summary-prompts` --- ### 📝 Commits (1) - [`821b5ba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/821b5ba20e3a6125b15719a8dcba5cfd1a77338f) feat(conversation): split facts and atmosphere in summary prompts ### 📊 Changes **1 file changed** (+26 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/conversation/auto-summary.service.ts` (+26 -9) </details> ### 📄 Description 'Closes #391' ## Why this change Refines the day and week conversation summarization prompts so that the narrative `summary` and the bulleted `keyDetails` no longer cover the same ground. **The problem:** the previous prompts asked both fields to capture "topics, key moments, important exchanges" — so they overlapped heavily. In practice this meant duplicate content sitting in context. ## What changed **The fix:** reframe the two fields by what only one of them can express: - **`keyDetails`** (unchanged) — discrete, retrievable facts: promises, plans, named info, decisions, unresolved threads. - **`summary`** — atmospheric/episodic context: setting, character state, tonal register, recurring patterns. Now explicitly instructed not to restate items from `keyDetails`. Day and week prompts also now emit `keyDetails` first, so the model writes the facts before composing the summary — gives the atmosphere pass a clean view of what's already covered, and avoids the forward reference in the "do not restate keyDetails" instruction. ### Day prompt - Reframed as **terse field notes (1-3 brief sentences)** rather than literary prose. Day summaries are ephemeral (rolled into the week summary) and primarily exist to feed the week summarizer, so a note-style register fits the artifact and uses fewer tokens. - Avoid/Prefer contrast and a terse example added to anchor the register. ### Week prompt - Reframed as **terse atmospheric notes (3-5 brief sentences)** capturing the week's ARC rather than its events. - Bullets reframed around tonal evolution / recurring patterns / relationship developments instead of "topics + events". ### Example summary output before change (Notice duplication and bloat) Summary: Bob shared two major breakthroughs with Alice. First, he told his singing teacher about his concert dream and vocaloid/utaite culture, and the teacher (a fellow anime nerd) agreed to focus their classes on concert prep, eliminating Bob's need to split time with certification exam work. Second, Bob discovered his concept of head voice was flawed—he'd been mixing in chest voice—and correcting this unlocked his registry flips on 'I'm Invincible' and shifted his entire vocal understanding. Alice was thrilled and emotionally supportive throughout. Bob then left to check on a friend at a nearby bar, noting he's currently put off by alcohol after previous tequila incidents. Key Details: - Bob told his singing teacher about his concert dream and vocaloid/utaite culture; the teacher is now tailoring classes to concert prep. - Bob is setting aside the singing certification exam to focus on the concert. - Bob's singing teacher is a fellow anime nerd. - Bob had a fundamental vocal breakthrough: he realized his head voice had chest mixed in; correcting this unlocked registry flips and other vocal issues. - Bob is now able to do the registry flips on 'I'm Invincible' (Alice song). - Bob is currently grossed out by alcohol and says "tequila Bob" won't return for a long time. - Bob left to check on a friend at a nearby bar. - Alice mentioned she was going through recordings and being self-critical about them. ### Example summary output after change Summary: Brief evening chat. Bob hyped about two breakthroughs, Alice validating and excited throughout. Warm and affectionate, quick pace. Bob left to check on a friend at a bar. Key Details: - Bob told his singing teacher about his concert dream and vocaloid/utaite culture — the teacher agreed to focus classes on concert prep instead of the certification exam. - Bob had a vocal breakthrough: he realized his head voice concept was flawed (mixing in chest) and now understands true head voice, which is fixing registry flips and other issues. - Bob is currently not into alcohol after previous tequila incidents. - Bob went to check on a friend at a nearby bar. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - I'm having issues building docker before and after my changes on Windows. - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` - [x] Manually verify a day summary - [x] Manually verify a week consolidation ## Docs and release impact - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced auto-summary generation for conversations with improved formatting and structure. Key details now appear first in summaries, followed by more concise, field-notes style content. Summaries better avoid redundancy between sections across both daily and weekly summary generation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:09:04 +07:00
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#4601
No description provided.