Infigraph
AST-powered code intelligence engine. Indexes codebases into a persistent knowledge graph with full Cypher queries, hybrid semantic search, cross-file call resolution, and 62 programming languages.
Built in Rust. Zero LLM dependency. Runs locally.
Key Highlights
- 62 Languages: Tree-sitter parsing for 62 languages + ANTLR grammar plugins for custom DSLs. Zero config.
- Graph Database: Full Cypher queries on your codebase — WITH, OPTIONAL MATCH, variable-length paths.
- Semantic Search: BM25 + Model2Vec hybrid search. Finds "retry logic" even if the function isn't named retry.
- SCIP Integration: Auto-downloads compiler-grade indexers (TypeScript, Python, Java, Go, Rust, C#, Ruby, Scala). Falls back to lsp-to-scip bridge for 14+ more languages.
- Cross-File Resolution: Import-aware call resolution links function calls to actual definitions across files.
- HTTP Route-Aware: Maps your API surface across 22 frameworks (Flask, Express, Spring, Actix, Phoenix, Rails, etc.).
- Multi-Repo/Microservice: Group repos, cross-repo Cypher queries, HTTP contract extraction, cross-service dependency detection.
- PR Review & CI: Symbol-level diff review with optional LLM enrichment. Configurable CI check gates (security, complexity, dead code, vulns).
- OSV Vulnerability Scanning: Scans dependencies against the OSV database for known vulnerabilities.
- Design Pattern Detection: Identifies Singleton, Factory, Observer, Strategy, Builder, and other patterns.
- Refactor Analysis: Complexity hotspots, coupling, near-duplicate detection, dead code — ranked by impact/effort.
- Document Indexing: Index PDF, DOCX, PPTX, HTML, Markdown with hybrid search.
- Confluence Wiki Crawler: BFS wiki crawl with incremental sync — indexes pages into the same search pipeline as code.
- Auto-Watch: File watcher auto-starts after indexing. Index stays fresh without manual intervention.
- HNSW Vector Index: Approximate nearest neighbor search for fast similarity queries at scale (~2ms for 500K symbols).
- Session Continuity: Persists context across AI agent sessions — summary, pending tasks, decisions, touched files.
- 74 MCP Tools: Full AI agent integration for 11 coding agents (Claude Code, Cursor, VS Code, Copilot, Windsurf, etc.).
- Sequence Diagrams: Auto-generates Mermaid sequence diagrams from call graphs.
- Cross-Language Detection: Delphi↔COM, VB6↔COM, C#↔JNI, FFI, gRPC, WASM bridges.
- Grammar Plugins: Drop
.g4+plugin.toml— parse any custom/internal DSL without Rust compilation. - Pipeline Plugins: Runtime-extensible pipeline metadata extraction — add new data pipeline formats (dbt, Airflow, custom) without recompiling. Dependency graphs, impact analysis, compliance queries.
- Web UI: Built-in graph explorer, search, route map at localhost:9749.
- Export: Neo4j Cypher, GraphML, JSON — take your graph anywhere.
Install
macOS / Linux
|
This:
- Downloads pre-built binaries from GitHub releases (if available)
- Falls back to cloning +
cargo build --release(installs Rust if needed) - Adds
infigraph,infigraph-mcp, andlsp-to-scipto~/.local/bin - Registers MCP server for all 11 AI coding agents
- Writes primary search instructions to
~/.claude/CLAUDE.md
System dependency:
cmakeis required to build the graph database. Install before building:brew install cmake(macOS) orsudo apt install cmake(Linux).
Windows
Run this single command from PowerShell:
iwr https://raw.githubusercontent.com/intuit/infigraph/main/install.ps1 -UseBasicParsing | iex
This downloads and runs the full installer — which fetches the pre-built binary and registers the MCP server.
Update
Re-run the installer to pull latest and rebuild:
|
Or if building manually:
&& &&
infigraph update re-registers MCP server paths and refreshes CLAUDE.md instructions.
Infigraph also checks for updates in the background (once per 24h) and prints a hint when a newer version is available.
Uninstall
Removes:
- MCP server config from all 11 AI agents
- Primary search instructions from
~/.claude/CLAUDE.md
Does NOT delete the binary — remove ~/.local/bin/infigraph and ~/.local/bin/infigraph-mcp manually if desired.
How to Use
Infigraph is designed to be used through AI coding agents (Claude Code, Cursor, Copilot, etc.) rather than directly from the CLI. After install, the MCP server provides 69 tools that any AI agent can call.
With Claude Code (recommended)
# Just start working — Infigraph indexes on first query
> Ask Claude: "search for authentication logic in this project"
> Ask Claude: "who calls the validate_user function?"
> Ask Claude: "show me the architecture of this codebase"
> Ask Claude: "find dead code"
> Ask Claude: "what's the blast radius if I change this function?"
Claude Code auto-indexes the project on first use. No manual infigraph index needed. A file watcher starts automatically after indexing to keep the graph in sync with code changes.
With other AI agents
Any agent with MCP support (Cursor, VS Code + Copilot, Windsurf, etc.) can use Infigraph tools after infigraph install. The agent calls index_project automatically when needed.
Manual CLI (optional)
Grammar Plugins (ANTLR)
Infigraph supports runtime-loaded ANTLR grammar plugins. Drop .g4 grammar files + a plugin.toml config into a directory — infigraph parses the language automatically via a JVM subprocess. No Rust compilation needed.
Quick start: adding a new language
-
Create a grammar plugin directory:
~/.infigraph/grammars/my-lang/ ├── MyLang_Lexer.g4 # ANTLR lexer grammar ├── MyLang_Parser.g4 # ANTLR parser grammar └── plugin.toml # Extension mapping + extraction rules -
Write
plugin.toml:[] = "my-lang" = [".ml", ".myl"] = "program" = "MyLang_Lexer.g4" = "MyLang_Parser.g4" = false # true if files have #include/#ifdef lines [[]] = "functionDecl" # ANTLR parser rule name = "Function" # Symbol kind (Function, Method, Class, Variable, etc.) = "identifier" # Child rule that holds the name = true # Creates a scope (section/function boundary) [[]] = "classDecl" = "Class" = "identifier" = true [[]] = "functionCall" = "Calls" = "identifier" [[]] = "fieldAccess" = "Reads" = "fieldName" = "has_token:." # Only match when DOT token is present -
Index your project — infigraph discovers the plugin automatically:
Plugin discovery
Plugins are loaded from two locations:
~/.infigraph/grammars/*/plugin.toml— user-level (all projects)<project>/grammars/*/plugin.toml— project-level (per repo)
Project-level plugins take precedence.
Requirements
- Java 11+ — the ANTLR interpreter runs in a JVM subprocess
- No Rust toolchain needed — grammar plugins are pure config +
.g4files
How it works
plugin.toml + .g4 files
│
▼
┌─────────────────┐ stdin/stdout JSON ┌──────────────────┐
│ Rust host │ ◄──────────────────────► │ JVM subprocess │
│ (infigraph) │ │ (ANTLR interp.) │
│ │ 1. Load grammar │ │
│ Discovers │ 2. Parse file │ Grammar.load() │
│ plugin.toml │ 3. Get parse tree JSON │ ParserInterpreter│
│ Walks tree │ │ │
│ → Symbol/Rel │ │ │
└─────────────────┘ └──────────────────┘
- Startup: infigraph scans plugin directories, spawns a single persistent JVM process
- Load: sends
.g4grammar paths to the JVM driver, which loads them in ANTLR interpreter mode - Parse: for each source file, sends content to JVM, receives JSON parse tree
- Extract: Rust walks the JSON parse tree using
plugin.tomlentity/relation rules, producesSymbol+Relationobjects - Graph: extracted data flows into the same graph/search/analysis pipeline as all other languages
Grammar imports
If your grammar uses import (e.g., import Base_Lexer;), place the imported .g4 file in the same plugin directory. ANTLR resolves imports from the grammar file's directory.
Extraction rule reference
Entity mappings ([[entities]])
| Field | Required | Description |
|---|---|---|
rule |
yes | ANTLR parser rule name to match |
kind |
yes | Function, Method, Class, Struct, Variable, Constant, Section, Module, Field, Test, Route |
name_child |
yes | Child rule that holds the entity name |
scope |
no | If true, pushes a scope (nested symbols get parent::name IDs) |
Relation mappings ([[relations]])
| Field | Required | Description |
|---|---|---|
rule |
yes | ANTLR parser rule name to match |
kind |
yes | Calls, Imports, Reads, Writes, Inherits, Implements, Contains |
target_child |
yes | Child rule that holds the target name |
condition |
no | has_child:RULE, has_token:TEXT — only match when condition is true |
Performance
Grammar plugins use the ANTLR interpreter (no code generation). Slower than native tree-sitter but requires zero compilation:
| Metric | Value |
|---|---|
| JVM cold start + grammar load | ~450ms (once) |
| Per-file parse (100 lines) | ~90ms |
| Per-file parse (500 lines) | ~770ms |
| 55-file batch | ~18s (324ms/file avg) |
The JVM stays alive for the duration of the infigraph session — subsequent parses only pay the per-file cost.
Architecture: tree-sitter vs grammar plugins
| Tree-sitter | Grammar Plugin | |
|---|---|---|
| Grammar format | .scm queries |
.g4 grammars |
| Runtime | Native (compiled C) | JVM subprocess (ANTLR interpreter) |
| Adding a language | Write .scm query files |
Drop .g4 + plugin.toml |
| Compilation needed | No (queries are text) | No (interpreter mode) |
| Performance | ~1ms/file | ~100-800ms/file |
| Best for | Mainstream languages | Custom/internal DSLs |
Both backends produce the same Symbol + Relation output. Everything downstream (graph, search, analysis, MCP tools) is backend-agnostic.
Pipeline Plugins
Infigraph supports runtime-loaded pipeline plugins for extracting data pipeline metadata from documents (e.g. Confluence design docs). Each plugin is a subprocess that communicates via JSON over stdin/stdout — no recompilation needed to add new pipeline formats.
How it works
- Plugin is a directory with
plugin.toml+ an extractor binary/script - Infigraph discovers plugins at startup from two locations:
~/.infigraph/pipelines/*/plugin.toml— user-level (all projects)<project>/pipelines/*/plugin.toml— project-level (per repo)
- When a document is indexed, infigraph tries each plugin's
detect_patternsagainst the content - Matching plugin's extractor subprocess receives the document, returns structured pipeline metadata
- Metadata is stored in the graph DB:
PipelineCoreshared table + plugin-specific detail table
Directory structure
pipelines/
my-plugin/
plugin.toml # Plugin manifest (schema, command, detection patterns)
plugin.toml format
[]
= "My Pipeline Format"
= "myformat" # lowercase, used as table suffix
= ["infigraph-pipeline-extractor"] # any executable that speaks the JSON protocol
= ["## Source Systems", "## Scheduler"] # regex patterns for auto-detection
# Per-plugin table columns (creates Pipeline_myformat node table)
[[]]
= "scheduler_type"
= "STRING" # STRING | INT64 | BOOL | DOUBLE | STRING[]
[[]]
= "compliance"
= "STRING"
[]
= "core.inputs"
= "core.outputs"
JSON IPC protocol
Startup: Plugin writes {"ready": true, "plugin_id": "myformat", "version": "1.0"}
Extract command (infigraph → plugin stdin):
Response (plugin stdout):
Or {"status": "skip"} if the document doesn't match this plugin's format.
Schema: shared core + per-plugin tables
All plugins share a PipelineCore table for cross-plugin dependency linking:
PipelineCore: id, name, doc_id, plugin_id, inputs[], outputs[]
Each plugin gets its own detail table (e.g. Pipeline_myformat) for format-specific fields. Cross-plugin queries (impact analysis, dependency graphs) use PipelineCore.inputs/outputs.
Built-in extractor
Infigraph ships infigraph-pipeline-extractor — a reference implementation that extracts pipeline metadata from Confluence-style design documents with sections like Source Systems, Destination Tables, Scheduler, Compliance, DACI, etc. It ships as a compiled Rust binary with zero runtime dependencies.
MCP tools
| Tool | Description |
|---|---|
pipeline_plugins |
List loaded pipeline plugins |
pipeline_deps |
Show pipeline dependency graph |
pipeline_impact |
Transitive impact analysis for a table/dataset |
pipeline_compliance |
Query pipelines by compliance scope |
pipeline_query |
Generic query against plugin-specific fields |
Writing a custom plugin
- Create
~/.infigraph/pipelines/my-plugin/plugin.toml - Define your schema columns and detection patterns
- Implement an extractor (any language) that reads JSON from stdin, writes JSON to stdout
- Test:
echo '{"command":"extract","content":"...","title":"Test","doc_id":"test::1"}' | ./my-extractor
Building from Source
Prerequisites
| Platform | Required |
|---|---|
| macOS | brew install cmake, Rust (rustup) |
| Linux | sudo apt install cmake, Rust (rustup) |
| Windows | Rust (rustup), Docker (for cross-compilation) |
macOS (native — ARM64 or x86_64)
Linux (x86_64 or ARM64)
&&
Windows (native build)
Build natively on a Windows machine. Cross-compiling from macOS is not currently supported — LadybugDB (lbug) requires C++20 <format> (GCC 13+), but available cross-compilation Docker images ship GCC 9.
# Install Rust
winget install Rustlang.Rustup
# Install CMake (required by lbug graph DB)
winget install Kitware.CMake
# Install Visual Studio Build Tools with C++ workload
winget install Microsoft.VisualStudio.2022.BuildTools
# Clone and build
git clone https://github.com/intuit/infigraph.git
cd infigraph
cargo build --release -p infigraph-cli -p infigraph-mcp
# Binaries at:
# target\release\infigraph.exe
# target\release\infigraph-mcp.exe
Cross-compiling macOS targets on ARM64 machine
# Add Intel target
# Build for Intel Mac (from ARM64 machine)
Releasing a new version (maintainers)
The release.sh script builds, signs, packages with the bundled model, and uploads to GHE releases:
What it does:
- Builds
aarch64-apple-darwintargets (Intel commented out — add when needed) - Ad-hoc signs both binaries with
codesign --sign -(no Apple Developer cert required) - Packages
infigraph,infigraph-mcp, andmodels/intoinfigraph-<target>.tar.gz - Creates a GitHub release at
github.com/intuit/infigraphand uploads the archive
Requirements: gh CLI authenticated with github.com, cmake, Rust toolchain
Setup as Primary Search
After install, register Infigraph as the primary search engine for all AI coding agents:
This does four things:
- Registers
infigraph-mcpas an MCP server for 11 agents: Claude Code, Cursor, VS Code, Codex, Gemini CLI, Zed, OpenCode, Aider, Windsurf, Kiro, GitHub Copilot - Writes primary search instructions to
~/.claude/CLAUDE.mdso AI agents prefer Infigraph over raw grep/glob - Installs Claude Code hooks — enforcement hook (warns on raw search) + session save hooks (auto-save context on compaction)
- Configures Claude Code allowlist — adds all Infigraph MCP tools to
~/.claude/settings.local.jsonpermissions
Then index your projects:
# Full reindex (clean rebuild from scratch):
Every search, symbol lookup, and code navigation now goes through Infigraph's graph — saving 60-80% of tokens versus raw file reads.
Web UI
Infigraph includes a built-in web UI for visual code exploration.
It starts automatically when the MCP server launches — open it at:
http://localhost:9749/?path=/your/project
The UI is served by the same infigraph-mcp process Claude Code spawns. No separate process needed.
Multiple Claude sessions: the first session to start binds port 9749 and serves the UI. All subsequent sessions skip the port bind silently and still get full MCP tool access. The UI stays up as long as at least one session is open.
From Claude: ask Claude to open the UI — it can launch a browser or give you the URL for your indexed project.
Troubleshooting
MCP tools not available in Claude Code
Symptom: mcp__infigraph__* tools appear as "deferred" in ToolSearch but aren't active, or Claude says Infigraph isn't loaded.
Most common cause: A project-level .claude/settings.json with an mcpServers block overrides the global ~/.claude/settings.json where infigraph install wrote its config. Claude Code merges settings but project-level mcpServers takes precedence.
Fix: Run infigraph install from inside the project directory — or manually add the infigraph entry to the project's .claude/settings.json:
Replace /path/to/infigraph-mcp with the output of which infigraph-mcp.
Other causes:
- Binary not found: verify
which infigraph-mcpreturns a path infigraph installfailed silently during setup: re-run it manually and check for errors- Invalid JSON in existing
settings.json: fix the JSON, then re-runinfigraph install
Features
Core
- 62 languages — see full list below
- LadybugDB graph database — columnar embedded graph DB (Kuzu successor), full Cypher including WITH, OPTIONAL MATCH, variable-length paths, mutations
- Hybrid search — BM25 text ranking + Model2Vec neural embeddings (bundled, no network) with tunable alpha
- HNSW vector index — approximate nearest neighbor search for fast similarity queries at scale (~2ms for 500K symbols)
- Embedding cache — vectors saved to
.infigraph/embeddings.bin, loaded on next search (first index = cache, subsequent = instant) - Cross-file call resolution — import-aware resolution links function calls to actual definitions across files
- Auto-watch — file watcher auto-starts after indexing, keeps graph in sync via OS filesystem events with 500ms debounce
- Session continuity — persists session context (summary, pending tasks, decisions, touched files) across AI agent sessions
- Docstring extraction — captures docstrings/comments from AST, indexed for richer search
- Function signatures — extracts parameter lists and return types from AST for richer embeddings and search
- Louvain community detection — discovers functional modules/clusters in the call graph
- Multi-repo groups — group microservice repos, cross-repo Cypher queries, HTTP contracts, cross-service dependency detection
- Custom edge types — extensible relation system: language plugins can define custom edges (DECORATED_BY, SPAWNS, etc.) that persist in the graph
- Gitignore-aware — respects
.gitignoreand.infigraphignorepatterns during indexing via theignorecrate - Learned resolution — records successful cross-file call resolutions to improve accuracy on subsequent indexes
Analysis
- Refactor analysis — complexity hotspots, coupling (fan-in/fan-out), near-duplicate detection, dead code, file size — ranked by impact/effort
- PR review — symbol-level diff review with optional LLM enrichment (Anthropic API), cross-repo blast radius
- CI check runner — configurable checks (security, complexity, dead code, vuln scan) with pass/fail gates
- OSV vulnerability scanning — scans dependencies against the OSV database for known vulnerabilities
- Design pattern detection — identifies Singleton, Factory, Observer, Strategy, Builder, and other patterns
- Dead code detection (uncalled functions/methods)
- Transitive impact / blast radius analysis
- Git diff → affected symbols mapping
- Architecture overview (language breakdown, hotspots, hub functions, entry points)
- HTTP route/endpoint detection across 22 languages (Flask, Express, Spring, Django, Gin, Actix, Phoenix, Rails, NestJS, and more)
- Cross-service HTTP dependency detection (
group deps) — scans URL strings, matches to contracts across repos - Bridge-to-call promotion — promotes detected cross-language bridges to CALLS edges for unified call graph analysis
SCIP Integration (Compiler-grade Enrichment)
Infigraph natively imports SCIP indexes to enrich the graph with precise compiler-grade symbols, types, and cross-file relationships. SCIP indexers are auto-downloaded — infigraph index detects project languages and fetches the right indexer binaries (with portable runtimes for Node.js, JRE, .NET, Dart, PHP) on first use:
# Generate SCIP index with an existing indexer
# Then import into Infigraph
Languages with dedicated SCIP indexers: TypeScript, JavaScript, Python, Java, Kotlin, Go, Rust (rust-analyzer), C# (scip-dotnet), Ruby (scip-ruby), Scala
Languages via lsp-to-scip bridge: C/C++, Zig, Swift, Dart, Elixir, PHP, Lua, Haskell, F#, Clojure, Erlang, Perl, OCaml, and any language with an LSP server
lsp-to-scip Bridge
Generic tool that spawns any LSP server and generates index.scip:
# C/C++ via clangd
# Zig via zls
# Swift via sourcekit-lsp
# Elixir via elixir-ls
# Dart
# Haskell
# F#
# Clojure
# Erlang
# Then import
Integration
- 74 MCP tools for AI coding agents
- 11 agent auto-configs — Claude Code, Cursor, VS Code, Codex, Gemini CLI, Zed, OpenCode, Aider, Windsurf, Kiro, GitHub Copilot
- Web UI at localhost:9749 with graph explorer, search, route map, multi-repo groups, contracts
- Export — Neo4j Cypher, GraphML, JSON
Supported Languages (62)
| Category | Languages |
|---|---|
| Systems | Rust, C, C++, Zig, CUDA, Verilog, Assembly |
| JVM | Java, Kotlin, Scala, Groovy, Clojure |
| Web | JavaScript, TypeScript, TSX, PHP, HTML, CSS, GraphQL |
| Python | Python (+ Django, Flask, FastAPI route detection) |
| Mobile | Swift, Kotlin, Dart, Objective-C |
| Functional | Haskell, OCaml, F#, Elm, Elixir, Erlang, Common Lisp, Emacs Lisp, Clojure |
| Scripting | Ruby, Perl, Lua, Bash, PowerShell, R, Julia, MATLAB |
| Go ecosystem | Go |
| Config/Data | TOML, YAML, JSON, XML, HCL, Makefile, CMake, Dockerfile, Starlark, INI, SQL, Protobuf |
| Other | Fortran, GLSL, Nix, Svelte, Markdown |
| NEW | Pascal/Delphi (.pas, .pp, .dpr, .dpk, .lpr) |
| Grammar Plugins | Any ANTLR4-compatible language via grammar plugins |
Every language includes:
entities.scm— symbols (functions, classes, methods, types, variables, constants, routes)relations.scm— call edges, imports, inheritance
Quick Start
# Index
# Search (BM25 + Model2Vec hybrid)
# Query with Cypher
# Architecture overview
# Dead code
# Refactoring recommendations
# Impact analysis
# Git diff impact
# HTTP routes
# Cluster detection
# Code snippet
# Grep search
# Export
# Visualization
# Import SCIP index (enriches graph with compiler-grade data)
# PR review (symbol-level diff analysis)
# CI checks (security, complexity, dead code gates)
# Vulnerability scanning
# Design pattern detection
# Document indexing (PDF, DOCX, Markdown, HTML)
# Confluence wiki indexing
# Multi-repo
MCP Server
# Start MCP server (stdio)
# Start with web UI
# Open http://localhost:9749/?path=/your/project
74 MCP Tools
| Tool | Description |
|---|---|
| Search & Navigation | |
index_project |
Parse all source files and build code knowledge graph (60+ languages) |
search |
Unified code search — keyword-hybrid + semantic-hybrid + regex grep in one call, auto-escalates |
search_symbols |
Find symbols by name (keyword-weighted hybrid, alpha=0.3) |
semantic_search |
Find code by meaning (semantic-weighted hybrid, alpha=0.85) |
search_code |
Regex text search across all project files |
get_symbols_in_file |
List all symbols in a file with line numbers |
get_code_snippet |
Source code for a symbol by ID |
get_doc_context |
Full context: signature + docstring + source + callers + callees in one call |
symbol_context |
360° view: callers, callees, parent scope, file, kind, docstring |
list_files |
List source files with optional glob pattern filter |
| Analysis | |
trace_callers |
Direct callers of a symbol |
trace_callees |
What a symbol calls |
transitive_impact |
Blast radius — all symbols transitively affected by changes |
find_all_references |
Every location where a symbol is referenced |
detect_dead_code |
Unreachable functions/methods with zero callers |
detect_changes |
Git diff → affected symbols and blast radius |
semantic_diff |
Symbol-level diff between git refs (added/removed/moved/changed) |
git_summary |
Symbol-level commit history (which functions changed per commit) |
get_complexity |
Cyclomatic complexity metrics per symbol |
detect_clones |
Near-duplicate functions via vector similarity |
detect_clusters |
Louvain community detection on call graph |
detect_security_issues |
Security scan: SQL injection, secrets, eval, path traversal, XSS, etc. |
detect_bridges |
Cross-language boundaries: FFI, JNI, cgo, gRPC, WASM, COM |
detect_routes |
HTTP route/endpoint detection (22 frameworks) |
get_test_coverage |
Test coverage analysis — covered %, uncovered symbols |
refactor |
Refactoring analysis — complexity, coupling, duplication, size, dead code. Ranked recommendations with impact/effort scores |
| Architecture | |
get_architecture |
Codebase overview: language breakdown, hotspots, hub functions, entry points |
get_api_surface |
Public API surface — all public symbols and HTTP routes |
get_file_deps |
File-level import graph (what imports what) |
get_type_hierarchy |
Full inheritance tree (ancestors + descendants) |
get_graph_schema |
Node/edge types, counts, property names |
get_stats |
Graph statistics |
generate_sequence_diagram |
Mermaid sequence diagram from call graph |
| Dependencies | |
index_manifests |
Parse package manifests (package.json, Cargo.toml, go.mod, etc.) |
get_dependencies |
List external dependencies by ecosystem |
scip_import |
Import SCIP index for compiler-grade enrichment |
| Review & CI | |
review |
PR review — symbol-level diff analysis with optional LLM enrichment |
| Document Search | |
index_docs |
Index documents (PDF, DOCX, PPTX, Markdown, HTML) |
reindex_docs |
Reindex all documents from scratch |
clean_docs |
Remove document index |
search_docs |
Search indexed documents with hybrid BM25+semantic |
watch_docs |
Watch document directory for changes |
stop_watch_docs |
Stop document watcher |
| Confluence | |
index_confluence |
Crawl and index Confluence wiki space |
index_confluence_pages |
Index specific Confluence pages by ID |
| Multi-repo Groups | |
group_create |
Create a repo group |
group_add |
Add repo to group |
group_list |
List groups and members |
group_index |
Index all repos in a group |
group_query |
Cross-repo Cypher query |
group_sync |
Extract HTTP contracts across repos |
group_contracts |
List discovered contracts |
group_deps |
Cross-service HTTP dependency detection |
group_link |
Link cross-service deps as CALLS_SERVICE edges |
| Export & Visualization | |
export_graph |
Export as Cypher/GraphML/JSON |
visualize |
Interactive HTML graph visualization |
visualize_symbol |
Focused subgraph centered on one symbol |
| Project Management | |
list_projects |
All indexed repos |
delete_project |
Remove project data |
list_languages |
Supported languages and extensions |
| File Watching | |
watch_project |
Background file watcher with auto-reindex |
stop_watch |
Stop a running watcher |
get_watch_status |
Check watcher status and pending reindexes |
| Session Context | |
save_session |
Save session context to graph DB with TOUCHED edges + semantic embedding. Auto-purges after configurable days (default: 30) |
get_latest_session |
Retrieve most recent session — summary, pending tasks, decisions, linked files. Suggests purge if old sessions exist |
purge_sessions |
Delete sessions older than N days (default: 30). User-initiated cleanup |
Architecture
For a detailed technical design — including graph schema, hybrid search internals, incremental indexing, cross-file call resolution, and design rationale — see ARCHITECTURE.md.
infigraph/
├── crates/
│ ├── infigraph-core/ # Graph DB, parsing, search, analysis
│ │ └── src/
│ │ ├── model/ # Symbol, Relation, FileExtraction types
│ │ ├── lang/ # LanguagePack, LanguageRegistry
│ │ ├── extract/ # AST entity + relation extraction
│ │ ├── graph/ # LadybugDB store, schema, queries
│ │ ├── search/ # BM25, hybrid search, grep
│ │ ├── embed/ # Model2Vec (bundled potion-base-8M, 256-dim)
│ │ ├── resolve/ # Cross-file call resolution
│ │ ├── cluster/ # Louvain community detection
│ │ ├── multi/ # Multi-repo registry, groups, contracts, cross-service deps
│ │ ├── routes/ # HTTP route detection (22 frameworks)
│ │ ├── scip/ # SCIP index import (compiler-grade enrichment)
│ │ ├── refactor/ # Refactoring analysis (complexity, coupling, clones, dead code)
│ │ ├── watch/ # File watcher with auto-start after indexing + change batching
│ │ ├── session/ # Session context persistence across AI sessions
│ │ ├── review/ # PR review engine with optional LLM enrichment
│ │ ├── check/ # CI check runner (security, complexity, dead code gates)
│ │ ├── vuln/ # OSV vulnerability scanning
│ │ ├── patterns/ # Design pattern detection
│ │ ├── learned/ # Learned resolution patterns for cross-file calls
│ │ ├── viz/ # HTML graph visualization
│ │ └── export/ # Cypher, GraphML, JSON export
│ ├── infigraph-docs/ # Document indexing (PDF, DOCX, PPTX, HTML, Markdown)
│ ├── infigraph-confluence/ # Confluence wiki crawler with incremental sync
│ ├── infigraph-languages/ # 59 tree-sitter language packs
│ │ └── languages/ # entities.scm + relations.scm per language
│ ├── infigraph-grammar-plugin/ # Runtime ANTLR grammar plugin system (JVM subprocess)
│ │ └── src/ # Driver, config-driven extractor, plugin discovery
│ ├── infigraph-cli/ # 50+ CLI commands
│ ├── infigraph-mcp/ # 69-tool MCP server + web UI
│ └── lsp-to-scip/ # Generic LSP → SCIP bridge binary
├── driver/ # Java ANTLR grammar driver (JVM subprocess)
│ ├── infigraph-driver.jar # Fat jar (ANTLR4 runtime bundled)
│ └── src/ # GrammarDriver.java
├── grammars/ # Grammar plugin definitions (user-provided)
├── models/
│ └── potion-base-8M/ # Bundled Model2Vec embeddings (256-dim, ~30MB)
├── release.sh # Local release builder (macOS ARM64 → GHE)
├── install.sh # One-line installer (pre-built binary or source)
└── tests/
└── fixtures/microservices/ # Test fixtures: Python/TS/Rust microservices
Graph Schema
Nodes
- Symbol — functions, methods, classes, structs, enums, variables, constants, tests, sections, routes (with parameters, return_type, docstring, complexity)
- Module — file-level grouping
- Cluster — Louvain-detected community
- File — source file
- Folder — directory
- Dependency — external package dependency (name, version, ecosystem, is_dev)
Edges
- CALLS — function/method call (cross-file resolved + SCIP-enriched)
- INHERITS — class/interface inheritance
- IMPLEMENTS — interface implementation (from SCIP)
- CONTAINS — module contains symbol
- TESTED_BY — test function tests symbol
- IMPORTS — module imports module
- READS / WRITES — variable access
- MEMBER_OF — symbol belongs to cluster
- SIMILAR_TO — semantic similarity (embedding-based)
- BRIDGE_TO — cross-language bridge (FFI, JNI, gRPC, COM, WASM)
- CALLS_SERVICE — cross-service HTTP call (with method, path, target_service)
- DEPENDS_ON — module depends on external package
- DEFINES — file defines symbol
- CONTAINS_FILE — folder contains file
- CONTAINS_FOLDER — folder contains subfolder
- Custom edges — extensible via language plugins (DECORATED_BY, SPAWNS, etc.)
Tech Stack
- Rust — core engine
- LadybugDB (
lbug) — embedded columnar graph database (Kuzu successor) - tree-sitter 0.26 — AST parsing for 59 languages
- Model2Vec — neural embeddings (potion-base-8M, 256-dim, bundled — no proxy/network needed)
- SCIP — Sourcegraph Code Intelligence Protocol for compiler-grade enrichment
- vis.js — graph visualization
- tiny_http — embedded web server
Contributing: Route & Decorator Extraction
Infigraph captures HTTP route decorators/attributes and stores them in symbol docstrings for semantic search. When a user searches "GET /api/users", the route-decorated function scores highest.
How it works
Two mechanisms capture decorators:
- Tree-sitter query capture (
entities.scm) — for languages where decorators are syntactic wrappers (Pythondecorated_definition, Java annotation modifiers) - AST sibling scan (
extract/entities.rs) — for languages where attributes are preceding sibling nodes (Rustattribute_item, C#attribute_list, Kotlinannotation, PHPattribute_list)
HTTP Route Coverage
| Language | Framework examples | Status |
|---|---|---|
| Python | Flask @app.route, FastAPI @get, Django @api_view |
Working |
| Java | Spring @GetMapping, @RequestMapping, @RestController |
Working |
| Rust | Actix #[get], Axum, Rocket #[get] |
Working |
| C# | ASP.NET [HttpGet], [Route], [ApiController] |
Working |
| Kotlin | Spring @GetMapping, Ktor |
Working |
| PHP | Laravel #[Route] (PHP 8+) |
Working |
| TypeScript | NestJS @Get(), @Controller() |
Working |
| JavaScript | Express router.get("/path", ...) |
Working |
| Go | r.GET("/path", handler) (Gin, Chi, gorilla) |
Working |
| Ruby | Rails get "/path" do...end |
Working |
| Elixir | Phoenix get "/path" do...end |
Working |
| Swift | Vapor router.get("/path") |
Working |
| Dart | shelf get("/path", handler) |
Working |
| Haskell | Servant type API = "path" :> Get |
Working |
| Lua | Lapis app:get("/path", ...) |
Working |
| Perl | Mojolicious get "/path" => sub {...} |
Working |
| Clojure | Compojure GET "/path" |
Working |
| Erlang | Cowboy dispatch_rules / handle |
Working |
| GraphQL | Schema definitions | Working |
| Scala | Play GET("path") |
Working |
| Django | path("/url", view) |
Working |
| F# | Giraffe/Saturn (AST scan) | Deferred |
Adding route support for a new language
Option A: Query-based (decorator-wrapper syntax)
Edit crates/infigraph-languages/languages/<lang>/entities.scm:
; Capture route method, path, handler
(call_expression
function: (identifier) @route.method
arguments: (arguments
(string_literal) @route.path)
(#match? @route.method "^(get|post|put|delete|patch)$")) @route.def
Option B: AST sibling (attribute-preceded syntax)
Add the tree-sitter node kind to ATTR_KINDS in crates/infigraph-core/src/extract/entities.rs:
const ATTR_KINDS: & = &;
Test fixtures
tests/fixtures/microservices/ contains realistic microservice repos for testing:
user-service/— Python Flask (3 files, 6 routes)order-service/— TypeScript Express (4 files, 5 routes)payment-service/— Rust Actix-web (5 files, 4 routes)
Contributing
See CONTRIBUTING.md for build instructions, code style, and how to add a language or submit a PR.
License
Apache-2.0