HKUDS/LightRAG
[EMNLP2025] "LightRAG: Simple and Fast Retrieval-Augmented Generation"
LightRAG is an open-source retrieval-augmented generation framework from HKUDS that pairs a knowledge graph with vector search for accurate answers over your documents. Published at EMNLP 2025, it builds an entity-relationship graph from your text and retrieves across both graph and embeddings.
Our Review
LightRAG comes out of the University of Hong Kong Data Science lab (HKUDS) and earned a spot at EMNLP 2025 alongside 35,000 GitHub stars. Where plain RAG only chunks and embeds text, LightRAG also extracts entities and their relationships into a graph, so retrieval can follow connections instead of matching isolated passages.
What LightRAG does:
- •Graph-plus-vector retrieval extracts entities and relationships into a knowledge graph and queries it alongside vector embeddings for context-aware answers.
- •Dual-level retrieval combines low-level (specific entities) and high-level (broad themes) queries so answers capture both detail and the big picture.
- •Incremental updates add new documents without rebuilding the whole index, keeping the graph current.
- •Many model and storage backends works with OpenAI, Ollama, and Hugging Face models and storage like PostgreSQL, Neo4j, Milvus, and Faiss.
- •LightRAG Server and Web UI a built-in API server and browser UI for document ingestion, knowledge-graph visualization, and querying.
- •Citation tracking answers trace back to source documents for verifiable retrieval.
Getting started:
Install with pip install lightrag-hku, set your LLM and embedding provider, then call rag.insert(text) and rag.query("..."). The LightRAG Server adds a REST API and web UI. Docs and the EMNLP paper are linked from the repo.
Limitations:
LightRAG is a Python library, so you build and host the pipeline yourself, including the LLM, embeddings, and graph or vector store. Graph extraction calls an LLM during ingestion, which adds token cost and time on large corpora. There is no managed cloud offering from the project, and tuning retrieval quality for a specific domain takes experimentation. As an active research project, APIs can change between releases.
Our Verdict
LightRAG is one of the most practical open-source ways to add graph-aware retrieval to an LLM app in 2026. If plain vector RAG gives you answers that miss the connections between facts, LightRAG's entity-and-relationship graph is a clear step up, with a peer-reviewed paper and 35,000 stars behind it.
For developers, it installs as a single pip package and speaks to the model and storage backends you already use, from OpenAI and Ollama to PostgreSQL, Neo4j, and Milvus. The bundled server and web UI let you ingest documents, inspect the knowledge graph, and test queries before wiring it into production.
Skip LightRAG if you want a fully managed retrieval API with no infrastructure to run, or if simple keyword or vector search already answers your questions; the graph-building step adds cost you would not need. For a hosted, turnkey option, a managed platform is less work than self-hosting.
Frequently Asked Questions
What is LightRAG?
LightRAG is an open-source retrieval-augmented generation framework, created by the HKUDS lab at the University of Hong Kong and published at EMNLP 2025. It builds a knowledge graph of entities and relationships from your documents and combines that graph with vector embeddings, so an LLM can answer questions that depend on how facts connect, not only on text similarity.
Is LightRAG free?
Yes. LightRAG is released under the MIT license and is free and open source as of 2026. You install it from PyPI as lightrag-hku at no cost. The expenses you do incur are the LLM and embedding API calls it makes during ingestion and querying, plus whatever storage backend you choose to run.
How is LightRAG different from GraphRAG?
Both add a knowledge graph to retrieval, but LightRAG is designed to be lighter and faster: it uses incremental updates and a dual-level retrieval scheme rather than rebuilding large community summaries. Choose Microsoft's GraphRAG when you want deep hierarchical community analysis; choose LightRAG when you want quicker ingestion, lower cost, and simple incremental updates.
What models and databases does LightRAG support?
LightRAG is backend-agnostic. It works with LLM and embedding providers including OpenAI, Ollama, and Hugging Face, and it stores graphs and vectors in options such as PostgreSQL, Neo4j, Milvus, and Faiss. You pick the combination that fits your stack, which makes it straightforward to run fully locally or against hosted APIs.
Does LightRAG include a user interface?
Yes. The project ships a LightRAG Server with a REST API and a web UI as of 2026. The interface lets you upload documents, watch the knowledge graph build, visualize entities and relationships, and run test queries before integrating the library into your own application.
How do I install LightRAG?
Visit the GitHub repository at https://github.com/HKUDS/LightRAG for installation instructions.
What license does LightRAG use?
LightRAG uses the MIT license.
What are alternatives to LightRAG?
Explore related tools and alternatives on My AI Guide.
Open source & community-verified
MIT licensed: free to use in any project, no strings attached. 36,132 developers have starred this, meaning the community has reviewed and trusted it.
Reviewed by My AI Guide for relevance, quality, and active maintenance before listing.
Topics