LightRAG is an open source retrieval-augmented generation framework that does more than find text chunks similar to your question. It builds a knowledge graph from your documents, connects entities and relationships, and lets the model reason across them.
LightRAG is an open source retrieval-augmented generation framework that does more than find text chunks similar to your question. It builds a knowledge graph from your documents, connects entities and relationships, and lets the model reason across them.
LightRAG combines knowledge graphs with vector embeddings to retrieve both specific details and the big picture across many documents. Traditional RAG cuts documents into chunks and finds the chunk most similar to the query. That works for simple questions but fails when the answer is scattered across multiple sources or depends on relationships between entities.
LightRAG takes an extra step: it recognizes names, companies, and events, then links the relationships between them. In plain terms, it keeps the original documents while also drawing a map of who relates to whom. It supports five query modes — local, global, hybrid, naive, and mix — so you can choose how the system searches based on the kind of question you are asking. A WebUI lets you insert, query, and visualize the knowledge graph without writing code, and a REST API lets you integrate it into a product.
LightRAG uses a dual-layer architecture. The graph layer holds entities and their relationships; the vector layer holds the original text chunks. When you ask a question, the query mode determines how the system routes the search: local for specific details, global for broad themes, mix to combine graph relationships with text chunks for a fuller answer.
The server installs quickly with uv tool install "lightrag-hku[api]", and a WebUI lets you upload documents, run queries, and inspect the resulting graph visually. For multimodal documents, the parsing pipeline extracts text, tables, formulas, and images into distinct nodes before linking them into the graph. When new data arrives, LightRAG builds a local subgraph for the new document and merges it into the existing index, rather than forcing a full rebuild.
Real-world setup is more complex than a vector-database-only RAG system. Quality depends heavily on the entity extraction model, the answering model, and how documents are parsed. You need to choose your embedding model before indexing, because switching embeddings later can force you to re-embed everything. The repo itself notes that the default configuration is a starting point, not the best possible setup. Performance and quality claims are mostly self-reported by the project, not independently verified.
LightRAG is for teams building internal Q&A chatbots, synthesizing research across many papers, or querying large technical document collections where answers depend on relationships between entities. For small datasets and simple lookup questions, plain vector RAG is still simpler.
Choose LightRAG when your questions cross document boundaries and need connected reasoning — not for every problem.