Introduction to Arbor
Relevant source files
The following files were used as context for generating this wiki page:
Arbor is a local-first impact analysis engine and "Logic Forest" designed for large-scale codebases. Unlike traditional search tools or vector-based RAG systems that treat code as text, Arbor parses source code into a semantic dependency graph—specifically a Code Property Graph (CPG). This allows developers and AI agents to trace execution paths, including callers, callees, imports, and inheritance, providing structural certainty for refactoring and impact analysis.
Sources: README.md:14-25, PR_DESCRIPTION.md:3-6
Core Architecture and Components
Arbor is built as a modular ecosystem of Rust crates that handle the lifecycle of code analysis from initial parsing to AI integration and visualization. The system transitions code from raw text to a persisted, searchable graph exposed via multiple protocols.
The diagram above illustrates the data flow from source files through the parsing and graph engines to the consumption layers.
Key Modules
| Module | Purpose | Key Responsibilities |
|---|---|---|
arbor-core | Parsing Engine | Uses Tree-sitter to extract nodes (functions, classes) and edges (calls, imports). |
arbor-graph | Graph Engine | Manages the petgraph core, Global Symbol Table, and A* pathfinding. |
arbor-watcher | File Watcher | Monitors the filesystem for incremental indexing and debounced updates. |
arbor-server | WebSocket Server | Exposes the graph for real-time visualization and IDE highlighting. |
arbor-mcp | AI Bridge | Implements Model Context Protocol for LLM interaction. |
Sources: crates/arbor-core/README.md:14-19, crates/arbor-graph/README.md:11-16, crates/arbor-server/README.md:11-18, crates/arbor-mcp/README.md:14-18, crates/arbor-watcher/README.md:11-17
The Code Property Graph (CPG)
The heart of Arbor is the ArborGraph, which represents the codebase as a series of Nodes and Edges. This structure enables "execution-aware analysis" where relationships are explicitly defined rather than inferred via keyword similarity.
Node and Edge Schema
- Nodes: Represent code entities such as Functions, Structs, Traits, Classes, Interfaces, and Variables.
- Edges: Represent relationships including Calls, Imports, Inheritance,
FlowsTo(Control Flow), andDataDependency(Data Flow). - Global Symbol Table: Maps Fully Qualified Names (FQNs) to Node IDs to resolve symbols across file boundaries.
Sources: crates/arbor-graph/README.md:27-31, README.md:88-100, PR_DESCRIPTION.md:23-26, PR_DESCRIPTION.md:43-45
Persistence Layer
Arbor utilizes a sled-backed incremental storage system. It only writes "dirty" nodes to disk using atomic batches and a specialized index (f:{file} -> [n:{id}]). Data is serialized using bincode for high-performance state saving.
Sources: PR_DESCRIPTION.md:17-21, crates/arbor-graph/README.md:20
Impact Analysis and Intelligence
Arbor provides deterministic answers to complex structural questions, primarily through its impact analysis engine.
Sequence of a blast radius detection request via the CLI.
Confidence Scoring and Classification
Each analysis provides an explainable confidence level based on resolution certainty:
- High: Fully resolved, statically verifiable paths.
- Medium: Partial uncertainty (e.g., polymorphism or complex callbacks).
- Low: Heuristic or dynamic resolution (e.g.,
evalor runtime reflection).
The engine also automatically classifies nodes into architectural roles such as Entry Point, Core Logic, Utility, or Adapter.
Sources: README.md:104-120, crates/arbor-cli/src/commands.rs:567-578
Interfaces and Integration
CLI and GUI
The arbor-graph-cli is the primary interface for indexing and querying. Developers can use commands like arbor refactor <symbol> to preview a blast radius. The native GUI provides an interactive version of the logic forest, allowing for visual exploration of dependencies.
Sources: crates/arbor-cli/README.md:29-37, README.md:46-55
Model Context Protocol (MCP)
The arbor-mcp crate allows AI agents (like Claude or Cursor) to "walk" the graph. It provides specific tools for AI interaction:
find_path(start, end): Traces the logic flow between two points using the A* algorithm.analyze_impact(node): Computes the blast radius for the agent.get_context(node): Retrieves the semantic neighborhood and related code.
Sources: crates/arbor-mcp/README.md:20-25, PR_DESCRIPTION.md:11-15, README.md:122-130
Summary
Arbor transforms a codebase from unstructured text into a high-performance, persisted Code Property Graph. By combining Tree-sitter parsing, incremental Sled-backed storage, and standardized protocols like MCP and WebSocket, it provides a foundation for both human developers and AI agents to understand the structural consequences of code changes with mathematical certainty.
Sources: README.md:78-86, PR_DESCRIPTION.md:3-8