[GH-ISSUE #563] [Feature]: Explore graph-based RAG memory for chat summaries #257

Closed
opened 2026-10-20 17:26:51 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @cha1latte on GitHub (May 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/563

What problem does this solve?

Long roleplay chats can require large amounts of message history or summary context to preserve important details. That can make each request grow over time, create pressure on smaller context windows, and make it harder for the model to retrieve only the facts that matter for the current response.

Proposed solution

Explore a graph-based RAG memory system per chat. The proposed shape is:

  • Store chat facts and relationships in a simple graph database or graph-like store.
  • During the thinking step, let a tool or function query the graph for relevant information before the response.
  • After the response, have an agent scan the message and insert or update graph data.
  • Store details such as character likes, current outfit, looks, personality, current situation, and who/what/where/when/why/how context.
  • Let the model ask the memory store targeted questions instead of always receiving the full long-term history.

The goal is to support very long or effectively infinite roleplay sessions with a much smaller active message history, potentially even only the latest few messages plus retrieved graph facts.

Alternatives considered

Regular summaries and long-context chat history. The reporter notes that graph-backed retrieval could preserve more detailed relationships and only inject what is needed, though it may cost more tokens per request and may not work well with caching.

Additional context

Discord source: https://discord.com/channels/1417099416812392641/1502158665606627378

Reported by VirstaRole icon, VIP OP, in Discord on May 8, 2026 at 12:02 AM.

The reporter called this a large, complicated feature and noted it could potentially apply to lorebooks as well, perhaps as a new database-backed lorebook style rather than the current tag-based approach. They compared the desired behavior to coding agents or web search systems that gather relevant files/pages during a thinking step instead of keeping all source data in the prompt at all times.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @cha1latte on GitHub (May 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/563 ## What problem does this solve? Long roleplay chats can require large amounts of message history or summary context to preserve important details. That can make each request grow over time, create pressure on smaller context windows, and make it harder for the model to retrieve only the facts that matter for the current response. ## Proposed solution Explore a graph-based RAG memory system per chat. The proposed shape is: - Store chat facts and relationships in a simple graph database or graph-like store. - During the thinking step, let a tool or function query the graph for relevant information before the response. - After the response, have an agent scan the message and insert or update graph data. - Store details such as character likes, current outfit, looks, personality, current situation, and who/what/where/when/why/how context. - Let the model ask the memory store targeted questions instead of always receiving the full long-term history. The goal is to support very long or effectively infinite roleplay sessions with a much smaller active message history, potentially even only the latest few messages plus retrieved graph facts. ## Alternatives considered Regular summaries and long-context chat history. The reporter notes that graph-backed retrieval could preserve more detailed relationships and only inject what is needed, though it may cost more tokens per request and may not work well with caching. ## Additional context Discord source: https://discord.com/channels/1417099416812392641/1502158665606627378 Reported by VirstaRole icon, VIP OP, in Discord on May 8, 2026 at 12:02 AM. The reporter called this a large, complicated feature and noted it could potentially apply to lorebooks as well, perhaps as a new database-backed lorebook style rather than the current tag-based approach. They compared the desired behavior to coding agents or web search systems that gather relevant files/pages during a thinking step instead of keeping all source data in the prompt at all times. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:26:51 +07:00
Author
Owner

@cha1latte commented on GitHub (May 8, 2026):

Triage note: labeling this as scope-risk because the memory problem is core to long-form roleplay, but the proposed solution spans storage, tool use, agent extraction, prompt assembly, and possibly a new lorebook-like surface.

The least risky next step is to narrow this into a design/prototype slice, such as read-only graph retrieval for one chat memory category, before committing to a full graph-backed memory system.

<!-- gh-comment-id:4407674392 --> @cha1latte commented on GitHub (May 8, 2026): Triage note: labeling this as `scope-risk` because the memory problem is core to long-form roleplay, but the proposed solution spans storage, tool use, agent extraction, prompt assembly, and possibly a new lorebook-like surface. The least risky next step is to narrow this into a design/prototype slice, such as read-only graph retrieval for one chat memory category, before committing to a full graph-backed memory system.
Author
Owner

@cha1latte commented on GitHub (May 8, 2026):

Correction to the earlier triage label: moving this from scope-risk to feature-creep.

The memory problem is real and relevant, but the proposed graph-based RAG system is larger than a normal feature request. It overlaps long-term memory, RAG, knowledge graph storage, tool/query behavior, extraction agents, and prompt assembly. This should be handled as a larger architecture/design track or prototype effort before it becomes an implementable issue.

<!-- gh-comment-id:4408992387 --> @cha1latte commented on GitHub (May 8, 2026): Correction to the earlier triage label: moving this from `scope-risk` to `feature-creep`. The memory problem is real and relevant, but the proposed graph-based RAG system is larger than a normal feature request. It overlaps long-term memory, RAG, knowledge graph storage, tool/query behavior, extraction agents, and prompt assembly. This should be handled as a larger architecture/design track or prototype effort before it becomes an implementable issue.
Author
Owner

@SpicyMarinara commented on GitHub (May 10, 2026):

For the feature, we already have a few Developers considering how to introduce it.

<!-- gh-comment-id:4414908859 --> @SpicyMarinara commented on GitHub (May 10, 2026): For the feature, we already have a few Developers considering how to introduce it.
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#257
No description provided.