# graphrag-rs: A Rust GraphRAG Implementation with CLI, Server, and Browser WASM

> graphrag-rs is a Rust crate for building knowledge graphs from text documents and querying them in natural language. It ships as three deployment modes: a command-line tool, a REST API server, and a WASM build that runs the entire pipeline inside a browser, making it one of the few GraphRAG implementations that can operate without any server infrastructure.

**automataIA/graphrag-rs** — GraphRAG-rs is a high-performance, state-of-the-art Rust implementation of GraphRAG (Graph-based Retrieval Augmented Generation) that builds knowledge graphs from documents and enables natural language querying with configurable entity extraction and local LLM integration

- Repository: https://github.com/automataIA/graphrag-rs
- Website: https://automataia.github.io/graphrag-rs/
- Stars: 528 · Forks: 50
- Language: Rust
- License: MIT
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/automataia-graphrag-rs

## What GraphRAG Is and the Problem graphrag-rs Addresses

Standard retrieval-augmented generation (RAG) embeds document chunks as vectors and retrieves the most similar chunks to a query, then passes them to a language model. This works for queries that can be answered by one or two document fragments, but it misses connections between concepts spread across many documents.

GraphRAG adds a knowledge graph step. Documents are processed to extract named entities and the relationships between them. Those entities and relationships form a graph. When a query arrives, the system can traverse graph edges to follow conceptual connections rather than relying on vector proximity alone. This matters for questions that require linking multiple pieces of information: asking about the causes of an event, the relationships between people in a corpus, or the chain of reasoning across chapters.

graphrag-rs implements this pattern in Rust. The target audience is developers who want a GraphRAG pipeline that compiles to a small, fast binary, embeds into native applications, or runs in a browser via WebAssembly. A Python GraphRAG implementation such as Microsoft's graphrag package is the natural comparison: it has more documentation and community tooling, but it cannot be compiled to WASM or embedded in a Rust binary. graphrag-rs trades ecosystem breadth for deployment flexibility and performance characteristics typical of Rust.

## Three Deployment Modes and What Each Covers

The README defines three architectures. The Server-Only mode is described as production-ready. It runs a REST API backed by Qdrant for vector storage and Ollama for embeddings. The WASM-Only mode is also described as production-ready and runs the entire GraphRAG pipeline inside a browser using ONNX Runtime Web for GPU-accelerated embeddings and WebLLM for answer synthesis with Phi-3-mini. The Hybrid mode, which would combine a WASM client with an optional server for heavy computation, is described as in Phase 3 planning.

For the Server-Only mode, starting the server requires Qdrant running (optionally via Docker Compose) and Ollama serving an embedding model:

```bash
cargo run --release --bin graphrag-server --features "qdrant,ollama"
```

For the WASM mode, Trunk is required and the application builds to a browser app:

```bash
cargo install trunk wasm-bindgen-cli
cd graphrag-wasm
trunk serve --open
```

The Cargo.toml workspace version is 0.2.0 and the project requires Rust 1.85 or later. The README notes the MSRV is verified at 1.85 because the jsonfixer dependency uses Rust's 2024 edition, which requires that version.

## Installing the CLI and Running a First Knowledge Graph Query

The quickest path to a working GraphRAG query uses the CLI crate. Install it once from the cloned repository:

```bash
cargo install --path graphrag-cli
```

Then index a document and query it:

```bash
graphrag index ./mydoc.txt
graphrag ask "What is the main topic?"
```

The index step builds a knowledge graph in a ./graphrag-data directory. The ask command queries the graph and returns an answer. Without any additional flags, both commands use hash-based fallback embeddings and pattern-based entity extraction, which work without any external service.

Add --ollama to either command to use Ollama for higher-quality embeddings and extraction. This requires `ollama serve` to be running and a compatible model to be pulled (the README example uses nomic-embed-text for embeddings). The difference in retrieval quality between hash-fallback and Ollama-based embeddings is significant and worth testing before committing to a deployment approach.

For Rust library use, the package exposes a GraphRAG struct:

```rust
use graphrag::GraphRAG;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let mut g = GraphRAG::quick_start("Plato's Symposium full text here...").await?;
    println!("{}", g.ask("Who is Diotima?").await?);
    Ok(())
}
```

## Knowledge Graph Pipeline and Research Techniques

The README lists five research paper implementations that improve retrieval quality over basic GraphRAG:

LightRAG Dual-Level Retrieval (EMNLP 2025) reduces the token cost of graph traversal. Leiden Community Detection (Scientific Reports 2019) improves graph modularity. Cross-Encoder Reranking (EMNLP 2019) re-scores retrieved candidates after initial retrieval. HippoRAG Personalized PageRank (NeurIPS 2024) reduces cost while maintaining retrieval quality. Semantic Chunking (LangChain 2024) produces better document boundary splits.

Beyond those five, the README documents additional techniques in Phase 2 and Phase 3: Symbolic Anchoring grounds abstract query terms to concrete entities, Dynamic Edge Weighting adjusts relationship importance based on query context, Causal Chain Analysis discovers multi-step causal relationships, and Hierarchical Relationship Clustering organises the graph into levels.

