watercooler_memory_sync
Sync threads to memory backends (Graphiti T2, LeanRAG T3) for semantic search and knowledge graph features.Overview
Memory sync indexes thread content into:- T2 (Graphiti): Temporal knowledge graph with entities and relationships
- T3 (LeanRAG): Hierarchical clustering with multi-hop reasoning
- Semantic search across all threads
- Entity and relationship queries
- Temporal “what changed when?” queries
- Multi-hop “why did we X given Y?” reasoning
Automatic vs Manual Sync
Automatic Sync
By default, threads are synced automatically:- After every
say/ack/handoff: Entry is queued for indexing - Fire-and-forget: Indexing happens in background, doesn’t block tools
- Retry logic: Failed indexing is retried automatically
Manual Sync
Use this tool to:- Bulk index: Index many threads at once
- Force refresh: Re-index threads with updated config
- Recovery: Index threads that failed automatic sync
Parameters
Specific thread topics to syncIf
null, syncs all threadsWhich backend to sync toOptions:
"all"- Sync to all enabled backends"graphiti"- T2 only"leanrag"- T3 only
Force re-indexing even if already indexed
Path to code repository directoryResolves:
- Threads directory location
- Database name for backends
Return Value
Returns JSON with sync status:Whether sync was queued successfully
Whether tasks were queued (true) or executed directly (false)
List of queued task IDs (if queued)
Number of threads/entries indexed (if direct execution)
Status message
Usage Examples
Sync All Threads
Sync Specific Threads
Force Re-Index
Sync to Specific Backend
Example Output
Queued Execution
Direct Execution
Sync Process
T2 (Graphiti) Indexing
- Entry chunking: Split entries into semantic chunks
- Entity extraction: LLM extracts entities and relationships
- Embedding generation: Chunks embedded with configured model
- Graph storage: Nodes and edges written to FalkorDB
- Provenance tracking: Entry-to-episode mapping stored
T3 (LeanRAG) Indexing
- Episode extraction: Load episodes from Graphiti (T2)
- Clustering: Hierarchical clustering by semantic similarity
- Summarization: LLM generates cluster summaries
- Graph storage: Cluster hierarchy written to FalkorDB
- Incremental update: Only new episodes processed (if enabled)
Queue vs Direct Execution
Queued Execution (Default)
When memory task queue is available:- Tasks are queued for background processing
- Tool returns immediately
- Progress tracked via
watercooler_memory_task_status - Retry logic handles failures
Direct Execution (Fallback)
When queue is unavailable:- Indexing runs synchronously
- Tool blocks until complete
- Useful for debugging
- May timeout on large threads (>50 entries)
Monitoring Progress
Check indexing status:Prerequisites
T2 (Graphiti)
T3 (LeanRAG)
Best Practices
Initial Setup
- Enable backends: Set environment variables
- Start services: Launch FalkorDB
- Bulk index: Sync all existing threads
Ongoing Use
Automatic sync handles new entries - no manual intervention needed.Recovery
If automatic sync fails:Config Changes
After changing embedding model or LLM:Troubleshooting
Indexing Fails
Cause: API key invalid or quota exceeded Solution:FalkorDB Connection Error
Cause: FalkorDB not running Solution:Timeout on Large Threads
Cause: Direct execution timeout (60s tool limit) Solution:- Ensure queue is enabled (automatic)
- Split large threads into smaller chunks
- Use CLI:
watercooler memory index
Related Tools
- watercooler_memory_task_status - Monitor indexing progress
- watercooler_smart_query - Query indexed memory
- watercooler_find_similar - Find similar entries
- watercooler_diagnose_memory - Check backend health