Overview
Memory graph commands enable building rich knowledge graphs from thread data with summaries, embeddings, and semantic search capabilities. Prerequisites: Requireswatercooler-cloud[memory] package.
Commands
memory build
Build memory graph from threads with summaries and embeddings.Usage
Options
Threads directory. Defaults to
./watercooler or $WATERCOOLER_DIR.Output file path for graph JSON. Alias:
-o.Skip summary generation (faster, less context)
Skip embedding generation (no semantic search)
Git branch context for filtering threads
Examples
Build full graph
Save graph to file
Fast build (no enrichment)
Build for specific branch
memory export
Export graph to external format (LeanRAG or JSON).Usage
Options
Input graph JSON file. If not provided, builds from threads.
Threads directory (if building graph)
Export format:
leanrag or jsonOutput path. Directory for LeanRAG, file for JSON. Alias:
-o.Exclude embeddings from export
Examples
Export to LeanRAG
Export pre-built graph
Export without embeddings
Export as JSON
memory stats
Show graph statistics and metadata.Usage
Options
Graph JSON file. If not provided, builds from threads.
Threads directory (if building graph)
Examples
Show stats for current threads
Show stats for saved graph
Show stats for specific directory
Graph Structure
Nodes
- Threads: Top-level containers
- Entries: Individual thread entries
- Chunks: Text segments for embedding
Edges
- Thread → Entry: Containment
- Entry → Entry: Temporal sequence
- Entry → Chunk: Decomposition
Hyperedges
- Cross-thread references: Links between related threads
- Topic clusters: Semantic groupings
Enrichment
Summaries
Generated using LLM (requires API key):--no-summaries for faster builds.
Embeddings
Generated for semantic search (requires API key):--no-embeddings if semantic search not needed.
LeanRAG Export Format
Exported directory structure:Workflows
Initial graph build
Export for external use
Incremental updates
Quick analysis (no enrichment)
Performance Considerations
Build Time
- No enrichment: Fast (seconds)
- With summaries: Medium (API calls per entry)
- With embeddings: Slower (API calls per chunk)
Costs
- Summaries use LLM API (token costs)
- Embeddings use embedding API (per-token costs)
- Costs scale with thread content size
Optimization Tips
- Use
--no-summariesif context not needed - Use
--no-embeddingsif semantic search not needed - Filter by branch to reduce scope
- Cache graphs with
--outputto avoid rebuilds
Error Handling
Missing dependencies
API key missing
Build error
Related Commands
- baseline-graph build - Free-tier alternative
- search - Query memory graph (MCP)
- smart-query - Natural language queries (MCP)
- find-similar - Semantic similarity search (MCP)