Skip to main content
Visualize codebases as knowledge graphs to analyze dependencies, detect bottlenecks, and optimize projects. Code-Graph is a FalkorDB-powered tool that indexes source code repositories into a knowledge graph. It provides an interactive web UI and a CLI for exploring code structure, querying relationships between entities, and chatting with your codebase using GraphRAG. Live Demo · GitHub Repository Code-Graph — interactive code analysis visualization

Key Features


Supported Languages

Code-Graph currently supports the following languages:
  • Python (.py)
  • Java (.java)
  • C# (.cs)

Running with Docker

Clone the Code-Graph repository and navigate into it:

Using Docker Compose

This starts FalkorDB and the Code-Graph app together.

Using Docker directly

Start a FalkorDB instance:
Build and run the Code-Graph container:

Running Locally

Prerequisites

  • Python >=3.12,<3.14
  • Node.js 20+
  • uv
  • A FalkorDB instance (local or FalkorDB Cloud)

1. Start FalkorDB

Option A: Free cloud instance at app.falkordb.cloud Option B: Run locally with Docker:

2. Configure environment variables

The chat endpoint also requires the provider credential for your chosen MODEL_NAME. The default model is Gemini, so set GEMINI_API_KEY unless you use a different LiteLLM provider.

3. Install dependencies

4. Run the app

Backend + frontend (development):
The Vite dev server runs on http://localhost:3000 and proxies /api/* requests to http://127.0.0.1:5000. Single-process production build:

CLI Tool (cgraph)

Code-Graph includes a CLI tool for indexing codebases and querying the knowledge graph from the terminal.

Install

Usage

Run cgraph --help for full details.

Creating a Code Graph

Analyze a local folder

Analyze a Git repository

List indexed repositories

Note: If SECRET_TOKEN is set and CODE_GRAPH_PUBLIC is not enabled (1), add -H "Authorization: Bearer <YOUR_SECRET_TOKEN>" to the request.

GraphRAG Chat

Use the built-in chat interface to ask natural-language questions about your codebase. Code-Graph translates your questions into graph queries and returns contextual answers powered by LiteLLM and FalkorDB GraphRAG. Code-Graph — chat with your code graph

API Endpoints

Read endpoints

Mutating endpoints


Authentication


Resources

Frequently Asked Questions

Code-Graph is a FalkorDB-powered tool that indexes source code repositories into a knowledge graph. It provides an interactive web UI and CLI for exploring code structure, querying relationships between entities, and chatting with your codebase using GraphRAG.
Code-Graph currently supports Python (.py), Java (.java), and C# (.cs). It analyzes classes, functions, files, and their relationships (calls, imports, inherits).
Yes. Code-Graph includes a GraphRAG chat feature powered by LiteLLM that lets you ask natural-language questions about your code. It translates your questions into graph queries and returns contextual answers about dependencies, structure, and relationships.
Install with pip install falkordb-code-graph or pipx install falkordb-code-graph, then run cgraph index . --ignore node_modules --ignore .git for a local project, or cgraph index-repo https://github.com/user/repo for a remote repository.
Authentication depends on your configuration. Set SECRET_TOKEN to require Bearer token auth on mutating endpoints. Set CODE_GRAPH_PUBLIC=1 to allow read-only access without auth. When no token is configured, requests are accepted without authorization.