[PR #4133] [MERGED] feat(ltm): integrate Long-Term Memory package host #6244

Closed
opened 2026-10-23 04:08:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4133
Author: @Promansis
Created: 7/26/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/long-term-memory-release


📝 Commits (3)

  • 91ba44f feat(ltm): integrate long-term memory package
  • 1c2faa7 Merge remote-tracking branch 'origin/staging' into feature/long-term-memory-release
  • c73517e fix(ltm): address host integration review

📊 Changes

23 files changed (+878 additions, -126 deletions)

View changed files

📝 docs/agents/agents-overview.md (+1 -1)
📝 docs/agents/built-in-agents.md (+11 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+100 -14)
📝 packages/client/src/components/presets/PresetEditor.tsx (+8 -3)
📝 packages/server/src/routes/backup.routes.ts (+1 -0)
📝 packages/server/src/routes/capability-packages.routes.ts (+1 -1)
📝 packages/server/src/routes/generate.routes.ts (+104 -48)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+3 -1)
➕ packages/server/src/services/capability-packages/capability-embedding.service.ts (+19 -0)
📝 packages/server/src/services/capability-packages/capability-language-model.service.ts (+91 -35)
📝 packages/server/src/services/capability-packages/capability-module-runtime.service.ts (+16 -2)
📝 packages/server/src/services/capability-packages/capability-persistence.service.ts (+5 -0)
📝 packages/server/src/services/capability-packages/capability-resources.service.ts (+31 -3)
➕ packages/server/src/services/capability-packages/capability-route-registration.service.ts (+139 -0)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+3 -0)
➕ packages/server/src/services/generation/long-term-memory-runtime.ts (+87 -0)
📝 packages/server/src/services/generation/runtime-agent-sections.ts (+7 -7)
📝 packages/server/src/services/local-embedder.ts (+9 -1)
📝 packages/shared/src/schemas/capability-package.schema.ts (+1 -1)
📝 packages/shared/src/types/capability-runtime.ts (+59 -2)

...and 3 more files

📄 Description

Linked issue

Closes #4132

Why this change

  • The downloadable Long-Term Memory package needs stable Engine-owned contracts for data access, model routing, embeddings, privileged maintenance routes, prompt injection, settings UI, backups, and compatibility. Without these contracts, package code would have to duplicate or depend on private Engine internals.
  • This keeps package-owned behavior in Pasta-Devs/Marinara-Agents while keeping host integration in Marinara Engine, matching the repository ownership boundary.

What changed

  • Added capability hosts for stable local embeddings, richer language-model requests, chat/resource access, and package-owned privileged routes.
  • Added the narrow Long-Term Memory runtime bridge for recall and accepted-prompt accounting.
  • Integrated recalled context with normal prompt assembly, preset markers, cached regeneration, package settings, and backup coverage.
  • Preserved cumulative capability API 1.x compatibility and hardened package route namespaces, authorization order, activation rollback, and embedding input bounds.
  • Added focused lifecycle and prompt regression coverage.
  • Added Long-Term Memory to the downloadable-agent overview and reference; translation follow-up is tracked in #4131.

Validation

Automated commands completed locally:

  • pnpm check

  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/capability-package-lifecycle.regression.ts

  • pnpm regression:prompt

  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts

  • 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

  • Manually install the matching Long-Term Memory package artifact and restart Marinara.
  • Manually enable Long-Term Memory in Conversation, Roleplay, Visual Novel, and Game chats.
  • Manually verify package settings open, edit, persist, and respect the guarded Chat Settings close flow.
  • Manually verify recalled memories appear in the generated prompt at default placement and an explicit preset marker.
  • Manually verify regeneration reuses cached context without recording duplicate prompt accounting.
  • Manually verify vault maintenance/import/export routes require privileged access.
  • Manually verify backup and restore preserve package-owned Long-Term Memory data.
  • Manually verify desktop/mobile and light/dark presentation; attach screenshots or recordings before ready-for-review.
  • Manually build and run the container path.

Risk And Proof Boundary

  • Core claim: an installed Long-Term Memory package can use stable Engine hosts and contribute recalled context without package implementation code living in Engine.
  • Risk types: prompt assembly, provider request shaping, package storage/backups, privileged routes, compatibility, and dynamic package UI.
  • Entrypoints covered: generation route, capability runtime activation, package routes, package settings mount, preset sections, and backup roots.
  • Automated positive coverage: capability API compatibility, host availability, aggregate embedding bounds, package route namespace/duplicate guards, preset marker placement, fallback placement, and guarded settings navigation.
  • Automated negative controls: unsupported capability versions, invalid route namespaces, normalized duplicate routes, missing runtime service, failed recall/accounting, and unmatched preset sections.
  • Proof gaps: real package artifact installation, browser UI, container runtime, backup/restore round trip, and provider-backed extraction remain manual.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

Documentation was updated in docs/agents/agents-overview.md and docs/agents/built-in-agents.md. Translation follow-up: #4131. No version bump is included.

UI evidence (if applicable)

Not yet attached. Screenshots or recordings are required before moving this draft to ready for review.

Summary by CodeRabbit

  • New Features
    • Added Long-Term Memory as an installable capability package.
    • Long-Term Memory can be enabled from chat settings and included in preset sections.
    • Chat responses can recall relevant saved context and record accepted prompts.
    • Long-Term Memory data is included in backups and profile exports.
  • Documentation
    • Updated agent catalog counts and added Long-Term Memory setup, compatibility, settings, and data lifecycle details.
  • Bug Fixes
    • Improved settings drawer safeguards when closing before opening agent configuration.

