← Back to Project List
LightRAG is the open source lightweight atlas RAG framework (MIT protocol, 37,200 + stars, 5,244 forks) of the data science laboratory (HKUDS) of the university of hong kong. the paper was published in EMNLP 2025 and is the most iterative and community-hot project in the GraphRAG route. The core innovation lies in replacing the GraphRAG community hierarchical clustering with double-layer retrieval (low-level entity + high-level topic), reducing the consumption of query Token by about 6,000 times and the index cost by more than 70% while maintaining the advantage of global understanding of the map. Provides 10 + storage backends such as WebUI, Docker Compose / K8s deployment, PostgreSQL / Neo4j / MongoDB/OpenSearch, and supports 20 + LLM providers, RAGAS evaluation, Langfuse tracking, and multi-modal document parsing. It's cheaper, faster, more Chinese-friendly than GraphRAG, and has an out-of-the-box production deployment solution.

1. Project/Product Overview

DimensionInformation
Project nameLightRAG
DeveloperUniversity of Hong Kong Data Science Lab (HKUDS)
AuthorZirui Guo, Lianghao Xia, Yanhua Yu, Tu Ao, Chao Huang (HKU × Beiyou)
Open Source LicenseMIT
Main languagePython(≥ 3.10)
GitHub Stars37,212(2026-07-02)
Forks5,244
Commits8,594 (daily average 10 submissions, extremely fast iteration)
Tags / Releases95
Open Issues217
Created2024-10-02 (37K Stars in only one and a half years)
Last Updated2026-07-01 (almost daily active)
PaperEMNLP 2025 Findings (Top Meeting)
official websitehttps://github.com/HKUDS/LightRAG
PyPI Package'lightrag-hku(latest v1.5.x)
Docker image'ghcr.io/hkuds/lightrag:latest' (signed Sigstore Cosign)
Chinese language supportREADME_zh.md README-ja.md Chinese community active
Ecological ProjectsRAG-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:

  1. Document segmentation → LLM extraction of entities and relationships → construction of knowledge graph (node = entity, edge = relationship)
  2. At the same time, the vector embedding of entities/relationships is generated and stored in the vector database.
  3. Generate low-level keys (entity name index) and high-level keys (topic keyword index)
  4. Incremental merging of new documents: local maps are directly integrated into the global map through collection merging without reconstruction.

Retrieval phase process:

  1. User query → LLM extraction of double-layer keywords (high-level = topic concept, low-level = specific entity)
  2. Low-level retrieval: locate entity nodes in the knowledge graph → traverse neighbor subgraphs → obtain relevant relationships and attributes.
  3. High-level retrieval: using topic keywords → matching global concept chains in the map → obtaining macro information across documents
  4. Vector retrieval: original query embedding-semantic similarity matching text block.
  5. Three-level result fusion → LLM generates final answer (with citation source)

2.2 LightRAG vs GraphRAG Core Comparison

Comparison dimensionGraphRAG (Microsoft)LightRAG (HKU)
Architecture IdeasPure Map + Leiden Community Clustering + Hierarchical SummaryKnowledge 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 updateNot supported (new documents need to rebuild community hierarchy)Native support -- Local map merge directly
Document deletionNot supported (requires full rebuild)Supported -- Automatically partially rebuild affected entities
Search ModeLocal / GlobalFive -- Local / Global / Hybrid / Naive / Mix
WebUINoneThere -- Knowledge Graph Visualization + Document Management + Query Interface
MultimodalLimitedIntegrated RAG-Anything(MinerU / Docling, PDF/Image/Table/Formula support)
RerankerNo built-inSupport -- Cohere, Jina, and Alibaba Cloud, greatly improving the quality of mixed queries
Assessment/TrackingNo built-inIntegrated RAGAS Assessment + Langfuse Tracking
LLM ProviderOpenAI20 + -- OpenAI / Azure / Anthropic / Gemini / Bedrock / Ollama
Knowledge Graph StorageLocal Files10 + Backend -- NetworkX / Neo4j / PostgreSQL / MongoDB / Memgraph / OpenSearch
Vector StorageLocal10 + Backend -- NanoVectorDB / Milvus / Qdrant / Faiss / PostgreSQL / MongoDB / Redis / Chroma
Production deploymentBasic scriptDocker Compose + K8s Helm + systemd + Railway-click deployment
Authentication SecurityNo built-inAPI Key + JWT + CORS + SSL
Paper Published arXiv Technical ReportEMNLP 2025 (officially accepted at the top meeting)
Chinese supportNoneREADME 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

