How the graph is built
BugViper builds the graph in three steps at ingestion time:- Clone — BugViper downloads your repository from GitHub.
- Parse — Tree-sitter AST parsers run over every supported file, extracting symbols and their relationships without executing any code.
- Write — Nodes and relationships are written to Neo4j. Cyclomatic complexity is calculated and stored on every
Functionnode. Optionally, all nodes are batch-embedded and their vectors stored in Neo4j vector indexes for semantic search.
Node types
Every code element is stored as a typed node in the graph:| Node type | What it represents |
|---|---|
Repository | The top-level repository (owner/name) |
File | A source file in the repository |
Function | A function or method definition |
Class | A class definition |
Variable | A module-level or class-level variable |
Module | An external or internal package referenced by an import statement |
name, source_code, docstring, line_number, path, and (for functions) cyclomatic_complexity.
Graph schema
The relationships between nodes follow a consistent schema:DataLoader with a method load_batch that calls embed_texts, the graph contains:
- A
Filenode connected viaCONTAINSto aClassnode (DataLoader) - That
Classnode connected viaCONTAINSto aFunctionnode (load_batch) - That
Functionnode connected viaCALLSto anotherFunctionnode (embed_texts)
Vector embeddings
Vector embeddings are optional but unlock semantic search. When enabled, BugViper embeds every node usingtext-embedding-3-small (via OpenRouter) and stores the resulting 1536-dimensional vectors in Neo4j vector indexes using cosine similarity.
Supported languages
BugViper uses Tree-sitter parsers to support 17 programming languages:- Systems
- JVM & .NET
- Scripting
- Web & TypeScript
- Other
- C
- C++
- Rust
- Go
Why the graph matters
Traditional static analysis and code review tools only see the diff — the lines that changed in a pull request. BugViper’s AI agent has access to the full graph of your codebase: every caller of a function, the full inheritance chain of a class, all files that import a given module. This means the reviewer can identify issues that are invisible from the diff alone, such as a change that breaks a caller in a completely different file, or a pattern that conflicts with how the same logic is implemented elsewhere.A repository must be fully indexed before code search, PR review, and the Ask Agent feature are available. See Index a repository to get started.