[PR #948] [CLOSED] Add semantic summary recall for roleplay summaries #4852

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/948
Author: @Promansis
Created: 5/17/2026
Status: ❌ Closed

Base: staging ← Head: feature/rp-summary-semantic-recall


📝 Commits (7)

  • ba3249b Add: Summary Recall. Prettier code was run as a part of this.
  • 0ffa404 Fix: Deletion/sync path
  • 825071d fix: repair missing summary recall embeddings
  • 9fb4fdb feat: clarify summary recall settings
  • c462328 fix: smooth summary recall slider
  • 41fa625 docs: document summary recall controls
  • 816895d fix: simplify summary context modes

📊 Changes

16 files changed (+697 additions, -21 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/CONFIGURATION.md (+1 -1)
📝 docs/ROLEPLAY.md (+1 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+126 -4)
📝 packages/client/src/hooks/use-chats.ts (+10 -0)
📝 packages/server/src/db/migrate.ts (+23 -0)
📝 packages/server/src/db/schema/chats.ts (+8 -0)
📝 packages/server/src/routes/chats.routes.ts (+44 -2)
📝 packages/server/src/routes/generate.routes.ts (+91 -3)
📝 packages/server/src/services/agents/knowledge-router.ts (+1 -0)
📝 packages/server/src/services/memory-recall.ts (+46 -6)
📝 packages/server/src/services/storage/chats.storage.ts (+19 -5)
➕ packages/server/src/services/summary-recall.ts (+116 -0)
📝 packages/server/test/memory-recall.test.ts (+190 -0)
📝 packages/shared/src/types/agent.ts (+2 -0)
📝 packages/shared/src/types/chat.ts (+18 -0)

📄 Description

Linked issue

Closes Issue #939

Why this change

Long roleplay chats can accumulate large rolling summaries. Injecting the entire compiled summary every turn keeps continuity, but it can also consume prompt space and carry unrelated older context into the current response.

This adds chat-level controls so roleplay users can keep legacy full-summary injection, switch to semantic rolling-summary recall, or combine both when they need broader continuity.

What changed

  • Added roleplay Summary Context settings for full summary, semantic recall, and full summary + semantic recall modes.
  • Added recall strictness and recalled-summary count controls, plus a refresh action for summary recall chunks.
  • Stores rolling-summary memory chunks separately from message memory chunks and recalls them through the existing embedding path.
  • Keeps message memory recall scoped to message chunks so summary recall and message recall do not contaminate each other.
  • Passes recalled summaries into generation and agent context.
  • Added focused server tests for message/summary recall chunk behavior.
  • Updated Roleplay docs, logging docs, and the Unreleased changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • 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

Manual verification notes

  • pnpm check was run locally and passed: impeccable context check, lint/typecheck, shared/server/client builds.
  • pnpm db:push was attempted because this branch includes database schema/migration changes, but this checkout reports Command "db:push" not found.
  • Manual browser/app verification remains for a human tester.
  • Docker/Podman verification was not run.

Docs and release impact

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

Docs updated:

  • docs/ROLEPLAY.md
  • docs/CONFIGURATION.md
  • CHANGELOG.md

No version/release files were changed.

UI evidence (if applicable)

No screenshots or recordings captured in this pass.


🔄 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/948 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/17/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `feature/rp-summary-semantic-recall` --- ### 📝 Commits (7) - [`ba3249b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba3249b2c62b265a8d6fa6b17d82805275c8cb6c) Add: Summary Recall. Prettier code was run as a part of this. - [`0ffa404`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0ffa4049b7fc26e951592743df63feb3f70f3f87) Fix: Deletion/sync path - [`825071d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/825071d142c4ab8bb69bda6d0c3fa6a9f67e4793) fix: repair missing summary recall embeddings - [`9fb4fdb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9fb4fdb7caf428e12d7673ac2639002eab4a54ea) feat: clarify summary recall settings - [`c462328`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c4623282ab75a9106751d3d18e7dcd379730b9cb) fix: smooth summary recall slider - [`41fa625`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41fa625efc6d152d2b095c225b1846edc38ae0ff) docs: document summary recall controls - [`816895d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/816895dc9c6481b91537c5f7c521f576f9bdb1be) fix: simplify summary context modes ### 📊 Changes **16 files changed** (+697 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/CONFIGURATION.md` (+1 -1) 📝 `docs/ROLEPLAY.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+126 -4) 📝 `packages/client/src/hooks/use-chats.ts` (+10 -0) 📝 `packages/server/src/db/migrate.ts` (+23 -0) 📝 `packages/server/src/db/schema/chats.ts` (+8 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+44 -2) 📝 `packages/server/src/routes/generate.routes.ts` (+91 -3) 📝 `packages/server/src/services/agents/knowledge-router.ts` (+1 -0) 📝 `packages/server/src/services/memory-recall.ts` (+46 -6) 📝 `packages/server/src/services/storage/chats.storage.ts` (+19 -5) ➕ `packages/server/src/services/summary-recall.ts` (+116 -0) 📝 `packages/server/test/memory-recall.test.ts` (+190 -0) 📝 `packages/shared/src/types/agent.ts` (+2 -0) 📝 `packages/shared/src/types/chat.ts` (+18 -0) </details> ### 📄 Description ## Linked issue Closes Issue #939 ## Why this change Long roleplay chats can accumulate large rolling summaries. Injecting the entire compiled summary every turn keeps continuity, but it can also consume prompt space and carry unrelated older context into the current response. This adds chat-level controls so roleplay users can keep legacy full-summary injection, switch to semantic rolling-summary recall, or combine both when they need broader continuity. ## What changed - Added roleplay Summary Context settings for full summary, semantic recall, and full summary + semantic recall modes. - Added recall strictness and recalled-summary count controls, plus a refresh action for summary recall chunks. - Stores rolling-summary memory chunks separately from message memory chunks and recalls them through the existing embedding path. - Keeps message memory recall scoped to message chunks so summary recall and message recall do not contaminate each other. - Passes recalled summaries into generation and agent context. - Added focused server tests for message/summary recall chunk behavior. - Updated Roleplay docs, logging docs, and the Unreleased changelog entry. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [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` ### Manual verification notes - `pnpm check` was run locally and passed: impeccable context check, lint/typecheck, shared/server/client builds. - `pnpm db:push` was attempted because this branch includes database schema/migration changes, but this checkout reports `Command "db:push" not found`. - Manual browser/app verification remains for a human tester. - Docker/Podman verification was not run. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) Docs updated: - `docs/ROLEPLAY.md` - `docs/CONFIGURATION.md` - `CHANGELOG.md` No version/release files were changed. ## UI evidence (if applicable) No screenshots or recordings captured in this pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:11 +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#4852
No description provided.