Which Programming Languages Does Code-Graph-RAG Support? (14 Languages Covered)
Code-Graph-RAG supports 14 programming languages—including Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Dart, Lua, and Scala (in development)—using Tree-sitter to build a unified, language-agnostic knowledge graph.
Code-Graph-RAG is a language-agnostic code analysis tool that parses source files using Tree-sitter to construct a unified knowledge graph. Whether you're analyzing a Python monolith or a polyglot repository mixing Rust and TypeScript, the engine extracts functions, classes, and modules into a single queryable schema. The definitive list of supported languages is maintained in docs/architecture/language-support.md and enforced programmatically via codebase_rag/constants/languages.py.
Complete Language Support Matrix
The repository maintains a support matrix that documents parsing status, file extensions, and extracted constructs for each language. As of the latest release, Code-Graph-RAG fully supports 13 languages with Scala currently in development.
| Language | Status | Extensions | Functions | Classes/Structs | Modules | Package Detection |
|---|---|---|---|---|---|---|
| C | Fully Supported | .c |
✓ | ✓ | ✓ | ✓ |
| C# | Fully Supported | .cs |
✓ | ✓ | ✓ | – |
| C++ | Fully Supported | .cpp, .h | ✓ | ✓ | ✓ | ✓ |
| Dart | Fully Supported | .dart | ✓ | ✓ | ✓ | – |
| Go | Fully Supported | .go | ✓ | ✓ | ✓ | – |
| Java | Fully Supported | .java | ✓ | ✓ | ✓ | – |
| JavaScript | Fully Supported | .js, .jsx, .mjs, .cjs | ✓ | ✓ | ✓ | – |
| Lua | Fully Supported | .lua | ✓ | – | ✓ | – |
| PHP | Fully Supported | .php | ✓ | ✓ | ✓ | – |
| Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ |
| Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ |
| TypeScript | Fully Supported | .ts, .mts, .cts | ✓ | ✓ | ✓ | – |
| TypeScript (TSX) | Fully Supported | .tsx | ✓ | ✓ | ✓ | – |
| Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | – |
Each language extraction includes language-specific constructs: C++ captures templates, lambdas, and C++20 modules; Rust handles impl blocks, associated functions, and macro_rules! macros; PHP supports traits, interfaces, and PHP 8 attributes; and Dart includes mixins, extensions, and Flutter widgets.
How Language Support Works
Code-Graph-RAG delegates parsing to Tree-sitter, an incremental parser that provides a uniform AST for any grammar-compliant language. The core integration happens in codebase_rag/language_spec.py, where the LanguageSpec class discovers Tree-sitter grammars, registers file extensions, and maps AST node types to unified graph entities.
When the engine initializes, codebase_rag/constants/languages.py provides the programmatic enumeration of supported languages. This configuration drives the file discovery phase, ensuring that only relevant extensions are passed to the Tree-sitter parser.
Language-Agnostic Graph Schema
Unlike language-specific static analysis tools, Code-Graph-RAG uses a single graph schema across all supported languages. This design enables polyglot analysis: a Cypher query written for Python functions works identically for JavaScript or Rust functions in the same graph.
The unified schema captures:
- Functions: Named blocks with parameters and return types
- Classes/Structs: Object-oriented constructs including inheritance and generics
- Modules: File-level and directory-level organization
- Package Detection: Import/include relationships (available in C, C++, Python, and Rust)
Adding Custom Languages
Extending support to additional languages requires only a Tree-sitter grammar and configuration updates. The LanguageSpec class in codebase_rag/language_spec.py handles grammar registration, allowing you to map new AST node types to the existing graph schema without modifying the core engine.
Querying Code Across Languages
The public API in codebase_rag/main.py exposes the CodeGraphRAG class, which provides build_graph() and query_cypher() methods for language-agnostic analysis.
Load a repository and build its graph:
from codebase_rag import CodeGraphRAG
cgr = CodeGraphRAG(root_path="/path/to/my_repo")
cgr.build_graph() # Parses all supported source files
Run a polyglot query for functions named handle_request regardless of language:
query = """
MATCH (f:Function {name: "handle_request"})
RETURN f.file_path, f.start_line, f.language
"""
results = cgr.query_cypher(query)
for r in results:
print(f"{r['language']} – {r['file_path']}:{r['start_line']}")
Export a project's graph using the CLI implemented in codebase_rag/cli.py:
python -m codebase_rag.cli export-graph --root /path/to/python_proj --output graph.json
Summary
- Code-Graph-RAG supports 14 languages including C, C#, C++, Dart, Go, Java, JavaScript, Lua, PHP, Python, Rust, TypeScript, TSX, and Scala (in development).
- Language parsing relies on Tree-sitter grammars configured in
codebase_rag/language_spec.pyand enumerated incodebase_rag/constants/languages.py. - All languages share a unified graph schema, enabling polyglot queries across mixed-language repositories.
- The
CodeGraphRAGclass incodebase_rag/main.pyprovides the primary API for building graphs and executing Cypher queries.
Frequently Asked Questions
Does Code-Graph-RAG support Scala?
Scala is currently in development. While the parser can extract functions, classes, and modules from .scala and .sc files—including case classes and objects—full feature parity with mature language support is still pending according to the support matrix in docs/architecture/language-support.md.
Can I add a programming language that isn't listed?
Yes. Any language with an existing Tree-sitter grammar can be integrated by extending the LanguageSpec configuration in codebase_rag/language_spec.py and registering the file extensions in codebase_rag/constants/languages.py. The unified graph schema allows new languages to plug into existing queries immediately.
How does Code-Graph-RAG handle projects with multiple programming languages?
The engine automatically detects and parses all supported file extensions within a repository, building a single graph that contains entities from every detected language. This allows you to write Cypher queries that trace relationships across language boundaries, such as Python scripts calling Rust libraries or TypeScript imports referencing C++ headers.
What is the difference between TypeScript and TSX support?
TypeScript (.ts, .mts, .cts) handles standard TypeScript features including interfaces, type aliases, enums, and namespaces. TSX (.tsx) extends this support to include JSX components, making it suitable for React and similar frameworks. Both are fully supported with identical graph entity extraction for functions, classes, and modules.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →