| description | Install Code-Graph-RAG and set up Memgraph for multi-language codebase analysis. |
|---|
- Python 3.12+
- Docker & Docker Compose (for Memgraph)
- cmake (required for building pymgclient dependency)
- ripgrep (
rg) (required for shell command text searching) - For cloud models: Google Gemini API key, OpenAI API key, or both
- For local models: Ollama installed and running
uvpackage manager (recommended) orpip
=== "macOS"
```bash
brew install cmake ripgrep
```
=== "Ubuntu/Debian"
```bash
sudo apt-get update
sudo apt-get install cmake ripgrep
```
=== "CentOS/RHEL"
```bash
sudo yum install cmake
sudo dnf install ripgrep
```
ripgrep may need to be installed from EPEL or via `cargo install ripgrep`.
pip install code-graph-ragWith all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C, C++, Lua, PHP, C#, Dart):
pip install 'code-graph-rag[treesitter-full]'With semantic code search (UniXcoder embeddings):
pip install 'code-graph-rag[semantic]'With both full language support and semantic search:
pip install 'code-graph-rag[treesitter-full,semantic]'git clone https://github.com/vitali87/code-graph-rag.git
cd code-graph-ragFor basic Python support:
uv syncFor full multi-language support:
uv sync --extra treesitter-fullFor development (including tests and pre-commit hooks):
make devThis installs all dependencies and sets up pre-commit hooks automatically.
Each GitHub release ships prebuilt binaries together with Sigstore signatures (*.sigstore.json); releases from v0.0.484 onwards also carry a SLSA build provenance attestation (multiple.intoto.jsonl). Both are produced by the build-binaries.yml GitHub Actions workflow using keyless signing, so there is no maintainer-held key to obtain: verification checks that the artifact was built by this repository's release workflow.
To verify provenance with the GitHub CLI:
gh attestation verify code-graph-rag-linux-amd64 \
--repo vitali87/code-graph-rag \
--signer-workflow vitali87/code-graph-rag/.github/workflows/build-binaries.ymlThe --signer-workflow flag pins the attestation to the release workflow itself; --repo alone accepts an attestation signed by any workflow in the repository.
To verify a signature with cosign:
cosign verify-blob \
--bundle code-graph-rag-linux-amd64.sigstore.json \
--certificate-identity-regexp 'https://github\.com/vitali87/code-graph-rag/\.github/workflows/build-binaries\.yml@.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
code-graph-rag-linux-amd64Substitute the binary name for your platform. Packages installed from PyPI are protected differently: pip and uv verify package hashes, which proves integrity in transit, and releases after v0.0.187 additionally carry a PEP 740 attestation. That is a publish attestation — proof that the file was uploaded by this project's trusted publisher — rather than build provenance, and it can be queried through PyPI's Integrity API.
cgr daemon upThis starts the packaged Memgraph + Qdrant stack and waits until it is healthy. It works the same whether you installed from PyPI or from source, since the compose file ships inside the package. Memgraph listens on port 7687 and Memgraph Lab on port 3000.
cp .env.example .env
# Edit .env with your configurationSee the Configuration guide for all available options.
cgr doctorThis checks that all required dependencies and services are available.
- loguru: Python logging made (stupidly) simple
- mcp: Model Context Protocol SDK
- pydantic-ai: AI Agent Framework, the Pydantic way
- pydantic-settings: Settings management using Pydantic
- pymgclient: Memgraph database adapter for Python language
- python-dotenv: Read key-value pairs from a .env file and set them as environment variables
- tiktoken: tiktoken is a fast BPE tokeniser for use with OpenAI's models
- toml: Python Library for Tom's Obvious, Minimal Language
- tree-sitter-python: Python grammar for tree-sitter
- tree-sitter: Python bindings to the Tree-sitter parsing library
- watchdog: Filesystem events monitoring
- typer: Typer, build great CLIs. Easy to code. Based on Python type hints.
- rich: Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal
- prompt-toolkit: Library for building powerful interactive command lines in Python
- diff-match-patch: Repackaging of Google's Diff Match and Patch libraries.
- click: Composable command line interface toolkit
- protobuf
- defusedxml: XML bomb protection for Python stdlib modules
- huggingface-hub: Client library to download and publish models, datasets and other repos on the huggingface.co hub
- pathspec: Utility library for gitignore style pattern matching of file paths.