How tirth8205/code-review-graph works
code-review-graph builds and incrementally maintains a local code knowledge graph, then serves compact search and review context to AI tools over MCP. The main workflow is repository changes → parsing and graph updates → graph-backed queries and review context → AI assistant. The VS Code extension provides a separate UI over the graph database and Python backend. Major documented capabilities include semantic search, impact analysis, flows, communities, and integration setup. Some subsystem links are based on README or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: main.py CLI commands · graph.py Graph database · extension.ts VS Code extension · incremental.py Incremental updater
Components 24
Graph construction
- Incremental updater
code_review_graph/incremental.py - Code parser
code_review_graph/parser.py
Graph and indexing
- Graph database
code_review_graph/graph.py - Schema migrations
code_review_graph/migrations.py - Hybrid search
code_review_graph/search.py - Semantic embeddings
code_review_graph/embeddings.py - Flow analysis
code_review_graph/flows.py - Community analysis
code_review_graph/communities.py
Context tools
- Change review context
code_review_graph/tools/review.py - Graph queries
code_review_graph/tools/query.py - Tool utilities
code_review_graph/tools/_common.py - Context history
code_review_graph/context_history.py
Tool integrations
- CLI commands
code_review_graph/main.py - MCP server
code_review_graph/main.py - Platform installer
code_review_graph/install_plan.py
VS Code extension
- VS Code extension
code-review-graph-vscode/src/extension.ts - Python backend bridge
code-review-graph-vscode/src/backend/cli.ts - Read-only DB access
code-review-graph-vscode/src/backend/sqlite.ts - Graph and tree views
code-review-graph-vscode/src/views/graphWebview.ts - Extension search
code-review-graph-vscode/src/features/search.ts - Extension review
code-review-graph-vscode/src/features/reviewAssistant.ts
Other components
- Developer
- AI coding tool
- Code repository
Connections 27
- Developer → CLI commands: runs commands
README.md - CLI commands → Incremental updater: builds or updates
code_review_graph/main.py - Code repository → Incremental updater: provides source
README.md - Incremental updater → Code parser: parses files
code_review_graph/incremental.py - Incremental updater → Graph database: updates graph
code_review_graph/incremental.py - Graph database → Code parser: uses parsing
code_review_graph/graph.py - Graph database → Schema migrations: applies schema
code_review_graph/graph.py - Hybrid search → Graph database: queries graph
code_review_graph/search.py - Hybrid search → Semantic embeddings: uses vectors
code_review_graph/search.py - CLI commands → MCP server: serves tools
code_review_graph/main.py - MCP server → Graph queries: dispatches queries
code_review_graph/main.py - MCP server → Change review context: dispatches review
code_review_graph/main.py - Graph queries → Tool utilities: uses utilities
code_review_graph/tools/query.py - Change review context → Tool utilities: uses utilities
code_review_graph/tools/review.py - Change review context → Graph database: reads impact
code_review_graph/tools/review.py - AI coding tool → MCP server: requests context
README.md - Developer → Platform installer: configures tools
README.md - CLI commands → Flow analysis: builds flow data
- CLI commands → Community analysis: builds communities
- VS Code extension → Python backend bridge: invokes backend
code-review-graph-vscode/src/extension.ts - VS Code extension → Read-only DB access: opens graph data
code-review-graph-vscode/src/extension.ts - VS Code extension → Graph and tree views: registers views
code-review-graph-vscode/src/extension.ts - Graph and tree views → Read-only DB access: reads graph
code-review-graph-vscode/src/views/graphWebview.ts - Extension search → Read-only DB access: queries database
code-review-graph-vscode/src/features/search.ts - Extension review → Read-only DB access: queries database
code-review-graph-vscode/src/features/reviewAssistant.ts - VS Code extension → Platform installer: offers onboarding
code-review-graph-vscode/src/extension.ts - MCP server → Context history: records savings