- Complete Quickstart to understand basic operations
- Ensure you have LLM Providers configured
- Have a local repository path (absolute or relative)
What Code Graph Does
- Scans a repo for supported languages and builds code nodes/edges (files, symbols, imports, call/dependency links)
- Optional: includes non-code files (markdown, docs) as a standard knowledge graph
- Enables
SearchType.CODE
for code-aware queries
Full Working Example
This simple example uses a basic repository for demonstration. In practice, you can process large codebases with multiple languages and complex dependency structures.
What Just Happened
Step 1: Build the Code Graph
Step 2: Search Your Code
SearchType.CODE
to ask code-aware questions about your repository. This searches through the extracted code structure, not just text content.
Include Documentation (Optional)
Also process non-code files from the repo (slower, uses LLM for text):Advanced Options
excluded_paths
: List of paths (globs) to skip, e.g., tests, build folderssupported_languages
: Narrow to certain languages to speed up processing
Visualize Your Graph (Optional)
What Happens Under the Hood
run_code_graph_pipeline(...)
automatically handles:
- Repository scanning and file parsing
- Code entity extraction (functions, classes, imports, calls)
- Dependency analysis and relationship mapping
- Database initialization and setup
- Optional documentation processing with LLM