[PR #7605] [MERGED] feat(memory): character recollections in Advanced Memory Recall #7829

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7605
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/memory-character-recollections


📝 Commits (10+)

  • c6717f0 feat(memory): character recollections for recalled scenes
  • 36ec431 feat(memory): Character recollections switch and inspector editing
  • a128a44 fix(memory): build recollection lines only for scenes recall selects
  • 3c82297 docs(memory): say exactly how recollections keep to what a character knew
  • ba297f8 Merge branch 'staging' into feat/memory-character-recollections
  • abb2eb0 fix(memory): keep recollections to what their character can read and ask for each once
  • 659f878 feat(memory): show empty and review-needed recollections in the inspector
  • 4b24de7 Merge remote-tracking branch 'origin/feat/memory-character-recollections' into feat/memory-character-recollections
  • d1b516c Merge branch 'staging' into feat/memory-character-recollections
  • 86c753c chore(memory): bump the prepared-memory revision past staging's v25

📊 Changes

12 files changed (+2418 additions, -111 deletions)

View changed files

📝 docs/agents/memory.md (+19 -1)
📝 e2e/advanced-memory.e2e.ts (+193 -0)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+90 -1)
📝 packages/client/src/components/chat/AdvancedMemorySettings.tsx (+17 -0)
📝 packages/client/src/hooks/use-advanced-memory.ts (+6 -1)
📝 packages/client/src/localization/locales/en.json (+11 -0)
📝 packages/server/src/routes/advanced-memory.routes.ts (+8 -2)
📝 packages/server/src/services/advanced-memory-transfer.ts (+1 -1)
📝 packages/server/src/services/advanced-memory.ts (+866 -103)
📝 packages/shared/src/types/advanced-memory.ts (+5 -2)
➕ scripts/regressions/advanced-memory-recollections-upkeep.regression.ts (+511 -0)
➕ scripts/regressions/advanced-memory-recollections.regression.ts (+691 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7602

Why this change

  • When Advanced Memory Recall brings back an old scene, every character gets the same narrator-style summary. Nothing says how they remember it, so a logical character and an empathetic one recall a scene the same way.
  • With Character recollections on, each character who was in a scene also gets a short memory of it in their own voice, shown with that scene when it is recalled.

What changed

Nothing changes unless you turn the new setting on; it is off for every chat.

  • New switch: Chat Settings → Memory Recall → Advanced Memory has Character recollections (Roleplay only, off by default): "Adds each character's short memory of a scene, in their own voice, when that scene is recalled."
  • Who gets one: for every finished scene, each character who was in it and could see any of its messages gets one first-person memory of about 50–100 words. The narrator, your persona and characters who were elsewhere get none. Their character card decides what they notice.
  • No extra request for new scenes: the scene summary request also asks for the recollections and then includes the full card of everyone who could read part of the scene, with macros filled in the same way a reply's prompt fills them (persona, card references and variables included). A long scene summarized in parts still ends with one recollection per character; the passes that merge parts send no cards.
  • Cards and room: if the cards would split a scene into more parts than it needs without them, the summary is written without them and the recollections follow in a request of their own. That request asks about one character at a time when several cards would split the scene. A character whose card takes more than half of the Helper's room for the scene gets no recollection (logged), instead of failing the run every time.
  • Only what they could know:
    • The request marks every message hidden from a character (character-specific hiding, Decide who sees new messages, knowledge starts), and the rules now also say that a {{#if char == …}} part of a summary is known only to the characters it names.
    • A recollection that copies four words in a row from something its character couldn't know is thrown away. That covers a hidden message, including its readable attachments, and another character's part of the scene summary or of a Chat Summary. The check counts only the owner's own card and everything they could read anywhere in the chat as theirs, and ignores phrases made only of words they read in several messages (such as "I really want to").
    • A reworded fact is not caught by the check; only the instructions guard against that. Messages hidden from everyone with global Hide from AI stay part of the scene, as for summaries.
  • Access changes: a recollection records which scene messages its character could read. If that changes later, a generated one is out of date and written again, and one you edited is left out of prompts until you check it and save it again in the inspector.
  • Corrections: a request that only writes recollections now also includes the scene's manual Chat Summaries and the scene summary when you edited it, so a rewritten recollection follows your correction.
  • Asked once: if the model writes nothing usable for a character (left out, or thrown away by the check), the scene keeps an empty recollection for them. No run asks again until that scene's summary or the character's access changes, and you can write one by hand. A failed request leaves empty ones marked as failed: the upkeep after a reply skips them, while Prepare and Resume try them again.
  • Older scenes: turning the switch on in a chat that is already prepared starts Writing character recollections, one request per summarized scene. Summaries, including ones you edited, never change. Scenes that already have current recollections are skipped. A scene that fails doesn't stop the others; the run then stops with the reason, and Resume retries only the failed scenes. Turning the switch on again after such a stop also restarts the run.
  • Staying current: after each reply, once the constant summaries are up to date, the missing or out-of-date recollections of up to three scenes are written, the newest scenes first. This runs in the background without the big progress wheel. Prepare, Fix, Re-scan and Resume do every scene.
  • In the prompt:
    • Only recalled scenes show recollections, right under the scene's summary and before its excerpt, one line each: Kaito's personal recollections from this scene: *…* (asterisks inside the text are removed).
    • A character replying on their own sees only their own, and the Narrator replying on its own sees none. A merged reply, with or without the narrator, shows every present character who remembers the scene.
  • Recall budget: recollections count toward Summary and recall budget. Summaries are fitted first, then recollections, then excerpts: excerpts shrink first, then whole recollections are left out. A recollection is never cut.
  • Kept apart from everything else: recollections are their own saved memories. They are never copied into Chat Summaries, never shortened by the continuity update, never embedded, and never used to pick which scenes are recalled.
  • Safety net: a summary reply that isn't the asked-for JSON now fails with a message to Resume. Before, its plain text would have been saved as the summary, with everyone's recollections in it.
  • Access memories for this chat:
    • Opening a scene shows its Character recollections, each editable by character, and saving one marks it Manually edited.
    • An out-of-date generated one says so. An edited one whose character can no longer read the same messages asks for a check and can be saved unchanged.
    • An empty one says no recollection was written and can be filled in.
    • Recollections are no longer listed as separate cards.
  • Swipes and Peek Prompt: a swipe recalls again when a recollection it could show was written or edited since; Peek Prompt shows exactly what a reply would get.
  • Export, import and branches carry recollections. Turning the switch off hides them from prompts and keeps them saved.
  • The prepared-memory revision moves to scene-timeframe-constants-v25, so saved swipe snapshots are prepared once more. No storage-format change.
  • Docs: docs/agents/memory.md gets a Character recollections section and the new budget order.

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

Commands run by the agent (results as observed, at the review-fix head):

  • pnpm check: exit 0 with the branch at staging a0cb12dd5 (one existing lint warning in HomeProfessorMariChat.tsx, unrelated). After the latest staging merge, packages/client fails to typecheck. TacticalCombatUI.tsx imports GAME_SECTION_CLASS twice, because #7608 and #7609 both restored it on staging. This PR does not touch that file.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 18/18 passed, including advanced-memory-recollections.regression.ts and the new advanced-memory-recollections-upkeep.regression.ts.
  • pnpm regression:prompt: passed.
  • Related regressions: chat-branch-lineage, context-fit-summary, merged-chat-summary, memory-recall-exclusivity, memory-recall-revectorize, native-export-memory, roleplay-user-private-memory, summary-write-range: all passed.
  • pnpm localization:check: passed.
  • npx playwright test e2e/advanced-memory.e2e.ts --project desktop-chromium -g "Character recollections" (custom ports): passed. Light and dark screenshots of the inspector were checked. The other tests in that file and the mobile projects were not rerun.
  • With the setting off, the summary requests and prepared outputs of a mixed scenario (individual and merged, hidden messages, narrator, a scene in parts) are byte-identical to staging d01dc5f84.

The regressions cover:

  • recollections returned by the summary request and kept only for the scene's participants (away character, persona and narrator dropped);
  • the request's cards: participants only, macros resolved like a reply's prompt, persona included;
  • what a character could know: a copied hidden message, another character's {{#if}} part of a Chat Summary, and a secret that also sits in another character's card are all left out, while everyday wording is kept;
  • an access change: a generated recollection is written again, and an edited one waits until it is saved again;
  • a corrected summary: its text and the manual Chat Summaries reach the request that rewrites the recollections;
  • empty recollections stop repeated requests, and failed ones are skipped by the upkeep after a reply but retried by Prepare;
  • the upkeep runs after the constant summaries, three scenes at a time, newest first;
  • cards and room: no cards in a summary request they would split, one character per request, a card too long for the Helper skipped with the run still ready, and no cards in merge passes;
  • a non-JSON summary reply when recollections were asked for fails instead of being saved;
  • asterisks are removed;
  • Individual, Narrator and merged rendering, the budget order, constants, embeddings and recall matching, swipe invalidation, export, import and branches, a scene summarized in parts, the turn-on run with a failure, Resume, and turning the setting on again.

Manual verification notes

Not yet verified by a person:

  • Manually verify in a prepared Roleplay chat that turning on Character recollections shows Writing character recollections with progress, then Memory is ready, using a real Helper model.
  • Manually verify that the recollections read in each character's voice and stay about 50–100 words with the real Helper model.
  • Manually verify with Peek Prompt in an Individual group chat that a recalled scene shows only the responder's recollection line under its summary, and none when the Narrator replies.
  • Manually verify with Peek Prompt in a merged group chat that every present character who remembers the scene gets a named line.
  • Manually verify in Access memories for this chat that editing a recollection saves, shows Manually edited, and survives correcting that scene's summary.
  • Manually verify that hiding one of a scene's messages from a character whose recollection you edited makes the inspector ask for a check, and that saving it unchanged brings it back to Peek Prompt.
  • Manually verify that after correcting a scene summary, the next reply rewrites that scene's generated recollections in the background.
  • Manually verify the switch and the inspector section in light and dark mode on a phone-sized window.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/agents/memory.md is updated. [docs-i18n] follow-up: #7596 ([docs-i18n] docs/agents/memory.md). Its comments cover this PR's first version and the review changes:

UI evidence (if applicable)

Light and dark desktop screenshots of the new switch and the inspector section, including an empty recollection, are captured by the e2e test (character-recollections-switch-*.png, character-recollections-inspector-*.png). They are not attached here.

Local CodeRabbit review

  • First run (coderabbit review --agent --committed, base d01dc5f84, first three commits): 2 findings.
    • The docs overclaimed privacy: fixed in 3c8229709.
    • Recollection-only requests include messages hidden from the characters being asked about: not changed. The maintainer decided this request uses "the same eligible source the summary used, with the existing visibility annotations". The four-word check, the rules and the new access dependency guard it; a reworded hidden fact is still guarded only by the instructions.
  • Second run (--base-commit 3c8229709, the review-fix commits): 1 finding, the docs-i18n follow-up. That is issue #7596, linked above.

Review fixes (since the first version)

Fixed:

  • A recollection stayed current after its character lost access to part of the scene.
  • Private {{#if}} parts of Chat Summaries could reach another character's recollection, with no rule or check against it.
  • The copy check counted every participant's card as the owner's.
  • A character the Helper never wrote for was asked again on every run, and upkeep got stuck on the oldest scenes.
  • Cards too large for the Helper left the run permanently in error.
  • Upkeep ran before the constant summaries.
  • Turning the setting on did nothing after a stopped recollection run.
  • A rewritten recollection never saw the correction that triggered it.
  • With the setting on, a scene that fit one request could be split.
  • Common phrases caused false copy matches.
  • Card macros used their own context.
  • A non-JSON reply was saved as the summary.
  • Asterisks inside a recollection broke its formatting.
  • Merge passes resent the cards.

Not changed:

  • Cards still include every field the loader provides (creator notes, system prompt, post-history instructions, first message). The maintainer asked for full, untrimmed cards; see open question 2.
  • Cards still go to everyone who could read part of the scene. Who was present is only known from the model's answer, so the cards can't be narrowed to them first.

Open questions for the maintainer:

  1. Should recollection-only requests send each group of characters only the messages they can see? It is stricter for privacy but costs more requests when visibility differs.
  2. Should creator notes, the system prompt, post-history instructions or the first message be left out of the cards?
  3. A card that takes more than half the Helper's room for a scene is skipped (logged; the inspector shows an empty recollection). Is half the right threshold?
  4. If the model writes nothing usable for a character, that scene is not asked again until its summary changes. Should Prepare also retry those?

Summary by CodeRabbit

  • New Features

    • Advanced Memory can generate first-person recollections for participating characters in finished scenes. The feature is opt-in and can fill in recollections for existing scenes when enabled.
    • Recollections appear with their scene in the memory inspector and can be edited. They can also be included in recall when they fit the memory budget.
    • Recollections can be transferred along with other memory records.
  • Documentation

    • Added guidance on recollection generation, visibility, editing, refresh behavior, retention, and how recollections fit within the memory budget.

🔄 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/7605 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/memory-character-recollections` --- ### 📝 Commits (10+) - [`c6717f0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c6717f0d112dc2cacb4b6c88f28a022ac24337e0) feat(memory): character recollections for recalled scenes - [`36ec431`](https://github.com/Pasta-Devs/Marinara-Engine/commit/36ec4315519c747360059731a82daebda9abba4a) feat(memory): Character recollections switch and inspector editing - [`a128a44`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a128a44cc82ce19b8901962dd0aa6828308db483) fix(memory): build recollection lines only for scenes recall selects - [`3c82297`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3c8229709289d2c4a1c3824636ef0ca60bb544a0) docs(memory): say exactly how recollections keep to what a character knew - [`ba297f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba297f80490cd8bfd5de83f3f25d829aa44e1553) Merge branch 'staging' into feat/memory-character-recollections - [`abb2eb0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/abb2eb0f5df77ff218c196847c180d423e75a5f0) fix(memory): keep recollections to what their character can read and ask for each once - [`659f878`](https://github.com/Pasta-Devs/Marinara-Engine/commit/659f8787eda40f5796b186fb12147c734628f7e8) feat(memory): show empty and review-needed recollections in the inspector - [`4b24de7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4b24de7893195168ecd37dd0b7fdf43863a5b8f1) Merge remote-tracking branch 'origin/feat/memory-character-recollections' into feat/memory-character-recollections - [`d1b516c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1b516c08a83b1e1ffb897913961cf2aa033e877) Merge branch 'staging' into feat/memory-character-recollections - [`86c753c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/86c753c00ced2699dd9aac2420511550be1be25d) chore(memory): bump the prepared-memory revision past staging's v25 ### 📊 Changes **12 files changed** (+2418 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/memory.md` (+19 -1) 📝 `e2e/advanced-memory.e2e.ts` (+193 -0) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+90 -1) 📝 `packages/client/src/components/chat/AdvancedMemorySettings.tsx` (+17 -0) 📝 `packages/client/src/hooks/use-advanced-memory.ts` (+6 -1) 📝 `packages/client/src/localization/locales/en.json` (+11 -0) 📝 `packages/server/src/routes/advanced-memory.routes.ts` (+8 -2) 📝 `packages/server/src/services/advanced-memory-transfer.ts` (+1 -1) 📝 `packages/server/src/services/advanced-memory.ts` (+866 -103) 📝 `packages/shared/src/types/advanced-memory.ts` (+5 -2) ➕ `scripts/regressions/advanced-memory-recollections-upkeep.regression.ts` (+511 -0) ➕ `scripts/regressions/advanced-memory-recollections.regression.ts` (+691 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7602 ## Why this change - When Advanced Memory Recall brings back an old scene, every character gets the same narrator-style summary. Nothing says how *they* remember it, so a logical character and an empathetic one recall a scene the same way. - With **Character recollections** on, each character who was in a scene also gets a short memory of it in their own voice, shown with that scene when it is recalled. ## What changed Nothing changes unless you turn the new setting on; it is off for every chat. - **New switch:** Chat Settings → Memory Recall → Advanced Memory has **Character recollections** (Roleplay only, off by default): "Adds each character's short memory of a scene, in their own voice, when that scene is recalled." - **Who gets one:** for every finished scene, each character who was in it and could see any of its messages gets one first-person memory of about 50–100 words. The narrator, your persona and characters who were elsewhere get none. Their character card decides what they notice. - **No extra request for new scenes:** the scene summary request also asks for the recollections and then includes the full card of everyone who could read part of the scene, with macros filled in the same way a reply's prompt fills them (persona, card references and variables included). A long scene summarized in parts still ends with one recollection per character; the passes that merge parts send no cards. - **Cards and room:** if the cards would split a scene into more parts than it needs without them, the summary is written without them and the recollections follow in a request of their own. That request asks about one character at a time when several cards would split the scene. A character whose card takes more than half of the Helper's room for the scene gets no recollection (logged), instead of failing the run every time. - **Only what they could know:** - The request marks every message hidden from a character (character-specific hiding, Decide who sees new messages, knowledge starts), and the rules now also say that a `{{#if char == …}}` part of a summary is known only to the characters it names. - A recollection that copies four words in a row from something its character couldn't know is thrown away. That covers a hidden message, including its readable attachments, and another character's part of the scene summary or of a Chat Summary. The check counts only the owner's own card and everything they could read anywhere in the chat as theirs, and ignores phrases made only of words they read in several messages (such as "I really want to"). - A reworded fact is not caught by the check; only the instructions guard against that. Messages hidden from everyone with global Hide from AI stay part of the scene, as for summaries. - **Access changes:** a recollection records which scene messages its character could read. If that changes later, a generated one is out of date and written again, and one you edited is left out of prompts until you check it and save it again in the inspector. - **Corrections:** a request that only writes recollections now also includes the scene's manual Chat Summaries and the scene summary when you edited it, so a rewritten recollection follows your correction. - **Asked once:** if the model writes nothing usable for a character (left out, or thrown away by the check), the scene keeps an empty recollection for them. No run asks again until that scene's summary or the character's access changes, and you can write one by hand. A failed request leaves empty ones marked as failed: the upkeep after a reply skips them, while Prepare and Resume try them again. - **Older scenes:** turning the switch on in a chat that is already prepared starts **Writing character recollections**, one request per summarized scene. Summaries, including ones you edited, never change. Scenes that already have current recollections are skipped. A scene that fails doesn't stop the others; the run then stops with the reason, and **Resume** retries only the failed scenes. Turning the switch on again after such a stop also restarts the run. - **Staying current:** after each reply, once the constant summaries are up to date, the missing or out-of-date recollections of up to three scenes are written, the newest scenes first. This runs in the background without the big progress wheel. Prepare, Fix, Re-scan and Resume do every scene. - **In the prompt:** - Only recalled scenes show recollections, right under the scene's summary and before its excerpt, one line each: `Kaito's personal recollections from this scene: *…*` (asterisks inside the text are removed). - A character replying on their own sees only their own, and the Narrator replying on its own sees none. A merged reply, with or without the narrator, shows every present character who remembers the scene. - **Recall budget:** recollections count toward **Summary and recall budget**. Summaries are fitted first, then recollections, then excerpts: excerpts shrink first, then whole recollections are left out. A recollection is never cut. - **Kept apart from everything else:** recollections are their own saved memories. They are never copied into Chat Summaries, never shortened by the continuity update, never embedded, and never used to pick which scenes are recalled. - **Safety net:** a summary reply that isn't the asked-for JSON now fails with a message to Resume. Before, its plain text would have been saved as the summary, with everyone's recollections in it. - **Access memories for this chat:** - Opening a scene shows its **Character recollections**, each editable by character, and saving one marks it **Manually edited**. - An out-of-date generated one says so. An edited one whose character can no longer read the same messages asks for a check and can be saved unchanged. - An empty one says no recollection was written and can be filled in. - Recollections are no longer listed as separate cards. - **Swipes and Peek Prompt:** a swipe recalls again when a recollection it could show was written or edited since; Peek Prompt shows exactly what a reply would get. - **Export, import and branches** carry recollections. Turning the switch off hides them from prompts and keeps them saved. - The prepared-memory revision moves to `scene-timeframe-constants-v25`, so saved swipe snapshots are prepared once more. No storage-format change. - Docs: `docs/agents/memory.md` gets a **Character recollections** section and the new budget order. ## 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` Commands run by the agent (results as observed, at the review-fix head): - `pnpm check`: exit 0 with the branch at staging `a0cb12dd5` (one existing lint warning in `HomeProfessorMariChat.tsx`, unrelated). After the latest staging merge, `packages/client` fails to typecheck. `TacticalCombatUI.tsx` imports `GAME_SECTION_CLASS` twice, because #7608 and #7609 both restored it on staging. This PR does not touch that file. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 18/18 passed, including `advanced-memory-recollections.regression.ts` and the new `advanced-memory-recollections-upkeep.regression.ts`. - `pnpm regression:prompt`: passed. - Related regressions: `chat-branch-lineage`, `context-fit-summary`, `merged-chat-summary`, `memory-recall-exclusivity`, `memory-recall-revectorize`, `native-export-memory`, `roleplay-user-private-memory`, `summary-write-range`: all passed. - `pnpm localization:check`: passed. - `npx playwright test e2e/advanced-memory.e2e.ts --project desktop-chromium -g "Character recollections"` (custom ports): passed. Light and dark screenshots of the inspector were checked. The other tests in that file and the mobile projects were not rerun. - With the setting off, the summary requests and prepared outputs of a mixed scenario (individual and merged, hidden messages, narrator, a scene in parts) are byte-identical to staging `d01dc5f84`. The regressions cover: - recollections returned by the summary request and kept only for the scene's participants (away character, persona and narrator dropped); - the request's cards: participants only, macros resolved like a reply's prompt, persona included; - what a character could know: a copied hidden message, another character's `{{#if}}` part of a Chat Summary, and a secret that also sits in another character's card are all left out, while everyday wording is kept; - an access change: a generated recollection is written again, and an edited one waits until it is saved again; - a corrected summary: its text and the manual Chat Summaries reach the request that rewrites the recollections; - empty recollections stop repeated requests, and failed ones are skipped by the upkeep after a reply but retried by Prepare; - the upkeep runs after the constant summaries, three scenes at a time, newest first; - cards and room: no cards in a summary request they would split, one character per request, a card too long for the Helper skipped with the run still ready, and no cards in merge passes; - a non-JSON summary reply when recollections were asked for fails instead of being saved; - asterisks are removed; - Individual, Narrator and merged rendering, the budget order, constants, embeddings and recall matching, swipe invalidation, export, import and branches, a scene summarized in parts, the turn-on run with a failure, Resume, and turning the setting on again. ### Manual verification notes Not yet verified by a person: - Manually verify in a prepared Roleplay chat that turning on **Character recollections** shows **Writing character recollections** with progress, then **Memory is ready**, using a real Helper model. - Manually verify that the recollections read in each character's voice and stay about 50–100 words with the real Helper model. - Manually verify with Peek Prompt in an Individual group chat that a recalled scene shows only the responder's recollection line under its summary, and none when the Narrator replies. - Manually verify with Peek Prompt in a merged group chat that every present character who remembers the scene gets a named line. - Manually verify in **Access memories for this chat** that editing a recollection saves, shows **Manually edited**, and survives correcting that scene's summary. - Manually verify that hiding one of a scene's messages from a character whose recollection you edited makes the inspector ask for a check, and that saving it unchanged brings it back to Peek Prompt. - Manually verify that after correcting a scene summary, the next reply rewrites that scene's generated recollections in the background. - Manually verify the switch and the inspector section in light and dark mode on a phone-sized window. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/agents/memory.md` is updated. `[docs-i18n]` follow-up: #7596 (`[docs-i18n] docs/agents/memory.md`). Its comments cover this PR's first version and the review changes: - https://github.com/Pasta-Devs/Marinara-Engine/issues/7596#issuecomment-6166812562 - https://github.com/Pasta-Devs/Marinara-Engine/issues/7596#issuecomment-6167890650 ## UI evidence (if applicable) Light and dark desktop screenshots of the new switch and the inspector section, including an empty recollection, are captured by the e2e test (`character-recollections-switch-*.png`, `character-recollections-inspector-*.png`). They are not attached here. ## Local CodeRabbit review - **First run** (`coderabbit review --agent --committed`, base `d01dc5f84`, first three commits): 2 findings. - The docs overclaimed privacy: fixed in 3c8229709. - Recollection-only requests include messages hidden from the characters being asked about: not changed. The maintainer decided this request uses "the same eligible source the summary used, with the existing visibility annotations". The four-word check, the rules and the new access dependency guard it; a reworded hidden fact is still guarded only by the instructions. - **Second run** (`--base-commit 3c8229709`, the review-fix commits): 1 finding, the docs-i18n follow-up. That is issue #7596, linked above. ## Review fixes (since the first version) **Fixed:** - A recollection stayed current after its character lost access to part of the scene. - Private `{{#if}}` parts of Chat Summaries could reach another character's recollection, with no rule or check against it. - The copy check counted every participant's card as the owner's. - A character the Helper never wrote for was asked again on every run, and upkeep got stuck on the oldest scenes. - Cards too large for the Helper left the run permanently in error. - Upkeep ran before the constant summaries. - Turning the setting on did nothing after a stopped recollection run. - A rewritten recollection never saw the correction that triggered it. - With the setting on, a scene that fit one request could be split. - Common phrases caused false copy matches. - Card macros used their own context. - A non-JSON reply was saved as the summary. - Asterisks inside a recollection broke its formatting. - Merge passes resent the cards. **Not changed:** - Cards still include every field the loader provides (creator notes, system prompt, post-history instructions, first message). The maintainer asked for full, untrimmed cards; see open question 2. - Cards still go to everyone who could read part of the scene. Who was present is only known from the model's answer, so the cards can't be narrowed to them first. **Open questions for the maintainer:** 1. Should recollection-only requests send each group of characters only the messages they can see? It is stricter for privacy but costs more requests when visibility differs. 2. Should creator notes, the system prompt, post-history instructions or the first message be left out of the cards? 3. A card that takes more than half the Helper's room for a scene is skipped (logged; the inspector shows an empty recollection). Is half the right threshold? 4. If the model writes nothing usable for a character, that scene is not asked again until its summary changes. Should Prepare also retry those? <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Advanced Memory can generate first-person recollections for participating characters in finished scenes. The feature is opt-in and can fill in recollections for existing scenes when enabled. * Recollections appear with their scene in the memory inspector and can be edited. They can also be included in recall when they fit the memory budget. * Recollections can be transferred along with other memory records. * **Documentation** * Added guidance on recollection generation, visibility, editing, refresh behavior, retention, and how recollections fit within the memory budget. <!-- 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-24 04:07:57 +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#7829
No description provided.