Skip to documentation
Docs navigation
Docs/How it works
Core concepts

How it works

MemoGrafter turns conversation history into structured graph memory, then retrieves only the context an agent needs.

System overview

MemoGrafter sits between your application, its model, and a graph-backed store. During a conversation, it combines the current message with recent raw history and relevant long-term memories to produce a response. Afterward, it ingests new turns in the background so the memory graph stays current without delaying the reply.

The graph keeps broad topics separate from atomic facts and connects them with edges. This structure lets MemoGrafter recall, maintain, and transfer useful context without replaying an entire transcript.

Messages
Segments
Topic nodes
Memory nodes
Graph edges

From conversation to memory

Ingestion starts with raw user and assistant messages. MemoGrafter detects topic changes, groups related turns into segments, summarizes each segment as a topic node, and extracts durable facts into memory nodes.

Messages preserve the original conversation turns.
Segments mark contiguous ranges that discuss one topic.
Topic nodes summarize those ranges and provide the graph backbone.
Memory nodes store individual facts, insights, tasks, questions, and references.
Graph edges preserve semantic, temporal, reentry, update, and graft relationships.

From memory to context

When an agent needs context, MemoGrafter embeds the query, searches active memory nodes by meaning, filters out forgotten or suppressed records, ranks the remaining facts, and formats the best results within a token budget. The application receives concise, prompt-ready memory instead of a full conversation archive.

invoke()
Recall facts
LLM response
Background ingest
Graph memory

Memory across sessions

Grafting moves relevant memory into another session or agent while preserving where it came from. Lifecycle controls can forget memories, suppress topics, restore them, or mark facts as decayed, conflicting, or superseded without deleting the underlying history by default.

Recall retrieves relevant facts for the current request.
Grafting selects or copies useful context across sessions with provenance.
Lifecycle and maintenance keep active context accurate while retaining an auditable history.