Nano-graphrag is a Python library that provides a lightweight implementation of GraphRAG, a retrieval-augmented generation approach that uses knowledge graphs to improve question-answering over documents.
The project addresses the complexity of the official GraphRAG implementation by offering a simpler, more readable codebase that retains core functionality while reducing the barrier to understanding and modifying the system. It achieves this through a minimal footprint of approximately 1100 lines of code, excluding tests and prompts, while maintaining asynchronous operations and full type annotations. The tool supports multiple LLM providers including OpenAI, Azure OpenAI, and Amazon Bedrock, as well as local alternatives using transformers and Ollama for users without API keys.
Developers should choose this tool if they need a GraphRAG implementation that prioritizes code clarity and hackability over feature maximalism. It suits projects where understanding and customizing the RAG pipeline matters more than relying on a comprehensive framework. The tool supports both batch and incremental document insertion, with incremental insertion avoiding duplicate computation while recomputing graph communities. It also provides naive RAG as an alternative query mode. The project is portable across different storage backends including Faiss and Neo4j, making it adaptable to various deployment scenarios.
Almost all open issues are raised by external users rather than the core team, indicating a substantial base of adopters using the tool in real-world contexts. Maintainers typically respond to new issues and pull requests within a day. Work in the issue tracker is dominated by bug reports, enhancement requests, and WeChat-related discussions.