LightRAG is a graph-based retrieval-augmented generation framework that reduces the number of LLM calls during indexing and querying compared to traditional GraphRAG. It offers dual-level retrieval, incremental data updates without full index rebuilds, and configurable LLM roles for extraction and querying.
Project overview
The framework reduces computational overhead in large-scale knowledge graph indexing by allowing real-time integration of new data via set merging without global index rebuilds.
Project type
RAG · Data Processing
Use cases
Documents & Office · Knowledge Q&A
Deployment
Refer to project documentation
License
MIT
Best for
Developers and AI engineers building graph-based retrieval systems for enterprise documents who require incremental updates without full rebuilds.
Researchers needing configurable LLM roles and multiple retrieval modes to test varied query strategies.
Key capabilities
Integrates new data into the existing graph via set merging without requiring global index rebuilds.
Offers local, global, hybrid, naive, and mix query modes to handle various types of questions.
Supports configuring distinct LLM and VLM models for extraction, query, keyword generation, and vision tasks.
Allows deploying an optional rerank model during the query phase to improve query quality.
Extracts text, tables, formulas, and images using selectable parsing engines including MinerU, Docling, or Native options.
Provides an interface to insert, query, visualize, and manage knowledge via a web dashboard and REST API.
Offers four text chunking strategies: Fix, Recursive, Vector, and Paragraph.
Limitations and risks
The framework currently lacks a re-embedding tool, which makes changing embedding models a costly operation.
Some framework features are not exposed via the REST API and are only accessible through the SDK.
LLM timeouts may occur during entity-relation extraction due to slow models, chunk volume, or output loops.
Getting started
Install the package or clone the repository, then set up the .env file with LLM and embedding configurations to handle multiple models and storage backends.
Alternatives and comparisons
Converts complex documents like PDFs and Office files into Markdown and JSON for retrieval pipelines.
Processes PDFs and Word documents into structured data within spaCy Doc objects for NLP and RAG pipelines.
Provides high-performance, low-memory unstructured data extraction executed locally in native code.
README: LightRAG is a lightweight knowledge-graph RAG framework and an efficient alternative to Microsoft GraphRAG.
README: Integrated OpenSearch as a unified storage backend, providing comprehensive support for all four LightRAG storage.
README: LightRAG supports seamless, incremental knowledge base updates. New data only needs to go through a standard graph indexing pipeline to generate a local graph, which is then direc…
README: LightRAG requires LLM/VLMs of four different roles during its workflow. You should configure models with different capabilities and speeds for different roles to strike a balance…