ScenariosDescriptionsWhy LightRAG are suitableTypical customer types
Enterprise Knowledge Base Q & ANatural Language Q & A of a large number of internal documents, product manuals, and policy documentsThe graph structure captures implicit relationships between documents, and the answers need to be integrated across documents; WebUI lowers the use thresholdKnowledge Management/IT Department of Medium and Large Enterprises
Legal/Compliance Document AnalysisContract Comparison, Case Correlation, Impact Analysis of Regulatory ChangesRelationship Map is naturally suitable for retrospective clause reference chain and cross-document legal reasoningLaw Firm, Corporate Legal Department, Compliance Team
Scientific research literature analysisKnowledge network construction and panoramic query of papers, patents, and experimental reportsExtract complex relationships between scholars/institutions/technologies/methods to support multi-hop reasoning across domainsUniversities, research institutes, and pharmaceutical companies.
Financial Intelligence AnalysisCompany/Executive/Market Correlation Inquiry, Regulatory Change Impact AssessmentAutomatic Correlation of Inter-Entity Investment/Competition/Supply Chain Relationships, Suitable for Financial Knowledge Mapping ScenariosInvestment Banking, Asset Management, Wind Control Departments
Operation and Maintenance Manual/Equipment DocumentationIntelligent Q & A for Complex Equipment Maintenance Manual and Operation ProcessMap Accurate Matching Failure Phenomena → Parts → Correlation of Maintenance StepsManufacturing, Energy and Airlines
Chinese-first scenariosNeed Chinese model optimization and Chinese community supportQwen series has made special optimization for LightRAG; Chinese README + CommunityDomestic Enterprises and Government Organizations
Budget-sensitive scenarios Hope to use atlas RAG but the GraphRAG cost is too highToken consumption is reduced by 95% +, Ollama local model is supported, and API cost is almost 0Small and medium-sized enterprises and start-up companies
Dynamically update the knowledge baseDocuments 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

ScenarioReasonAlternative Suggestions
Single document simple question and answerGraph construction has additional overhead, simple scenarios do not require relational modelingTraditional RAG (such as LlamaIndex, RAGFlow) is sufficient
Real-time stream data processingThe indexing phase requires LLM to extract entity relationships, which is not suitable for real-time scenarios at the millisecond levelTraditional vector retrieval stream processing framework
Local deployment of low GPU resourcesBoth entity extraction and query require LLM with parameters no less than 30B, and local operation is slow without GPUMiniRAG (produced by the same team, small model optimized version)
No need for relational reasoningIf all the questions are "what does this document say", the additional cost of the map does not pay offNaive RAG or Dify low-code solutions.
Completely Low Code RequirementsAlthough LightRAG has WebUI, configuration and tuning still require technical background (.env configuration, storage backend selection, etc.)Dify / Coze / MaxKB
Community level summary is just neededLightRAG 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 ScenarioIf you already have a Cypher query on the Neo4j graph database, you do not need to LightRAG build a graph from the textYou can directly use the graph database to query the LLM

5. Core Competence List

5.1 Indexing and Knowledge Building

