| description | Keep your Code-Graph-RAG knowledge graph synchronised with code changes using the real-time file watcher. |
|---|
For active development, keep your knowledge graph automatically synchronised with code changes using the real-time updater.
- Watches your repository for file changes (create, modify, delete)
- Automatically updates the knowledge graph in real-time
- Maintains consistency by recalculating all function call relationships
- Filters out irrelevant files (
.git,node_modules, etc.)
Run the real-time updater in a separate terminal:
python realtime_updater.py /path/to/your/repoOr using the Makefile:
make watch REPO_PATH=/path/to/your/repopython realtime_updater.py /path/to/your/repo \
--host localhost --port 7687 --batch-size 1000make watch REPO_PATH=/path/to/your/repo HOST=localhost PORT=7687 BATCH_SIZE=1000# Terminal 1: Start the real-time updater
python realtime_updater.py ~/my-project
# Terminal 2: Run the AI assistant
cgr start --repo-path ~/my-project| Argument | Required | Default | Description |
|---|---|---|---|
repo_path |
Yes | Path to repository to watch | |
--host |
No | localhost |
Memgraph host |
--port |
No | 7687 |
Memgraph port |
--batch-size |
No | Number of buffered nodes/relationships before flushing to Memgraph |
The updater batches rapid saves with a debounce window and recalculates all CALLS relationships on every processed change to ensure consistency. This prevents "island" problems where changes in one file aren't reflected in relationships from other files, but may impact performance on very large codebases with frequent changes. Optimisation of this behaviour is a work in progress.