REMem organizes information as a hybrid memory graph that combines structured knowledge (entities, facts) with episodic traces (conversation history, gist summaries) and semantic similarity.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/intuit-ai-research/REMem/llms.txt
Use this file to discover all available pages before exploring further.
Graph Philosophy
Why a graph? Traditional RAG systems retrieve passages using dense search alone. REMem enhances this by:- Structured memory: Extracting entities and facts creates explicit knowledge representation
- Associative recall: Graph edges enable multi-hop reasoning across related concepts
- Episodic memory: Gist summaries provide compressed, context-aware representations
- Semantic clustering: Synonymy edges connect similar entities for better coverage
Node Types
The graph contains different node types depending on the extraction method:Standard OpenIE Nodes
Entities (prefix:entity-):
- Named entities extracted from triples (subjects and objects)
- Example: “Alan Turing”, “Turing Test”, “1950”
- Embedded for semantic search
fact-):
- Subject-predicate-object triples
- Example: “(Alan Turing, proposed, Turing Test)”
- Stored as strings for embedding: “Alan Turing proposed Turing Test”
- Original document chunks
- Connected to entities mentioned within them
- Used for final answer generation
paraphrase-, only for episodic_gist):
- Chunk-level summaries
- Connected to their source chunks
Episodic Gist Nodes
The episodic_gist extraction method creates a richer graph structure: Verbatim (prefix:verbatim-):
- Original conversation turns or document chunks
- Can be split per message if
split_verbatim_per_chunk=True - Contains full context with speaker roles and timestamps
gists-):
- Paraphrased summaries of verbatim content
- Multiple gists per chunk for different aspects
- Can be concatenated if
concatenate_gists_per_chunk=True - Example: “User asked about implementing a search feature”
facts-):
- Structured knowledge extracted from conversations
- Includes qualifiers like time, location, emotion
- Format:
{"subject": "User", "predicate": "wants to implement", "object": "search feature", "qualifiers": {"time": "2024-01-15"}}
entity-):
- Named entities from facts (subjects and objects)
- Used as connection points in the graph
Temporal Nodes
The temporal extraction method focuses on time-aware facts:- Verbatim: Original text chunks
- Facts: Triples with temporal qualifiers
- Entities: Named entities from facts
Edge Types
Edges connect nodes based on different relationships:Fact Edges (Entity → Entity)
Connect subject and object entities from extracted triples:Context Edges (Passage → Entity)
Connect passages to entities mentioned within them:Synonymy Edges (Entity ↔ Entity)
Connect semantically similar entities based on embedding similarity:synonymy_edge_sim_threshold (default 0.8) are connected.
Why synonymy edges? They help with:
- Spelling variations: “Alan Turing” ↔ “A. Turing”
- Abbreviations: “USA” ↔ “United States”
- Related concepts: “search” ↔ “retrieval”
Episodic Gist Edges
For episodic_gist extraction, additional edge types connect the graph: Verbatim → Gist (episodic_gist_strategy.py:267-271):Graph Construction
The graph is built incrementally during indexing:1. Extract Structure
Depending on the extraction method, different units are extracted:2. Create Node Embeddings
Each node type gets embedded for semantic search:3. Add Nodes to Graph
New nodes are added with attributes (episodic_gist_strategy.py:437-438):4. Add Edges
Edges are created from thenode_to_node_count statistics (episodic_gist_strategy.py:460-478):
5. Augment with Synonymy
Synonymy edges are added using KNN search:6. Persist
The graph is saved to disk for reuse:Graph Statistics
You can inspect the graph structure:Configuration Options
Control graph construction with these config parameters:Higher
synonymy_edge_topk creates denser graphs but increases memory usage and retrieval time.Why This Structure?
The hybrid graph addresses key RAG challenges: Multi-hop reasoning: Navigate entity→entity→passage to answer “Who proposed the test that Turing created?” Semantic clustering: Synonymy edges connect “AI” and “artificial intelligence” even if embeddings differ slightly Episodic context: Gist nodes provide compressed summaries for long conversations without losing the verbatim details Temporal awareness: Temporal qualifiers enable “What happened after X?” queries Efficient retrieval: Graph structure reduces search space compared to brute-force passage retrievalNext Steps
- Learn about Extraction Methods that populate the graph
- Understand Retrieval Strategies that navigate the graph
- Review Architecture for the full pipeline