mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4851] [Feature]: Persistent, retrievable memory for Professor Mari (preferences + behavior directives) #2683
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2683
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4851
Originally assigned to: @kolacheee on GitHub.
What problem does this solve?
Professor Mari has no persistent memory of a user's preferences across sessions. Every new conversation, the user re-explains the same things: how they like lorebooks and character cards formatted, their naming/workflow conventions, and how eager (or cautious) they want Mari to be when making changes.
Two concrete gaps:
Constraint: users pay for their own model usage, so whatever we build must be token-efficient — it can't dump a pile of stored text into every prompt, and irrelevant stored memories must not dilute/poison the context.
Proposed solution
A persistent, per-install store of user "instructions/memories" (markdown), with retrieval rather than always-on injection. Scoped as v1 below; embeddings/scale left for later.
Two entry paths (both in v1):
.mdupload surface Mari already has for Skills).instructions.remember/instructions.forgetapp-data action so "remember that I…" persists a memory. The write is surfaced through the existing Keep/Restore review card (exact text shown before it persists), so a self-written memory is never invisible.Retrieval — index-and-fetch (token-efficient):
instructions.get <id>read-action only when it's relevant. Irrelevant memories cost ~nothing and can't poison the turn.pinnedescape hatch: a memory may opt to always inject its body. Reserved for the rare critical behavioral directive that can't risk a fetch-miss — not the default.Precedence:
Architecture (grounded in the current code):
executeMutation→createAppliedReview) — free undo, audit, and journaling, zero changes to the pipeline.buildPromptMessages()(workspace-agent.service.ts), modeled directly on the shipped Professor Mari Custom Skills system, which already does file-backed markdown → per-turn prompt injection.Safety: Mari persists a memory only in response to a genuine user instruction, never as a reflex to content she just read — so a shared character / lorebook / preset can't silently plant a standing instruction (the one real injection vector a first-class self-write tool would otherwise open).
Alternatives considered
Additional context
memory_*namespace — "memory" already means four different things in the engine (conversation-RAGmemory_chunks, the "Important Memories" prompt block, character scene memories,conversation_notes). Proposed:mari_instructionstable /instructions.*actions /<professor_mari_instructions>block. User-facing label TBD (bikesheddable).Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: