Skip to content

feat(ltm): integrate Long-Term Memory package host#4133

Open
Promansis wants to merge 1 commit into
Pasta-Devs:stagingfrom
Promansis:feature/long-term-memory-release
Open

feat(ltm): integrate Long-Term Memory package host#4133
Promansis wants to merge 1 commit into
Pasta-Devs:stagingfrom
Promansis:feature/long-term-memory-release

Conversation

@Promansis

@Promansis Promansis commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

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 [docs-i18n] docs/agents/agents-overview.md, docs/agents/built-in-agents.md #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.

@github-actions github-actions Bot added the feature New feature or enhancement label Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SpicyMarinara, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 384b2be4-91c7-4715-9f0a-90167b579183

📥 Commits

Reviewing files that changed from the base of the PR and between e99cf9d and 91ba44f.

📒 Files selected for processing (21)
  • docs/agents/agents-overview.md
  • docs/agents/built-in-agents.md
  • packages/client/src/components/chat/ChatSettingsDrawer.tsx
  • packages/client/src/components/presets/PresetEditor.tsx
  • packages/server/src/routes/backup.routes.ts
  • packages/server/src/routes/generate.routes.ts
  • packages/server/src/routes/generate/generate-route-utils.ts
  • packages/server/src/services/capability-packages/capability-embedding.service.ts
  • packages/server/src/services/capability-packages/capability-language-model.service.ts
  • packages/server/src/services/capability-packages/capability-module-runtime.service.ts
  • packages/server/src/services/capability-packages/capability-persistence.service.ts
  • packages/server/src/services/capability-packages/capability-resources.service.ts
  • packages/server/src/services/capability-packages/capability-route-registration.service.ts
  • packages/server/src/services/generation/long-term-memory-runtime.ts
  • packages/server/src/services/generation/runtime-agent-sections.ts
  • packages/server/src/services/local-embedder.ts
  • packages/shared/src/schemas/capability-package.schema.ts
  • packages/shared/src/types/capability-runtime.ts
  • scripts/regressions/capability-package-lifecycle.regression.ts
  • scripts/regressions/open-issues.regression.ts
  • scripts/regressions/prompt.regression.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SpicyMarinara
SpicyMarinara marked this pull request as ready for review July 26, 2026 16:58
@SpicyMarinara

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants