mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #589] [Feature]: Agent Memory Enhancement #271
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#271
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 @adunato on GitHub (May 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/589
What problem does this solve?
Built-in agents can persist narrow key/value state today through
agent_memory, but they do not have a clean general-purpose way to save, search, list, and delete durable agent memory records. Moreover, there is currently no system to allow custom agents to save arbitrary data.The current storage surfaces each solve a different problem:
memory_chunks; it is derived recall, not agent-authored memory records.extensions.characterMemories; those entries do not have a dedicated tool API, stable record model, or flexible search/list/delete behavior.storage/tables/agent_memory.json; it is useful for small internal state and is currently used by the secret plot agent, but it is narrow and not a general searchable record store.The enhanced storage should fit the current file-native table storage model under
DATA_DIR/storage.Proposed solution
Enhance agent memory into a typed, owner-aware record store and add built-in tools that let both built-in and custom agents manage those records:
save_agent_memorysearch_agent_memorylist_agent_memorydelete_agent_memorysave_agent_memoryshould let an agent store text content with optional title, memory type, metadata, character selector, and optional semantic indexing.search_agent_memoryshould support multiple search modes:literalfor exact or case-insensitive text matching.fuzzyfor lightweight non-vector approximate matching.semanticfor embedding-backed search when semantic index data is available.list_agent_memoryshould browse records by memory type and resolved ownership fields with pagination, without requiring a query.delete_agent_memoryshould delete or disable a record by ID while enforcing ownership checks.The model should not pass raw internal IDs. The server should resolve model-facing ownership selectors from tool execution context, including current chat, active characters, and executing agent config.
Storage should evolve the existing file-native agent memory storage where practical:
The proposed record shape is:
idmemoryTypegeneral,continuity,planning, orsecret_plot_internal.keytitlecontentmetadatachatIdcharacterIdagentConfigIdembeddingcontentHashenabledcreatedAtupdatedAtdeletedAtThe current secret plot agent should continue to work through the enhanced memory system. Its current key-value rows can map into enhanced records like this:
agent_memoryrowkey = "overarchingArc",value = object/stringmemoryType = "secret_plot_internal",key = "overarchingArc",agentConfigId = secret plot agent,chatId = current chat,metadata.rawValue = value, protected from normal clear.key = "sceneDirections",value = active direction arraymemoryType = "secret_plot_internal",key = "sceneDirections",agentConfigId = secret plot agent,chatId = current chat,metadata.rawValue = value.key = "recentlyFulfilled",value = string arraymemoryType = "secret_plot_internal",key = "recentlyFulfilled",agentConfigId = secret plot agent,chatId = current chat,metadata.rawValue = value.key = "pacing",value = string/structured valuememoryType = "secret_plot_internal",key = "pacing",agentConfigId = secret plot agent,chatId = current chat,content = string value when possible,metadata.rawValue = value.key = "staleDetected",value = booleanmemoryType = "secret_plot_internal",key = "staleDetected",agentConfigId = secret plot agent,chatId = current chat,metadata.rawValue = value.This should preserve current behavior while moving secret plot state onto the same enhanced memory framework used by the new tools.
Alternatives considered
memory_chunks: rejected because Memory Recall stores automatic chat chunks, not explicit agent-authored records.extensions.characterMemories: rejected because those entries lack stable tool-addressable IDs and have conversation-specific lifecycle behavior.agent_memoryunchanged: rejected because narrow key/value state does not support listing, searching, memory categorization, metadata, or semantic retrieval.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@adunato commented on GitHub (May 9, 2026):
Happy to pick this up as a PR once I get a nod on approach.
@SpicyMarinara commented on GitHub (May 10, 2026):
@adunato Sounds good, we'll be checking the PR as soon as it hits the towers.