Enabling the research features requires adding feature flags in Cargo.toml:

```toml
[dependencies]
graphrag-core = { path = "../graphrag-core", features = ["lightrag", "leiden", "cross-encoder", "pagerank", "async"] }
```

The WASM demo included in the repository uses Plato's Symposium as the default corpus and indexes 2691 entities. This is a useful reference for understanding what entity counts look like at a concrete document scale.

## Limitations, Rough Edges, and the Hybrid Gap

Hash-fallback embeddings, which are the default when Ollama is not running, use a deterministic function over token strings rather than a learned embedding space. The README does not quantify the quality difference, but semantic similarity between unrelated words that share substrings is a known failure mode for hash-based approaches. Real-world use cases should test with Ollama enabled.

The Hybrid deployment mode, described as the recommended architecture in the README, is not yet implemented. It exists only as designed architecture in Phase 3. Developers who need synchronised multi-device state or server-side processing for large document sets must currently choose between the full server mode and the fully client-side WASM mode.

The WASM build depends on WebGPU for GPU acceleration. Browser support for WebGPU is not universal; older browsers and some mobile browsers will fall back to CPU, which affects inference speed for the local LLM synthesis step.

The project's last push was on 2026-06-02. That is under six months before this writing, so the project is not stale by calendar definition, but it is not under daily or weekly active development based on the visible commit history.

The workspace Cargo.toml pins the Rust minimum version at 1.85. Builds on older stable Rust toolchains will fail without upgrading.

## Comparing graphrag-rs to Microsoft's graphrag Package

Microsoft's graphrag package (Python) is the most widely referenced GraphRAG implementation. It provides detailed documentation, an active community, and integration with Azure OpenAI as the primary model backend. It does not compile to WASM, cannot be embedded as a Rust library, and requires Python with its package ecosystem.

graphrag-rs makes the opposite trade. It produces a 5.2MB release binary for the server mode (per the README), runs entirely in the browser without a server for the WASM mode, and compiles as a Rust crate for embedding in native applications. The quality of the knowledge graph extraction depends on whether Ollama is available; Microsoft's graphrag defaults to higher-quality LLM-based extraction.

For a team using Python and Azure, Microsoft's graphrag is the more mature choice. For a team building a Rust service, a browser extension, or an offline document analysis tool, graphrag-rs provides capabilities the Python implementation cannot match.

## Maintenance and Licence

The repository was last pushed on 2026-06-02 and carries no GitHub releases. The workspace version in Cargo.toml is 0.2.0. The project is licensed under MIT, which permits commercial use without restriction and includes no patent grant.

The workspace lists five crates: graphrag-core, graphrag-wasm, graphrag-server, graphrag-cli, and graphrag. Each has separate responsibilities and can be used as an independent dependency. The documentation site is at automataia.github.io/graphrag-rs and the API reference is described as available at docs.rs/graphrag-core, though the package is not yet published to crates.io based on the local path dependencies in Cargo.toml. A HOW_IT_WORKS.md file in the repository root documents the internal pipeline in more depth than the README for developers who want to extend the core graph construction logic.

## Conclusion

graphrag-rs is a good fit for Rust developers who want a GraphRAG pipeline they can embed in a native application, run at the command line, or deploy client-side without infrastructure. The WASM mode is production-ready for privacy-first or offline contexts; the Hybrid mode is not yet implemented. Before adopting it, test the Ollama integration specifically, since hash-fallback embeddings reduce retrieval quality, and confirm whether jemalloc layout variability in the 8.8.0 and 8.8.1 exploits is relevant to your threat model. Check the last push date of 2026-06-02 against your support expectations.

## FAQ

### What is GraphRAG and how does it work?

GraphRAG builds a knowledge graph from documents by extracting entities and the relationships between them, then answers natural language queries by traversing that graph. graphrag-rs implements this in Rust with optional support for Ollama embeddings, Qdrant vector storage, and WASM browser deployment.

### What are the key differences between RAG and GraphRAG?

Standard RAG retrieves document chunks based on vector similarity and passes them to a language model. GraphRAG first builds a knowledge graph of entities and relationships, so queries can follow graph edges to connect concepts spread across many documents, which standard similarity-based retrieval cannot do.

### Does graphrag-rs require an external database to run?

No. The CLI uses hash-based fallback embeddings and local file storage by default, requiring no external service. Qdrant vector database and Ollama are optional dependencies that improve retrieval quality but are not required for a first run.

## Sources

- [automataIA/graphrag-rs on GitHub](https://github.com/automataIA/graphrag-rs)
- [Issues](https://github.com/automataIA/graphrag-rs/issues)
- [License: MIT](https://github.com/automataIA/graphrag-rs/blob/main/LICENSE)
- [Project website](https://automataia.github.io/graphrag-rs/)
- [README](https://github.com/automataIA/graphrag-rs/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/automataia-graphrag-rs
