Vibe Coding Discover

RAG

nano-graphrag

View on GitHub

A simple, easy-to-hack GraphRAG implementation

★ 4K427 forksPythonMITgusye1234

nano-graphrag is a compact (~1100 LOC) MIT-licensed Python GraphRAG implementation: inserts text, builds an entity/relation graph, and answers global or local queries. Pluggable LLMs, embeddings, vector stores (FAISS, Milvus, Qdrant, hnswlib) and graph stores (networkx, Neo4j), fully async.

Use Cases

Build GraphRAG knowledge graph over book/document corporaEntity and relation extraction with LLMGlobal vs local graph-based retrieval queriesIncremental and batch document insert without duplicate chunksRun GraphRAG fully offline with Ollama and local embeddingsSwap vector stores (FAISS, Milvus, Qdrant, hnswlib)Use Neo4j as graph storage backendExport and visualize the graph as GraphMLNaive RAG mode for plain vector retrievalCustomize chunking, prompts, and LLM functionsReturn retrieved context only for custom integrationFine-tune entity extraction with DSPy

Built With

Language
Python
Frameworks
networkx · neo4j · hnswlib · faiss · milvus-lite · qdrant · nano-vectordb · dspy · ollama · transformers · sentence-transformers · graspologic · tiktoken · aioboto3

Tags

graphrag · rag · knowledge-graph · retrieval-augmented-generation · entity-extraction · community-detection · graph-query · llm · async · incremental-insert · neo4j · networkx · vector-database · hackable · small-codebase · ollama