🔄 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/4133 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 7/26/2026 **Status:** ✅ Merged **Merged:** 7/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/long-term-memory-release` --- ### 📝 Commits (3) - [`91ba44f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/91ba44fd2e2cecf00213286941d29eb3825fb131) feat(ltm): integrate long-term memory package - [`1c2faa7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1c2faa751bbdc9724feddd5e889c677c5ca0bf49) Merge remote-tracking branch 'origin/staging' into feature/long-term-memory-release - [`c73517e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c73517e4097c9785d89bc0d8cb0207eec89babd9) fix(ltm): address host integration review ### 📊 Changes **23 files changed** (+878 additions, -126 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/agents-overview.md` (+1 -1) 📝 `docs/agents/built-in-agents.md` (+11 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+100 -14) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+8 -3) 📝 `packages/server/src/routes/backup.routes.ts` (+1 -0) 📝 `packages/server/src/routes/capability-packages.routes.ts` (+1 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+104 -48) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+3 -1) ➕ `packages/server/src/services/capability-packages/capability-embedding.service.ts` (+19 -0) 📝 `packages/server/src/services/capability-packages/capability-language-model.service.ts` (+91 -35) 📝 `packages/server/src/services/capability-packages/capability-module-runtime.service.ts` (+16 -2) 📝 `packages/server/src/services/capability-packages/capability-persistence.service.ts` (+5 -0) 📝 `packages/server/src/services/capability-packages/capability-resources.service.ts` (+31 -3) ➕ `packages/server/src/services/capability-packages/capability-route-registration.service.ts` (+139 -0) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+3 -0) ➕ `packages/server/src/services/generation/long-term-memory-runtime.ts` (+87 -0) 📝 `packages/server/src/services/generation/runtime-agent-sections.ts` (+7 -7) 📝 `packages/server/src/services/local-embedder.ts` (+9 -1) 📝 `packages/shared/src/schemas/capability-package.schema.ts` (+1 -1) 📝 `packages/shared/src/types/capability-runtime.ts` (+59 -2) _...and 3 more files_ </details> ### 📄 Description ## Linked issue Closes #4132 ## Why this change - The downloadable Long-Term Memory package needs stable Engine-owned contracts for data access, model routing, embeddings, privileged maintenance routes, prompt injection, settings UI, backups, and compatibility. Without these contracts, package code would have to duplicate or depend on private Engine internals. - This keeps package-owned behavior in `Pasta-Devs/Marinara-Agents` while keeping host integration in Marinara Engine, matching the repository ownership boundary. ## What changed - Added capability hosts for stable local embeddings, richer language-model requests, chat/resource access, and package-owned privileged routes. - Added the narrow Long-Term Memory runtime bridge for recall and accepted-prompt accounting. - Integrated recalled context with normal prompt assembly, preset markers, cached regeneration, package settings, and backup coverage. - Preserved cumulative capability API 1.x compatibility and hardened package route namespaces, authorization order, activation rollback, and embedding input bounds. - Added focused lifecycle and prompt regression coverage. - Added Long-Term Memory to the downloadable-agent overview and reference; translation follow-up is tracked in #4131. ## Validation Automated commands completed locally: - `pnpm check` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/capability-package-lifecycle.regression.ts` - `pnpm regression:prompt` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` - [x] `pnpm check` passes locally - [ ] 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 - Manually install the matching Long-Term Memory package artifact and restart Marinara. - Manually enable Long-Term Memory in Conversation, Roleplay, Visual Novel, and Game chats. - Manually verify package settings open, edit, persist, and respect the guarded Chat Settings close flow. - Manually verify recalled memories appear in the generated prompt at default placement and an explicit preset marker. - Manually verify regeneration reuses cached context without recording duplicate prompt accounting. - Manually verify vault maintenance/import/export routes require privileged access. - Manually verify backup and restore preserve package-owned Long-Term Memory data. - Manually verify desktop/mobile and light/dark presentation; attach screenshots or recordings before ready-for-review. - Manually build and run the container path. ## Risk And Proof Boundary - Core claim: an installed Long-Term Memory package can use stable Engine hosts and contribute recalled context without package implementation code living in Engine. - Risk types: prompt assembly, provider request shaping, package storage/backups, privileged routes, compatibility, and dynamic package UI. - Entrypoints covered: generation route, capability runtime activation, package routes, package settings mount, preset sections, and backup roots. - Automated positive coverage: capability API compatibility, host availability, aggregate embedding bounds, package route namespace/duplicate guards, preset marker placement, fallback placement, and guarded settings navigation. - Automated negative controls: unsupported capability versions, invalid route namespaces, normalized duplicate routes, missing runtime service, failed recall/accounting, and unmatched preset sections. - Proof gaps: real package artifact installation, browser UI, container runtime, backup/restore round trip, and provider-backed extraction remain manual. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [x] 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) Documentation was updated in `docs/agents/agents-overview.md` and `docs/agents/built-in-agents.md`. Translation follow-up: #4131. No version bump is included. ## UI evidence (if applicable) Not yet attached. Screenshots or recordings are required before moving this draft to ready for review. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Long-Term Memory as an installable capability package. * Long-Term Memory can be enabled from chat settings and included in preset sections. * Chat responses can recall relevant saved context and record accepted prompts. * Long-Term Memory data is included in backups and profile exports. * **Documentation** * Updated agent catalog counts and added Long-Term Memory setup, compatibility, settings, and data lifecycle details. * **Bug Fixes** * Improved settings drawer safeguards when closing before opening agent configuration. <!-- 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-23 04:08:33 +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#6244
No description provided.