The Problem

Enterprises that need to query large document collections with LLM‑augmented answers often build custom pipelines that stitch together vector stores, entity extractors, and inference servers. Maintaining those pieces in separate languages creates latency, deployment friction, and inconsistent performance.

What This Does

graphrag-rs delivers a single‑language, Rust‑native implementation of GraphRAG. The core library in graphrag-core/ (223 files) defines the graph model, incremental construction, and retrieval APIs. A lightweight CLI (graphrag-cli/src/main.rs) and a Docker‑ready server (graphrag-server/src/main.rs) expose the functionality as a REST service. The WASM front‑end (graphrag-wasm/) runs the full pipeline in the browser, using WebGPU‑accelerated ONNX Runtime for embeddings. Example applications (examples/) show three deployment styles – server‑only, WASM‑only, and a hybrid approach.

Key code locations:

  • graphrag-core/src/graph/mod.rs – graph node/edge structs and construction helpers.
  • graphrag-core/src/retrieval/mod.rs – similarity search and path‑ranked answer generation.
  • graphrag-server/src/main.rs – parses config/schema/graphrag-config.schema.json, starts an Actix HTTP server, and wires the core to a Qdrant vector store.
  • graphrag-wasm/src/lib.rs – builds the WASM module, registers the Leptos UI, and calls the same core APIs compiled to wasm32-unknown-unknown.

How It Is Wired

Execution begins at one of three binaries:

Entry pointFilePrimary flow
Server‑onlygraphrag-server/src/main.rsParses CLI args → loads config/*.toml → creates a GraphRagEngine (graphrag-core/src/engine.rs) → mounts Actix routes (/query, /ingest) → each request calls engine.process_query() which invokes retrieval::search() and graph::expand() before returning JSON.
CLI toolgraphrag-cli/src/main.rsUses clap to read sub‑commands (ingest, query) → builds a temporary GraphRagEngine → runs the same core pipeline as the server but prints results to stdout.
WASM demographrag-wasm/src/lib.rs (built via trunk)On page load, init() calls engine::new() → UI events (file upload, query button) invoke engine.ingest_docs() and engine.query() via wasm-bindgen → results are rendered by Leptos components.

All three paths converge on graphrag-core/src/engine.rs, which owns the wide blast radius: it holds the in‑memory graph, vector index, and LLM client interfaces. No circular imports were detected; the import graph consists of ten internal modules with zero cycles, so changes to engine.rs are isolated to callers but affect every deployment mode.

How To Use It

# Clone the repo (exact URL required by the brief)
git clone https://github.com/moses-y/graphrag-rs.git
cd graphrag-rs

# Build all Rust crates
cargo build --release

# ---- Server‑only deployment ----
cd graphrag-server
docker-compose up -d          # optional Qdrant vector DB
export EMBEDDING_BACKEND=ollama
ollama serve &                # start local LLM service
ollama pull nomic-embed-text
cargo run --release --bin graphrag-server --features "qdrant,ollama"

# ---- CLI quick test ----
cd ../graphrag-cli
cargo run --release -- ingest examples/01_basic_usage.rs
cargo run --release -- query "What entities are mentioned?"

# ---- WASM demo ----
cd ../graphrag-wasm
cargo install trunk wasm-bindgen-cli   # if not already installed
trunk serve --open

Configuration files live under config/ (e.g., config/templates/semantic.graphrag.json5). The server reads the TOML variant at startup; the CLI accepts a --config flag (implemented in graphrag-cli/src/args.rs). No additional secrets are committed.

Real‑World Use

A compliance team can run the server inside a secure subnet, ingest policy PDFs via the CLI, and expose a /query endpoint to a low‑code portal. The portal’s front‑end can be swapped for the WASM demo to keep all data client‑side for privacy‑critical workflows, without rewriting the graph logic.

Code Health & Issues

  • HIGH – License missing – no LICENSE file; reuse is legally blocked.
  • HIGH – No CI workflow – 289 source files, but no GitHub Actions or other CI config.
  • HIGH – No build gate for Docker image – graphrag-server/Dockerfile is never validated automatically.
  • MEDIUM – Dependabot disabled – eight manifest files (Cargo.toml, Dockerfile, etc.) lack automated update config.
  • MEDIUM – Base image not pinned – Dockerfile uses mutable tags (rust:1.82-slim-bookworm).
  • MEDIUM – Large WASM binary in repo – graphrag-wasm/dist/graphrag-wasm-eb3e6a993842e424_bg.wasm (17.9 MB) should be stored via Git LFS or fetched at build time.

Additional hygiene: tests are present (tests/), a lockfile exists (Cargo.lock), and no secrets were found.

The Bottom Line

graphrag-rs provides a performant, Rust‑centric GraphRAG stack with three ready‑to‑run deployment options and a clean, non‑circular module layout. To be production‑ready, the project needs a license, CI pipelines, and tighter Docker hygiene; otherwise the core code is solid for teams comfortable with Rust and willing to manage the missing DevOps scaffolding.