graphrag
Microsoft's graph-based RAG: index a corpus into a knowledge graph, then query it with an LLM
nano-graphrag: a small, hackable GraphRAG implementation in about 1,100 lines — no Microsoft GraphRAG bulk
nano-graphrag is an open-source rag & knowledge project by gusye1234 (gusye1234/nano-graphrag on GitHub). It has 3,993 GitHub stars and 432 forks, is released under the MIT license, and was last updated on GitHub on 27 January 2026.
Export your OpenAI key (or configure Azure, Bedrock, or a local Ollama setup from the examples).
Install from PyPI, or clone and install in editable mode to hack on the core.
Create a GraphRAG instance with a working directory and insert your documents.
Ask questions in local, global, and naive modes to compare graph-aware versus plain retrieval.
Roughly 1,100 lines implement the full GraphRAG pipeline — built to be hacked.
Entity-centric (local), community/theme-centric (global), and plain vector (naive) answering.
New text is deduplicated by md5 hashing and merged into the existing graph.
ainsert and aquery mirror the sync API for async applications.
Swap chunking, LLM, and embedding functions and prompts; choose nano-vectordb, faiss, hnswlib, or milvus-lite, and networkx or Neo4j storage.
OpenAI by default, with Azure OpenAI, Amazon Bedrock, and Ollama examples.
Clone the project and enter its directory (or install from PyPI in the next step).
git clone https://github.com/gusye1234/nano-graphrag.git
cd nano-graphragInstall the package and export your OpenAI API key.
pip install nano-graphrag
export OPENAI_API_KEY="your-key"Index a text file and ask a question in local mode, following the README quickstart.
from nano_graphrag import GraphRAG, QueryParam
graph_func = GraphRAG(working_dir="./dickens")
graph_func.insert(open("book.txt").read())
print(graph_func.query("What are the top themes?", param=QueryParam(mode="local")))Developer gusye1234 maintains nano-graphrag as an independent, community project inspired by Microsoft's GraphRAG.
Yes, MIT-licensed. Model calls bill to your own OpenAI/Azure/Bedrock keys, or run locally via Ollama examples.
By default it expects an OpenAI API key; the repo includes examples for Azure OpenAI, Bedrock, and local Ollama models if you prefer.
Microsoft's is the full research platform with extensive configuration. nano-graphrag trades breadth for a ~1,100-line core you can fully read and modify, with the same local/global query idea.
Run `pip install nano-graphrag`, set OPENAI_API_KEY, create GraphRAG(working_dir=...), insert text, and query with QueryParam(mode="local").
Microsoft's graph-based RAG: index a corpus into a knowledge graph, then query it with an LLM
Unified framework for enterprise RAG pipelines with small, specialized models - local, private and secure.
Federated AI search and RAG across 100+ apps — answers with sources, without moving your data
Lightweight OCR toolkit turning PDFs and images into structured, LLM-ready data in 100+ languages
Self-hosted rag & knowledge: cometchat docs search + implementation bundles: add cha.
High-performance PDF conversion library for macOS apps.
The most-starred other RAG & Knowledge projects in the LibreAI catalogue — the realistic shortlist if nano-graphrag is not the right fit.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or…
RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge RAG with Agent capabilities to create a superior context…
Lightweight OCR toolkit turning PDFs and images into structured, LLM-ready data in 100+ languages
Stop renting your intelligence. Own it with AnythingLLM. Everything you need for a powerful local-first agent experience
Ready-to-run templates for RAG, AI pipelines and enterprise search that stay in sync with live data
Free and open — grab the source, star the repo, and start creating.