[GH-ISSUE #4132] [Feature]: Add Engine host integration for Long-Term Memory #2242

Closed
opened 2026-10-21 05:46:35 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jul 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4132

Originally assigned to: @Promansis on GitHub.

This was generated by AI during triage.

What problem does this solve?

Marinara can summarize chats and semantically recall older message chunks, but a downloadable Long-Term Memory package also needs stable Engine-owned integration points to extract durable facts from summaries, character records, personas, and lorebooks, maintain package-owned storage, and inject only relevant memories before the main reply.

Without those host contracts, the package would need to duplicate Engine storage/provider logic, depend on private internals, or ship agent-specific runtime code inside Marinara Engine. That would make the package fragile across Engine updates and blur the ownership boundary between Marinara Engine and Pasta-Devs/Marinara-Agents.

Proposed solution

Add the minimum Engine-owned host integration needed by the separately released Long-Term Memory package:

  • Expose stable capability APIs for package-scoped persistence, characters, personas, lorebooks, language-model resolution, context fitting, usage reporting, cancellation, structured output, and a stable local embedding space.
  • Allow package-owned privileged routes under a package-specific /api/<package-id> namespace, with privileged access checks and activation cleanup.
  • Register a narrow long-term-memory:runtime service for recall and accepted-prompt accounting.
  • Inject recalled memory into normal prompt assembly, including explicit prompt-preset marker placement and cached regeneration behavior.
  • Mount the package-provided chat settings UI and expose Long-Term Memory as an available prompt-preset section.
  • Include package-owned durable Long-Term Memory data in Engine backups.
  • Preserve cumulative capability API compatibility for packages built against earlier 1.x host contracts.
  • Document Long-Term Memory in the downloadable-agent overview and reference.

The package definition, prompts, package-owned runtime implementation, manifest, artifact, artwork, and catalog entry remain owned by Pasta-Devs/Marinara-Agents; this issue covers Engine host integration only.

Alternatives considered

  • Reuse Memory Recall alone: it searches chunks of prior chat messages, but it does not provide the package-owned durable-fact vault, source imports, review flow, scope model, or extraction pipeline required here.
  • Reuse summaries alone: summaries compress history but do not retrieve a small set of relevant durable memories across supported sources and scopes.
  • Implement Long-Term Memory directly as a built-in Engine agent: rejected because downloadable agent behavior and package-owned runtime belong in Pasta-Devs/Marinara-Agents.
  • Expose raw Engine internals to the package: rejected because stable, narrow host contracts are safer and easier to maintain.

Additional context

Implementation owner: @Promansis.

Implementation branch: Promansis:feature/long-term-memory-release, based on current upstream/staging.

The branch contains one focused commit and has passed:

  • pnpm check
  • Capability package lifecycle regression
  • pnpm regression:prompt
  • Open-issue regression

Manual browser verification, screenshots, container validation, and package-release end-to-end verification remain required before merge.

Translated documentation is tracked separately in #4131.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jul 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4132 Originally assigned to: @Promansis on GitHub. > *This was generated by AI during triage.* ## What problem does this solve? Marinara can summarize chats and semantically recall older message chunks, but a downloadable Long-Term Memory package also needs stable Engine-owned integration points to extract durable facts from summaries, character records, personas, and lorebooks, maintain package-owned storage, and inject only relevant memories before the main reply. Without those host contracts, the package would need to duplicate Engine storage/provider logic, depend on private internals, or ship agent-specific runtime code inside Marinara Engine. That would make the package fragile across Engine updates and blur the ownership boundary between Marinara Engine and `Pasta-Devs/Marinara-Agents`. ## Proposed solution Add the minimum Engine-owned host integration needed by the separately released Long-Term Memory package: - Expose stable capability APIs for package-scoped persistence, characters, personas, lorebooks, language-model resolution, context fitting, usage reporting, cancellation, structured output, and a stable local embedding space. - Allow package-owned privileged routes under a package-specific `/api/<package-id>` namespace, with privileged access checks and activation cleanup. - Register a narrow `long-term-memory:runtime` service for recall and accepted-prompt accounting. - Inject recalled memory into normal prompt assembly, including explicit prompt-preset marker placement and cached regeneration behavior. - Mount the package-provided chat settings UI and expose Long-Term Memory as an available prompt-preset section. - Include package-owned durable Long-Term Memory data in Engine backups. - Preserve cumulative capability API compatibility for packages built against earlier 1.x host contracts. - Document Long-Term Memory in the downloadable-agent overview and reference. The package definition, prompts, package-owned runtime implementation, manifest, artifact, artwork, and catalog entry remain owned by `Pasta-Devs/Marinara-Agents`; this issue covers Engine host integration only. ## Alternatives considered - Reuse Memory Recall alone: it searches chunks of prior chat messages, but it does not provide the package-owned durable-fact vault, source imports, review flow, scope model, or extraction pipeline required here. - Reuse summaries alone: summaries compress history but do not retrieve a small set of relevant durable memories across supported sources and scopes. - Implement Long-Term Memory directly as a built-in Engine agent: rejected because downloadable agent behavior and package-owned runtime belong in `Pasta-Devs/Marinara-Agents`. - Expose raw Engine internals to the package: rejected because stable, narrow host contracts are safer and easier to maintain. ## Additional context Implementation owner: @Promansis. Implementation branch: `Promansis:feature/long-term-memory-release`, based on current `upstream/staging`. The branch contains one focused commit and has passed: - `pnpm check` - Capability package lifecycle regression - `pnpm regression:prompt` - Open-issue regression Manual browser verification, screenshots, container validation, and package-release end-to-end verification remain required before merge. Translated documentation is tracked separately in #4131. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#2242
No description provided.