1. Project/Product Overview
| Dimension | Information | |
|---|---|---|
| Project name | LightRAG | |
| Developer | University of Hong Kong Data Science Lab (HKUDS) | |
| Author | Zirui Guo, Lianghao Xia, Yanhua Yu, Tu Ao, Chao Huang (HKU × Beiyou) | |
| Open Source License | MIT | |
| Main language | Python(≥ 3.10) | |
| GitHub Stars | 37,212(2026-07-02) | |
| Forks | 5,244 | |
| Commits | 8,594 (daily average 10 submissions, extremely fast iteration) | |
| Tags / Releases | 95 | |
| Open Issues | 217 | |
| Created | 2024-10-02 (37K Stars in only one and a half years) | |
| Last Updated | 2026-07-01 (almost daily active) | |
| Paper | EMNLP 2025 Findings (Top Meeting) | |
| official website | https://github.com/HKUDS/LightRAG | |
| PyPI Package | 'lightrag-hku | (latest v1.5.x) |
| Docker image | 'ghcr.io/hkuds/lightrag:latest' (signed Sigstore Cosign) | |
| Chinese language support | README_zh.md README-ja.md Chinese community active | |
| Ecological Projects | RAG-Anything (Multimodal RAG), VideoRAG (Video Understanding), MiniRAG (Small Model Optimization) |
2. What does it mostly do?
2.1 Core Architecture: Two-layer Knowledge Graph Vector Retrieval
The core design of the LightRAG is to bridge the gap between knowledge mapping and vector retrieval, replacing GraphRAG cumbersome community-level clustering with a two-tier architecture:
┌─────────────────────────────────────────────────────┐
│ LightRAG │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ │
│ │ 知识图谱 (KG) │ │ 向量存储 (V) │ │ KV 缓存 │ │
│ │ 实体+关系图 │ │ 语义相似检索 │ │ LLM 缓存 │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬─────┘ │
│ │ │ │ │
│ ┌──────┴─────────────────┴─────────────────┴──────┐ │
│ │ 双层检索引擎 │ │
│ │ • Low-level: 具体实体 + 邻居子图遍历 │ │
│ │ • High-level: 主题关键词 + 全局关系链 │ │
│ │ • 混合模式 (Mix): 图谱 + 向量 + 文本三重融合 │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
Index Phase Process:
- Document segmentation → LLM extraction of entities and relationships → construction of knowledge graph (node = entity, edge = relationship)
- At the same time, the vector embedding of entities/relationships is generated and stored in the vector database.
- Generate low-level keys (entity name index) and high-level keys (topic keyword index)
- Incremental merging of new documents: local maps are directly integrated into the global map through collection merging without reconstruction.
Retrieval phase process:
- User query → LLM extraction of double-layer keywords (high-level = topic concept, low-level = specific entity)
- Low-level retrieval: locate entity nodes in the knowledge graph → traverse neighbor subgraphs → obtain relevant relationships and attributes.
- High-level retrieval: using topic keywords → matching global concept chains in the map → obtaining macro information across documents
- Vector retrieval: original query embedding-semantic similarity matching text block.
- Three-level result fusion → LLM generates final answer (with citation source)
2.2 LightRAG vs GraphRAG Core Comparison
| Comparison dimension | GraphRAG (Microsoft) | LightRAG (HKU) |
|---|---|---|
| Architecture Ideas | Pure Map + Leiden Community Clustering + Hierarchical Summary | Knowledge Map + Vector Retrieval Double-Layer Fusion |
| index token consumption | ~ 2,450,000 tokens(1 million words) | ~ 100,000 tokens, reduced by about 95% |
| Token query consumption | ~ 85,000 tokens +610 API calls (global mode) | ~ 1,000 tokens + dozens of calls, about 6,000 times lower |
| API calls (index) | 1,200 + | Dozens of times |
| Incremental update | Not supported (new documents need to rebuild community hierarchy) | Native support -- Local map merge directly |
| Document deletion | Not supported (requires full rebuild) | Supported -- Automatically partially rebuild affected entities |
| Search Mode | Local / Global | Five -- Local / Global / Hybrid / Naive / Mix |
| WebUI | None | There -- Knowledge Graph Visualization + Document Management + Query Interface |
| Multimodal | Limited | Integrated RAG-Anything(MinerU / Docling, PDF/Image/Table/Formula support) |
| Reranker | No built-in | Support -- Cohere, Jina, and Alibaba Cloud, greatly improving the quality of mixed queries |
| Assessment/Tracking | No built-in | Integrated RAGAS Assessment + Langfuse Tracking |
| LLM Provider | OpenAI | 20 + -- OpenAI / Azure / Anthropic / Gemini / Bedrock / Ollama |
| Knowledge Graph Storage | Local Files | 10 + Backend -- NetworkX / Neo4j / PostgreSQL / MongoDB / Memgraph / OpenSearch |
| Vector Storage | Local | 10 + Backend -- NanoVectorDB / Milvus / Qdrant / Faiss / PostgreSQL / MongoDB / Redis / Chroma |
| Production deployment | Basic script | Docker Compose + K8s Helm + systemd + Railway-click deployment |
| Authentication Security | No built-in | API Key + JWT + CORS + SSL |
| Paper Published | arXiv Technical Report | EMNLP 2025 (officially accepted at the top meeting) |
| Chinese support | None | README Chinese/Japanese/English + Qwen model optimization + active Chinese community |
| Community Heat | ~ 7,500 Stars | **37,000 + Stars,5 times more |
Complete List of 2.3 Core Features
- double-layer search : low-level (entity-level exact matching) high-level (subject-level macro understanding), dealing with "what theory Einstein proposed" and "what is the influence of relativity on modern physics"
-Five query modes:Local (entity precision), Global (cross-document topic), Hybrid(Local Global fusion), Naive (traditional vector search), and Mix (triple fusion, recommended by default)
-Incremental Knowledge Base Update: The new document only follows the standard atlas index Pipeline, and the generated local atlas is directly merged into the global atlas through collection merging without reconstruction.
-Document deletion and reconstruction: Use the LLM cache to quickly reconstruct the affected entity relationships to avoid full reconstruction.
-Knowledge Graph Visualization:WebUI has built-in force-guided graph nodes to query sub-graph filters and export HTML
-Citation Traceability: The query result is accompanied by the source document and the reference mark of the specific paragraph.
- Multimodal Processing : Integrated RAG-Anything, supports PDF / Word/Excel/Picture/Form/Formula parsing and cross-modal retrieval, 15 document formats
-Four blocking strategies:Fix (fixed length), Recursive (recursive semantic segmentation), Vector (vector similarity segmentation), and Paragraph (paragraph-aware segmentation)
-Role separation LLM configuration:EXTRACT/QUERY / KEYWORDS / VLM four roles can be independently configured with different models and parameters
-Reorder Enhancement: supports Cohere, Jina, and Alibaba Cloud Reranker, which is enabled by default and significantly improves query quality.
-Evaluation Integration:RAGAS evaluation metrics (context accuracy, fidelity, etc.) Langfuse link tracking
-Offline Deployment: Supports full offline/air gap deployment, including offline LLM and offline storage dependencies
3. Applicable Scenario
| Scenarios | Descriptions | Why LightRAG are suitable | Typical customer types |
|---|---|---|---|
| Enterprise Knowledge Base Q & A | Natural Language Q & A of a large number of internal documents, product manuals, and policy documents | The graph structure captures implicit relationships between documents, and the answers need to be integrated across documents; WebUI lowers the use threshold | Knowledge Management/IT Department of Medium and Large Enterprises |
| Legal/Compliance Document Analysis | Contract Comparison, Case Correlation, Impact Analysis of Regulatory Changes | Relationship Map is naturally suitable for retrospective clause reference chain and cross-document legal reasoning | Law Firm, Corporate Legal Department, Compliance Team |
| Scientific research literature analysis | Knowledge network construction and panoramic query of papers, patents, and experimental reports | Extract complex relationships between scholars/institutions/technologies/methods to support multi-hop reasoning across domains | Universities, research institutes, and pharmaceutical companies. |
| Financial Intelligence Analysis | Company/Executive/Market Correlation Inquiry, Regulatory Change Impact Assessment | Automatic Correlation of Inter-Entity Investment/Competition/Supply Chain Relationships, Suitable for Financial Knowledge Mapping Scenarios | Investment Banking, Asset Management, Wind Control Departments |
| Operation and Maintenance Manual/Equipment Documentation | Intelligent Q & A for Complex Equipment Maintenance Manual and Operation Process | Map Accurate Matching Failure Phenomena → Parts → Correlation of Maintenance Steps | Manufacturing, Energy and Airlines |
| Chinese-first scenarios | Need Chinese model optimization and Chinese community support | Qwen series has made special optimization for LightRAG; Chinese README + Community | Domestic Enterprises and Government Organizations |
| Budget-sensitive scenarios | Hope to use atlas RAG but the GraphRAG cost is too high | Token consumption is reduced by 95% +, Ollama local model is supported, and API cost is almost 0 | Small and medium-sized enterprises and start-up companies |
| Dynamically update the knowledge base | Documents increase or decrease frequently, and the index cannot be rebuilt every time. | Native incremental update + document deletion and reconstruction is the only large-scale map RAG that supports this feature. | News media, dynamic regulation tracking |
4. Not quite the scene
| Scenario | Reason | Alternative Suggestions |
|---|---|---|
| Single document simple question and answer | Graph construction has additional overhead, simple scenarios do not require relational modeling | Traditional RAG (such as LlamaIndex, RAGFlow) is sufficient |
| Real-time stream data processing | The indexing phase requires LLM to extract entity relationships, which is not suitable for real-time scenarios at the millisecond level | Traditional vector retrieval stream processing framework |
| Local deployment of low GPU resources | Both entity extraction and query require LLM with parameters no less than 30B, and local operation is slow without GPU | MiniRAG (produced by the same team, small model optimized version) |
| No need for relational reasoning | If all the questions are "what does this document say", the additional cost of the map does not pay off | Naive RAG or Dify low-code solutions. |
| Completely Low Code Requirements | Although LightRAG has WebUI, configuration and tuning still require technical background (.env configuration, storage backend selection, etc.) | Dify / Coze / MaxKB |
| Community level summary is just needed | LightRAG do not do Leiden cluster community summary, some scenarios need to "generate overview report for the entire corpus" | GraphRAG (but need to bear higher cost) |
| Pure Graph Database Query Scenario | If you already have a Cypher query on the Neo4j graph database, you do not need to LightRAG build a graph from the text | You can directly use the graph database to query the LLM |
5. Core Competence List
5.1 Indexing and Knowledge Building
| Automatic entity extraction | LLM recognizes entity name, type and description from documents, supports JSON format output (more stable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Automatic relationship extraction | LLM identifies semantic relationships between entities (cause and effect, inclusion, contrast, etc.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Four chunked strategies | Fix / Recursive / Vector / Paragraph, can be combined | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Multiple parsing engines | Native / MinerU / Docling three document parsing engines, supporting 15 formats such as PDF, Word, and Excel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Multimodal Index | Table Understanding, Formula Extraction, Picture Analysis (VLM), Unified Index of Cross-modal Entity Relationships | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Incremental update | The local map of the new document is directly integrated into the global map, and the collection merge algorithm. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Document deletion and reconstruction | Local reconstruction of the affected subgraph using the LLM cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File Processing Concurrency | MAX_PARALLEL_INSERT / MAX_ASYNC_LLM / EMBEDDING_BATCH_NUM Multidimensional Concurrency Configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Citation Tracking | Records the mapping between the entity/relationship and the source file in the index phase. The source tracing is supported during query. |
5.2 retrieval and query
| double-layer keyword extraction | LLM simultaneously extracts high-level topic keywords and low-level entity keywords from user queries | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Knowledge Graph Traversal | Locating Entities Based on Low-Level Keywords → Neighbor Subgraph Traversal → Obtaining Related Relationships and Attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| High-level concept retrieval | Based on topic keywords, match the global relationship chain in the full map to deal with cross-document macro problems. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Vector semantic retrieval | Query embedding for semantic similarity matching in document block/entity/relationship vector space | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 query modes | Local / Global / Hybrid / Naive / Mix (default, triple fusion is the most comprehensive) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mixed search fusion | map result vector result unselected result is obtained in parallel, asyncio.gather concurrent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Reranker enhancement | Cohere, Jina, and Alibaba Cloud Reranker reorder the fusion results | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Streaming response | Supports SSE streaming output to reduce user-perceived latency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Context length control | MAX_ENTITY_TOKENS / MAX_RELATION_TOKENS / MAX_TOTAL_TOKENS independent control | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LLM Result Cache | Same Query, Same Mode, Same Parameters → Cache Hits to Reduce the Cost of Repeated Queries |
5.3 deployment and operation and maintenance
| PyPI installation | 'pip install lightrag-hku[api]'One-click installation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Docker Compose | Official docker-compose.yml, one-click start after configuring. env | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| K8s Helm | Complete Helm Chart in k8s-deploy/directory, supporting enterprise K8s cluster deployment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| systemd Services | lightrag.service.example,Linux native service management | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Railway one-click deployment | Community template, Railway platform one-click online | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Setup Wizard | 'make env-base/'make env-storage/'make env-server interactive configuration wizard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Security Authentication | API Key Authentication JWT Multi-Account Authentication (TOKEN_SECRET AUTH_ACCOUNTS) CORS SSL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Offline deployment | Docker offline build solution for complete offline dependency list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GHCR signature mirror | Official mirror Sigstore Cosign signature to verify supply chain security | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Security Check | 'make env-security-check audits current. env security risks |
5.4 observability
| RAGAS evaluation | Standard RAG evaluation metrics such as context accuracy, fidelity, and answer relevance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Langfuse Tracing | LLM calls full-link tracing to analyze token consumption and latency bottlenecks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Query logs | API returns retrieval context for regression analysis and evaluation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Runtime configuration | Environment variable driven, you can adjust most query parameters without restarting |
5.5 storage back-end matrix
| Storage Type | Available Backends by Recommendation | Default Selection |
|---|---|---|
| KV storage | PostgreSQL / MongoDB / Redis / JSON file | JSON file (development)/ PostgreSQL (production) |
| Vector Storage | PostgreSQL (pgvector) / Milvus / Qdrant / MongoDB / Faiss / Chroma / Redis / NanoVectorDB | NanoVectorDB (development)/ PostgreSQL (production) |
| Map Storage | Neo4j / PostgreSQL (AGE/RCTE) / MongoDB / Memgraph / NetworkX | NetworkX (Development)/ Neo4j (Production) |
| Document status | PostgreSQL / MongoDB / Redis / JSON file | JSON file (development)/ PostgreSQL (production) |
6. Architecture/deployment/integration approach
6.1 Deployment Mode Overview
| Mode | Command/Mode | Applicable Scenarios |
|---|---|---|
| Python SDK | 'pip install lightrag-hku | Embedded application, academic research, script batch processing |
| REST API Server | 'pip install "lightrag-hku[api]" '→' lightrag-server ' | Team collaboration, front-end and back-end separation, microservice architecture |
| Docker Compose | 'Docker compose up' (including services such as PostgreSQL and Neo4j) | Single-machine production deployment and fast PoC |
| Docker Compose Full | 'Docker compose-f docker-compose-full.yml up' | One-stop deployment of full storage backend |
| Kubernetes | 'helm install lightrag ./k8s-deploy/' | Enterprise cluster deployment and high availability |
| Railway Platform | One-click Deployment of Community Templates | Overseas Fast Online, Zero Operation and Maintenance |
| systemd | 'lightrag.service.example' Configure system services | Native Linux Server Management |
| Offline deployment | Pre-installed dependency model cache | Air gap environment/intranet environment |
Recommended Architecture for 6.2 Production Environments
┌─────────────┐
│ 用户 / 前端 │
└──────┬───────┘
│
▼
┌───────────────────────────────┐
│ LightRAG API Server │
│ • REST API + WebUI │
│ • JWT / API Key 认证 │
│ • 端口: 9621 (默认) │
│ • lightrag-server │
└───┬───────┬───────┬───────────┘
│ │ │
┌─────────┘ ┌────┘ └─────────┐
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────────────┐
│ 图谱存储 │ │ 向量存储 │ │ KV + 文档状态存储 │
│ • Neo4j │ │ • Milvus │ │ • PostgreSQL │
│ 或 PG AGE │ │ 或 Qdrant│ │ 或 MongoDB │
└────────────┘ └────────────┘ └────────────────────┘
│ │ │
└────────────┴──────────────────────┘
│
▼
┌────────────────────────┐
│ LLM 服务(外部/本地) │
│ • OpenAI / Azure │
│ • Ollama (本地) │
│ • Anthropic / Bedrock │
│ • Gemini │
└────────────────────────┘
6.3 Supported LLM Providers (20)
| Category | Provider |
|---|---|
| Business Cloud | OpenAI, Azure OpenAI, Anthropic (Claude), Google Gemini, AWS Bedrock, Mistral, Cohere |
| Compatible Interface | OpenAI-compatible API (accessible to any compatible endpoint such as General Definition Thousand Questions/DeepSeek/Kimi) |
| Local Deployment | Ollama (open source models such as Qwen, Llama, and DeepSeek), HuggingFace |
| VLM | Character separation configuration with multimodal visual language model support |
6.4 storage backend configuration example
PostgreSQL full-stack storage (unified solution recommended):
# .env 关键配置
LIGHTRAG_KV_STORAGE=PGKVStorage
LIGHTRAG_VECTOR_STORAGE=PGVectorStorage
LIGHTRAG_GRAPH_STORAGE=PGGraphStorage
LIGHTRAG_DOC_STATUS_STORAGE=PGDocStatusStorage
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=lightrag
POSTGRES_PASSWORD=your_password
POSTGRES_DATABASE=lightrag
# pgvector 索引优化
POSTGRES_VECTOR_INDEX_TYPE=HNSW
POSTGRES_HNSW_M=16
POSTGRES_HNSW_EF=200
Neo4j Map Milvus Vector (Professional Separation Protocol):
LIGHTRAG_GRAPH_STORAGE=Neo4JStorage
LIGHTRAG_VECTOR_STORAGE=MilvusVectorDBStorage
NEO4J_URI=neo4j+s://xxxxxxxx.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password
MILVUS_URI=http://localhost:19530
MILVUS_TOKEN=root:Milvus
How to use #7.
7.1 Minimum Available Sample (Python SDK)
import asyncio
import os
from lightrag import LightRAG, QueryParam
from lightrag.llm.openai import gpt_4o_mini_complete, openai_embed
from lightrag.utils import setup_logger
setup_logger("lightrag", level="INFO")
WORKING_DIR = "./rag_storage"
async def main():
# 初始化 LightRAG
rag = LightRAG(
working_dir=WORKING_DIR,
embedding_func=openai_embed,
llm_model_func=gpt_4o_mini_complete,
)
await rag.initialize_storages()
# 插入文档(支持文本、文件路径、或直接调用 ainsert)
with open("./contracts/supply_agreement.txt", "r", encoding="utf-8") as f:
await rag.ainsert(f.read())
# 多模式查询
# Local 模式:精准实体查询
result = await rag.aquery(
"合同中的违约金条款如何规定?",
param=QueryParam(mode="local")
)
print(f"[Local] {result}")
# Global 模式:宏观主题理解
result = await rag.aquery(
"这份合同的整体风险评估如何?",
param=QueryParam(mode="global")
)
print(f"[Global] {result}")
# Mix 模式(推荐):图谱 + 向量 + 文本三重融合
result = await rag.aquery(
"双方的付款义务和交付义务之间有什么关系?",
param=QueryParam(mode="mix")
)
print(f"[Mix] {result}")
if __name__ == "__main__":
asyncio.run(main())
7.2 REST API Docker Compose deployment (recommended production scenario)
# 1. 克隆并配置
git clone https://github.com/HKUDS/LightRAG.git
cd LightRAG
# 2. 使用交互式向导配置
make env-base # 配置 LLM + embedding
make env-storage # 配置存储后端(PostgreSQL / Neo4j 等)
make env-server # 配置端口、认证、SSL
# 3. 启动服务
docker compose -f docker-compose-full.yml up -d
# 4. 上传文档
curl -X POST http://localhost:9621/documents/upload \
-H "X-API-Key: your-api-key" \
-F "file=@contract.pdf"
# 5. 查询
curl -X POST http://localhost:9621/query \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"query": "双方的权利义务有哪些?", "mode": "mix"}'
7.3 Ollama local deployment (zero API cost)
# 配置 .env
LLM_BINDING=ollama
LLM_MODEL=qwen2.5:14b
LLM_BINDING_HOST=http://localhost:11434
EMBEDDING_BINDING=ollama
EMBEDDING_MODEL=bge-m3:latest
EMBEDDING_BINDING_HOST=http://localhost:11434
# 启动
docker compose up -d8. What can I say before sales
8.1 a sentence positioning
- * "LightRAG is the practical answer to the GraphRAG route-retaining the overall understanding advantage of the knowledge map, but reducing the cost to 1/100 of the GraphRAG, increasing the speed by 100 times, and it is the 37K Stars open source project of the top EMNLP paper of HKU and the best map RAG in Chinese ecology. "**
8.2 customer pain points → solutions
| Customer pain points | LightRAG solutions |
|---|---|
| "We use traditional RAG, but we always fragment when answering cross-document questions" | Knowledge Graph models entity relationships, and cross-document answers are automatically associated at the retrieval stage instead of LLM guessing. |
| "I want to make map RAG, but the GraphRAG is too expensive" | excluding community clustering, the index Token is reduced by 95%, and the query Token is reduced by 6,000 times |
| "GraphRAG to rebuild index every time a new document is added" | Native incremental update-local graph directly merged into global graph |
| "We are mainly Chinese documents, GraphRAG Chinese support is not good" | Chinese README, Chinese community, Qwen model special optimization, entity extraction for Chinese text tuning |
| "RAG has been done but I don't know how to evaluate the effect" | Built-in RAGAS evaluation + Langfuse tracking, the query effect can be quantified |
| "Graph construction results are invisible and intangible" | WebUI knowledge graph visualization-force-directed graph, node query, subgraph filtering, can export HTML |
| "Our team does not have a dedicated GPU server" | Support Ollama local CPU inference + hybrid cloud (local embedding + cloud LLM) |
| "Need to connect with our existing Neo4j/PostgreSQL infrastructure" | 10 + storage backend, which can be smoothly integrated with existing databases without binding new infrastructure |
| "Security and compliance requirements are high, and you cannot go outside the network" | Complete offline deployment scheme + JWT authentication + SSL + non-root container operation |
8.3 Differentiated Selling Points
vs Microsoft GraphRAG (core competition):
| Dimension | LightRAG Advantage |
|---|---|
| Cost | GraphRAG 1 million-word index $11~76(GPT-4-Turbo),LightRAG 70-95% reduction |
| Speed | GraphRAG global query needs to traverse 610 community summaries, LightRAG direct graph traversal, 100 times faster |
| Update | GraphRAG does not support incremental updates, LightRAG native support |
| Ecology | GraphRAG only OpenAI,LightRAG supports 20 + LLM providers (including domestic models) |
| Chinese | GraphRAG without Chinese optimization, LightRAG Chinese is preferred |
| Production | GraphRAG without WebUI/authentication/K8s,LightRAG full production deployment scheme |
| Approved by the top meeting | GraphRAG only arXiv technical report, LightRAG officially accepted by EMNLP 2025 |
| Community | 7.5K vs 37K Stars, 5x difference |
vs Legacy RAG(LlamaIndex / Haystack / LangChain):
-LightRAG is not a replacement for traditional RAG, but an upgrade scheme when traditional RAG fails
-Traditional RAG processing is not good, cross-document relationship reasoning → LightRAG knowledge map is a natural solution
-LightRAG still has built-in vector retrieval (Naive/Mix mode), traditional RAG capabilities are fully retained
vs domestic map RAG products:
-HKU academic products (EMNLP 2025), more solid theoretical foundation than pure engineering products
-37K Stars Worldwide Validated, Non-Closed Source Locked
-MIT protocol, customers can be arbitrary secondary development
Summary of comprehensive differentiation:
GraphRAG are more "academic", more expensive and slower; LightRAG are more "pragmatic", faster, cheaper and easier to deploy. Core difference: LightRAG replaces the GraphRAG community clustering with a two-tier search-which works equally or even better in most scenarios, but at a cost of 1/100.
8.4 Customer Value Story Line
- Cut to the pain point :"When your RAG system deals with cross-document problems, does it often only find fragments and cannot connect points into faces?"
- Point out the root cause :"Because traditional RAG only do' similarity matching'-Paragraph 3 of Document A and Paragraph 7 of Document B both talk about a company, but the system does not know that there is an investment relationship between them."
- Introduction of Graph :"Knowledge Graph is not only about similarity, but also about relationships. -LightRAG automatically extract entities and relationships at the indexing stage, connecting scattered points into a network."
- Eliminate worries :"But GraphRAG is too expensive? LightRAG removed the community clustering and replaced it with double-level search-the cost was reduced by more than 95%, but the effect was not reduced."
- Show Empirical :"EMNLP 2025 top papers, surpassing GraphRAG in the four fields of agriculture/computer/law/mixed. 37K Stars open source community."
- Demo landing :Docker one-click start → WebUI upload document → visual map → multi-mode query comparison → RAGAS evaluation index
- End heavy :"MIT agreement, all open source. You can run in your own data center, with Qwen + Ollama zero API cost."
9. Frequently Asked Customer Questions
| Question | Answer |
|---|---|
| What is the difference between LightRAG and GraphRAG? | The core difference is that GraphRAG use the Leiden algorithm to make community clustering + community summary reports, while LightRAG use double-layer search (low-level entity + high-level topic) to search directly on the graph. This design difference leads to a 70-95% reduction in LightRAG index costs, a ~ 6,000-fold reduction in query tokens, and native support for incremental updates. On most question-and-answer tasks, the two are comparable; LightRAG are even better in the Comprehensiveness and Diversity dimensions. |
| Is LightRAG really better than GraphRAG? | According to EMNLP 2025 papers, the four fields of agriculture/CS/Legal/Mix are compared: Comprehensiveness win rate 54.4-51.6, Diversity win rate 59.2-77.2, Empowerment win rate 54.8-58.8, and Overall win rate 51.6-54.8. Comprehensiveness up to a 83.6 percent win in the Legal field. The overall LightRAG is slightly better, and the cost is much lower. However, note that GraphRAG community summaries have unique advantages in the "Generate an overview report for the entire corpus" scenario. |
| Which LLMs are supported? Can I use a domestic model? | 20 + providers are supported: OpenAI, Azure OpenAI, Anthropic, Gemini, Bedrock, Ollama, etc. Any OpenAI API-compatible service (such as Qiwen, DeepSeek, Kimi, and Moonshot) can be directly accessed through LLM_BINDING = openai + custom LLM_BINDING_HOST. Ollama supports all local models (Qwen/Llama/DeepSeek, etc.). The team optimized the accuracy of knowledge map extraction specifically for Qwen3-30B. |
| How can data security be guaranteed? Can privatization be deployed? | Fully supports privatization deployment. Method 1:Docker Compose runs on the customer's own server; Method 2:K8s Helm Chart is deployed to the customer cluster; Method 3: Complete offline deployment solution (pre-installed dependency + model cache), suitable for air gap environment. JWT + API Key dual authentication, non-root container running. All data is stored in the customer's own PostgreSQL / Neo4j/MongoDB. |
| What hardware is required for knowledge graph construction? | LLM is required to extract entity relationships in the index phase. We recommend that you use a model with at least 30B parameters to support GPU acceleration. If there is no GPU, cloud APIs (such as Qwen-Plus, etc.) can be used for indexing, and the cost is very low. The query phase can use smaller models (such as 7B), and Ollama CPU inference can also run. Recommended configurations: Cloud LLM for indexing (fast + high quality) and local model for query (low cost + low latency). |
| Can I integrate with existing Neo4j/PostgreSQL? | Yes. LightRAG supports 10 + storage backends, each storage type can be configured separately. For example, the map uses the existing Neo4j cluster (LIGHTRAG_GRAPH_STORAGE = Neo4JStorage'), the vector uses the existing Milvus (LIGHTRAG_VECTOR_STORAGE = MilvusVectorDBStorage'), and the KV uses the existing Redis. There is no need to build a new database separately for LightRAG. |
| How much data can be processed? | October 2025 has eliminated processing bottlenecks and supported large-scale datasets. Configure concurrent parameters such as MAX_PARALLEL_INSERT, MAX_ASYNC_LLM, and EMBEDDING_BATCH_NUM to efficiently process large amounts of documents. Production cases are deployed to handle tens of thousands of legal documents and patent literature. |
| Is the learning cost high? How long does it take to go from zero to PoC? ** | Docker Compose version: modify the three configurations of. env (LLM provider + API key),'docker compose up' can run. From zero to demonstrable PoC: 2-4 hours for engineers familiar with Docker. If you are already familiar with the RAG concept, you can complete the whole process from deployment to customized query in half a day. |
| What LightRAG the team stops maintenance? | Very unlikely. With 8,594 submissions and 37K Stars, the project is the most active map RAG project on GitHub. May 2026 is still releasing blockbuster features (RAG-Anything merge, role separation LLM, 4 chunking strategies). The MIT protocol means that even if the team is disbanded, the code is fully available and Fork. The CS Department of HKU is supported by continuous academic output (the same team has also released ecological projects such as MiniRAG and VideoRAG). |
10. PoC Recommendations
Recommended PoC Direction: Enterprise Document Knowledge Graph Question Answering System
| Stage | Content | Time | Output | Validation metrics |
|---|---|---|---|---|
| 1. Build the environment | Deploy Docker Compose (including PostgreSQL), configure LLM and embedding | 0.5 days | LightRAG services in operation | Service health check passed |
| 2. data preparation | select 50-100 typical business documents (contracts, regulations, manuals, reports), preprocess format | 0.5 days | document collection after cleaning | documents can be correctly processed by the parser |
| 3. Knowledge Base Index | Import documents in batches, build knowledge graphs and vector indexes, and tune concurrency parameters | 1 day | Queried Knowledge Base + Visual Graph | Entity Extraction Coverage> 80% |
| 4. Query validation ** | Design 20-30 typical business problems (covering simple/cross-document/inference) and test them in 5 modes for | 1 day | Query result comparison matrix | Relevance meets business expectations |
| 5. effect tuning | configure Reranker, adjust Token limit, optimize prompt words, set citation function | 0.5 days | optimized system configuration | end-to-end answer accuracy> 85% |
| 6. Assessment report | RAGAS automated assessment + manual assessment comparison, output PoC assessment report | 0.5 days | Assessment report | Comprehensive score> expected baseline |
| 7. Demonstration Preparation | WebUI Configuration, Graph Visualization Demonstration, Multi-mode Query Comparison Demonstration | 0.5 Days | Complete System for External Demonstration | Stakeholder Acceptance Passed |
Total: Approximately 4.5 person-days (1 engineer)
Key validation metrics:
-Entity extraction coverage> 80% (identification of business terms and core concepts)
-End-to-end accuracy of cross-document reasoning problems> 75%
-Mix mode vs Naive mode is improved by> 15% (proving the value of map)
-Average query latency <5 seconds (including LLM generation time)
-Incremental update: after adding 10 new documents, the new content can be retrieved without rebuilding the index.
11. Risks and Considerations
| Risk | Level | Description | Mitigation |
|---|---|---|---|
| LLM Dependency | High | Entity relationship extraction and query both rely on LLM, and the quality of the model directly affects the effect; The extraction phase requires a high level of LLM capability | Models using ≥ 30B parameters (recommended GPT-4o or Qwen-Plus level); MiniRAG alternatives are available for small models |
| Index Time-consuming | Medium | The first index of large-scale documents still needs time (each document requires LLM to extract entity relationships) | Configure concurrency parameters (MAX_PARALLEL_INSERT = 2-4); Phased index instead of one-time full volume; Use faster LLM (if gpt-4o-mini) |
| English corpus extraction is better than Chinese | Chinese | paper evaluation is mainly in English, and the accuracy of Chinese entity relationship extraction may be slightly lower | Qwen model has special optimization; SUMMARY_LANGUAGE = Chinese configuration; Customizable entity type Prompt |
| Weak Community Level Summary | Medium | The ability to generate "Global Overview Report" without Leiden clustering community summary is weaker than GraphRAG | Use Global/Mix mode LLM post-summary to simulate; Or use complementary use with GraphRAG |
| Storage back-end selection complexity | Low | 10 Storage back-end gives users the choice, but also increases the decision cost | Default file storage is enough PoC; Production recommends PostgreSQL full-stack unified solution; Documentation provides clear storage selection guidelines |
| v1.x API may change | Low | The project is in a fast iteration period (v1.x), and the API may have Breaking Change | Using REST API instead of SDK can reduce coupling; Focus on Release Notes; Lock version in production environment |
| Model illusion transfer | In | LLM extracted entities/relationships may be incorrect, and the wrong map leads to retrieval bias | Enable Reranker mitigation; Manual review of the extraction quality of entities in key areas; Configuration ENTITY_EXTRACTION_USE_JSON = true to improve stability |
| Offline deployment complexity | Low | Offline/air gap environment requires pre-installation of all dependencies and model caches, which takes a long time to prepare | Operate according to offline deployment documentation; Dockerfile offline build support is included |
12. My Pre-Sales Judgment
- Recommendation: Highly recommended * (★★★★★)
- * In a word, LightRAG is the pragmatic first choice for the current map RAG route-it has turned GraphRAG core pain point of "too expensive and too slow" into its own core selling point, while not losing GraphRAG in effect.**
Reason for recommendation
- Solve the real pain point :GraphRAG innovation but not available (expensive, slow, not incremental update),LightRAG is the only map RAG that reduces the cost by 1-2 orders of magnitude on the premise of equivalent effect.
- Solid academic endorsement : Hong Kong University produced, EMNLP 2025 will officially accept (non-arXiv preprint), the paper has strict experimental verification
- The open source community is strong :37K Stars (5 times as many as GraphRAG), 8,594 submissions, 95 Release, and the iteration speed is astonishingly fast.
- Production Ready :Docker Compose K8s JWT Certified Multi-Storage Backend RAGAS Evaluation Langfuse Tracking-This is commonly missing in other graph RAG projects
- Chinese ecology is the best : three-language README, Qwen special optimization, active Chinese community, domestic LLM friendly-the threshold for landing in China is much lower than GraphRAG
- Ecological integrity : not only LightRAG, but also RAG-Anything (multimodal), VideoRAG (video) and MiniRAG (small model) to form a complete matrix.
Recommended Customer Portrait
-Enterprise Knowledge Base Upgrade: Customers who already have traditional RAG but have poor cross-document results are LightRAG upgraded naturally.
-Legal/Compliance/Financial Customers: Relational reasoning between documents is just needed, and the map is naturally adapted.
- Chinese-based enterprises :Qwen optimized Chinese document Chinese community, the most smooth landing in China
-Budget sensitive but requires map RAG: Don't want to pay for the high cost of GraphRAG
-Neo4j/PostgreSQL infrastructure: Directly reusable, zero new infrastructure
-Requires Privatization Deployment: Complete Offline Scheme K8s Certification
-Academic/Research Institution:MIT Protocol Python SDK Reproduction Experiment
Not recommended
- pure simple question and answer : if 90% of the questions are "what does this document say", the traditional RAG is enough, and the LightRAG knowledge map cost is not cost-effective
-Low-code platform required: The LightRAG WebUI is a manager tool rather than a low-code development platform. Dify / MaxKB is recommended.
-Community global summary report required: If the core requirement is to "generate a structured overview of the entire knowledge base", the GraphRAG community summary function is more direct
-No technical team: Although deployment is simple, tuning still requires some RAG engineering experience.
-Very small amount of data (< 10 documents): overhead of graph construction may exceed revenue
13. REFERENCE
Official Resources
-GitHub repository: https://github.com/HKUDS/LightRAG
-Thesis (arXiv):https://arxiv.org/abs/2410.05779
-Thesis (EMNLP 2025):https://preview.aclanthology.org/manual-author-scripts/2025.findings-emnlp. 568.pdf
-Discord Community: https://discord.gg/yF2MmDJyGJ
-PyPI package: https://pypi.org/project/lightrag-hku/
-Docker image: https://github.com/HKUDS/LightRAG/pkgs/container/lightrag
Ecological Project
-RAG-Anything (Multimodal RAG):https://github.com/HKUDS/RAG-Anything
-VideoRAG (video understanding):https://github.com/HKUDS/VideoRAG
-MiniRAG (small model optimization):https://github.com/HKUDS/MiniRAG
Technical Articles
-Neo4j Official Blog-In-depth Analysis of LightRAG Retrieval Mechanism: https://neo4j.com/blog/developer/under-the-covers-with-lightrag-retrieval/
-Complete guide to LearnOpenCV-LightRAG: https://learnopencv.com/lightrag
-DeepWiki-Database Implementation Details: https://deepwiki.com/lanarich/LightRAG/3.2-database-implementations
-Railway-LightRAG deployment template: https://railway.com/deploy/light-rag
-Overview of Lettria-LightRAG Technology: https://www.lettria.com/blogpost/what-is-lightrag-definition-core-approaches-and-examples
Competition Reference
-Microsoft GraphRAG:https://github.com/microsoft/graphrag
-E² GraphRAG (East China Normal University):https://arxiv.org/abs/2505.24226
-GraphRAG-Bench (benchmark):https://arxiv.org/abs/2506.02404
- Analysis Date: 2026-07-02 | Data Aging: GitHub Real-Time Pull (37,212 Stars / 5,244 Forks / 8,594 Commits / 95 Tags), Product Features Based on v1.5.x Series Official Documents *