Automatic entity extractionLLM recognizes entity name, type and description from documents, supports JSON format output (more stable)
Automatic relationship extractionLLM identifies semantic relationships between entities (cause and effect, inclusion, contrast, etc.)
Four chunked strategiesFix / Recursive / Vector / Paragraph, can be combined
Multiple parsing enginesNative / MinerU / Docling three document parsing engines, supporting 15 formats such as PDF, Word, and Excel
Multimodal IndexTable Understanding, Formula Extraction, Picture Analysis (VLM), Unified Index of Cross-modal Entity Relationships
Incremental updateThe local map of the new document is directly integrated into the global map, and the collection merge algorithm.
Document deletion and reconstructionLocal reconstruction of the affected subgraph using the LLM cache
File Processing ConcurrencyMAX_PARALLEL_INSERT / MAX_ASYNC_LLM / EMBEDDING_BATCH_NUM Multidimensional Concurrency Configuration
Citation TrackingRecords 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 extractionLLM simultaneously extracts high-level topic keywords and low-level entity keywords from user queries
Knowledge Graph TraversalLocating Entities Based on Low-Level Keywords → Neighbor Subgraph Traversal → Obtaining Related Relationships and Attributes
High-level concept retrievalBased on topic keywords, match the global relationship chain in the full map to deal with cross-document macro problems.
Vector semantic retrievalQuery embedding for semantic similarity matching in document block/entity/relationship vector space
5 query modesLocal / Global / Hybrid / Naive / Mix (default, triple fusion is the most comprehensive)
mixed search fusionmap result vector result unselected result is obtained in parallel, asyncio.gather concurrent
Reranker enhancementCohere, Jina, and Alibaba Cloud Reranker reorder the fusion results
Streaming responseSupports SSE streaming output to reduce user-perceived latency
Context length controlMAX_ENTITY_TOKENS / MAX_RELATION_TOKENS / MAX_TOTAL_TOKENS independent control
LLM Result CacheSame 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 ComposeOfficial docker-compose.yml, one-click start after configuring. env
K8s HelmComplete Helm Chart in k8s-deploy/directory, supporting enterprise K8s cluster deployment
systemd Serviceslightrag.service.example,Linux native service management
Railway one-click deploymentCommunity template, Railway platform one-click online
Setup Wizard'make env-base/'make env-storage/'make env-server interactive configuration wizard
Security AuthenticationAPI Key Authentication JWT Multi-Account Authentication (TOKEN_SECRET AUTH_ACCOUNTS) CORS SSL
Offline deploymentDocker offline build solution for complete offline dependency list
GHCR signature mirrorOfficial mirror Sigstore Cosign signature to verify supply chain security
Security Check'make env-security-check audits current. env security risks

5.4 observability

RAGAS evaluationStandard RAG evaluation metrics such as context accuracy, fidelity, and answer relevance
Langfuse TracingLLM calls full-link tracing to analyze token consumption and latency bottlenecks
Query logsAPI returns retrieval context for regression analysis and evaluation
Runtime configurationEnvironment variable driven, you can adjust most query parameters without restarting

5.5 storage back-end matrix

Storage TypeAvailable Backends by RecommendationDefault Selection
KV storagePostgreSQL / MongoDB / Redis / JSON fileJSON file (development)/ PostgreSQL (production)
Vector StoragePostgreSQL (pgvector) / Milvus / Qdrant / MongoDB / Faiss / Chroma / Redis / NanoVectorDBNanoVectorDB (development)/ PostgreSQL (production)
Map StorageNeo4j / PostgreSQL (AGE/RCTE) / MongoDB / Memgraph / NetworkXNetworkX (Development)/ Neo4j (Production)
Document statusPostgreSQL / MongoDB / Redis / JSON fileJSON file (development)/ PostgreSQL (production)

6. Architecture/deployment/integration approach

6.1 Deployment Mode Overview

ModeCommand/ModeApplicable Scenarios
Python SDK'pip install lightrag-hkuEmbedded 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 PlatformOne-click Deployment of Community TemplatesOverseas Fast Online, Zero Operation and Maintenance
systemd'lightrag.service.example' Configure system servicesNative Linux Server Management
Offline deploymentPre-installed dependency model cacheAir 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)

CategoryProvider
Business CloudOpenAI, Azure OpenAI, Anthropic (Claude), Google Gemini, AWS Bedrock, Mistral, Cohere
Compatible InterfaceOpenAI-compatible API (accessible to any compatible endpoint such as General Definition Thousand Questions/DeepSeek/Kimi)
Local DeploymentOllama (open source models such as Qwen, Llama, and DeepSeek), HuggingFace
VLMCharacter 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 -d

8. 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 pointsLightRAG 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):

