LightRAG

Active
GitHub Python MIT

Description

LightRAG is a simple and fast Retrieval-Augmented Generation framework using graph-enhanced retrieval, published at EMNLP 2025.

Key Features

  • Graph-enhanced retrieval — Dual-level retrieval (local/global) using knowledge graph entities and relationships, more precise than vector search
  • Four text chunking strategies — Fixed, Recursive, Vector, and Paragraph chunking adapted to different document types
  • Multi-backend storage — Neo4j, PostgreSQL, MongoDB, OpenSearch, JSON KV Store and other storage backends supported
  • Multimodal document processing — RAG-Anything integration for PDF, images, Office docs, tables, and formula parsing
  • Role-specific LLM configuration — Four independent roles (EXTRACT, QUERY, KEYWORDS, VLM) with separate LLM settings
  • WebUI visualization — Web interface for knowledge insertion, querying, and knowledge graph visualization

Use Cases

💡 Large-scale document knowledge base — Build knowledge graphs from tens of thousands of documents with dual-level retrieval
💡 Academic paper analysis — Extract methods, experiments, and conclusions to build domain knowledge graphs for literature review
💡 Enterprise knowledge management — Integrate internal docs, emails, and reports for cross-document relational queries via graph retrieval
💡 Multimodal RAG systems — Process PDFs with images, tables, and formulas for full-modality retrieval-augmented generation
💡 Intelligent QA systems — Combine graph and vector retrieval to answer complex relational questions

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (39.3k stars)
  • Permissive open-source license (MIT)
  • Responsive to issues, low backlog

Categories

Quick Start

```bash
pip install lightrag-hku

python -c "
import lightrag
from lightrag import LightRAG

rag = LightRAG(work_dir='./lightrag_work')
with open('input.txt', 'r') as f:
    text = f.read()
rag.ainsert(text)
result = rag.aquery('What is the main topic?')
print(result)
"
```

Related Projects

Haystack

26.4k · Python
Active A+

Haystack is an enterprise-grade framework for RAG and search applications, covering document processing, retrieval, generation, and evaluation end to end.

ragretrievalllm +1
  • · Modular pipeline architecture — compose retrieval, routing, memory, and generation components as DAGs with conditional branches and loops
  • · Model and vendor agnostic — swap OpenAI, Anthropic, Cohere, Hugging Face, AWS Bedrock, and local models without rewriting
  • · Context engineering control — explicit control over how information is retrieved, ranked, filtered, combined, and routed before reaching the model

MemAgent

1.1k · Python
Stale B

A MemAgent framework that can extrapolate to 3.5M context tokens, along with a training framework for RL training of any agent workflow.

memoryagentrag +2
  • · Ultra-Long Context Processing: Extrapolate from 8K training context to 3.5M tokens with performance loss under 5%
  • · Reinforcement Learning Driven: Trained with RLVR (Reinforcement Learning from Verifiable Rewards), extends DAPO algorithm for end-to-end multi-turn conversation optimization
  • · Linear Time Complexity: Breaks through computational bottlenecks in long-text processing with linear resource scaling

RAG Techniques

29.3k · Jupyter Notebook
Active A+

NirDiamant's RAG_Techniques repository systematically collects and demonstrates cutting-edge retrieval-augmented generation techniques and engineering practices.

ragretrievaltechniques +2
  • · Systematic taxonomy — techniques organised by simple / advanced / modular levels for targeted learning
  • · Runnable notebooks — every technique ships with a Jupyter notebook and minimal runnable code
  • · Evaluation & comparison — retrieval quality and answer quality evaluation scripts with visualisation

KAG

9.0k · Python
Stale B

KAG is a logical form-guided reasoning and retrieval framework based on OpenSPG engine and LLMs for building logical reasoning and factual Q&A solutions for professional domain knowledge bases, effectively overcoming the limitations of traditional RAG vector similarity models.

knowledge-graphragreasoning +2
  • · Bidirectional knowledge-text indexing: KG nodes cross-reference original text chunks for complete context preservation
  • · Logic form-guided hybrid reasoning: transforms natural language into formal logical inference combining exact match, text retrieval, numerical computation, and semantic reasoning
  • · Schema-constrained knowledge construction: supports both free-form information extraction and structured domain expert knowledge representation

Related Articles