DimensionLightRAG 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
UpdateGraphRAG does not support incremental updates, LightRAG native support
EcologyGraphRAG only OpenAI,LightRAG supports 20 + LLM providers (including domestic models)
ChineseGraphRAG without Chinese optimization, LightRAG Chinese is preferred
Production GraphRAG without WebUI/authentication/K8s,LightRAG full production deployment scheme
Approved by the top meetingGraphRAG only arXiv technical report, LightRAG officially accepted by EMNLP 2025
Community7.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

  1. 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?"
  2. 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."
  3. 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."
  4. 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."
  5. Show Empirical :"EMNLP 2025 top papers, surpassing GraphRAG in the four fields of agriculture/computer/law/mixed. 37K Stars open source community."
  6. Demo landing :Docker one-click start → WebUI upload document → visual map → multi-mode query comparison → RAGAS evaluation index
  7. 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

QuestionAnswer
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

StageContentTimeOutputValidation metrics
1. Build the environmentDeploy Docker Compose (including PostgreSQL), configure LLM and embedding0.5 daysLightRAG services in operationService health check passed
2. data preparationselect 50-100 typical business documents (contracts, regulations, manuals, reports), preprocess format0.5 daysdocument collection after cleaningdocuments can be correctly processed by the parser
3. Knowledge Base IndexImport documents in batches, build knowledge graphs and vector indexes, and tune concurrency parameters1 dayQueried Knowledge Base + Visual GraphEntity Extraction Coverage> 80%
4. Query validation **Design 20-30 typical business problems (covering simple/cross-document/inference) and test them in 5 modes for1 dayQuery result comparison matrixRelevance meets business expectations
5. effect tuning configure Reranker, adjust Token limit, optimize prompt words, set citation function0.5 daysoptimized system configurationend-to-end answer accuracy> 85%
6. Assessment reportRAGAS automated assessment + manual assessment comparison, output PoC assessment report0.5 daysAssessment reportComprehensive score> expected baseline
7. Demonstration Preparation WebUI Configuration, Graph Visualization Demonstration, Multi-mode Query Comparison Demonstration0.5 DaysComplete System for External DemonstrationStakeholder 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

RiskLevelDescriptionMitigation
LLM DependencyHighEntity 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 capabilityModels using ≥ 30B parameters (recommended GPT-4o or Qwen-Plus level); MiniRAG alternatives are available for small models
Index Time-consumingMediumThe 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 Chinesepaper evaluation is mainly in English, and the accuracy of Chinese entity relationship extraction may be slightly lowerQwen model has special optimization; SUMMARY_LANGUAGE = Chinese configuration; Customizable entity type Prompt
Weak Community Level SummaryMediumThe ability to generate "Global Overview Report" without Leiden clustering community summary is weaker than GraphRAGUse Global/Mix mode LLM post-summary to simulate; Or use complementary use with GraphRAG
Storage back-end selection complexityLow10 Storage back-end gives users the choice, but also increases the decision costDefault file storage is enough PoC; Production recommends PostgreSQL full-stack unified solution; Documentation provides clear storage selection guidelines
v1.x API may changeLowThe project is in a fast iteration period (v1.x), and the API may have Breaking ChangeUsing REST API instead of SDK can reduce coupling; Focus on Release Notes; Lock version in production environment
Model illusion transferInLLM extracted entities/relationships may be incorrect, and the wrong map leads to retrieval biasEnable Reranker mitigation; Manual review of the extraction quality of entities in key areas; Configuration ENTITY_EXTRACTION_USE_JSON = true to improve stability
Offline deployment complexityLowOffline/air gap environment requires pre-installation of all dependencies and model caches, which takes a long time to prepareOperate 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

  1. 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.
  1. Solid academic endorsement : Hong Kong University produced, EMNLP 2025 will officially accept (non-arXiv preprint), the paper has strict experimental verification
  1. 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.
  1. Production Ready :Docker Compose K8s JWT Certified Multi-Storage Backend RAGAS Evaluation Langfuse Tracking-This is commonly missing in other graph RAG projects
  1. 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
  1. 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 *