LightRAG is a retrieval-augmented generation framework developed by the HKU Data Science lab that fundamentally rethinks how documents are indexed and queried. Published at EMNLP 2025 with over 31,000 GitHub stars, it addresses a core limitation of traditional RAG systems: their reliance on flat vector representations that miss the relationships between entities. LightRAG solves this by building a knowledge graph during document ingestion, extracting entities and their relationships using LLMs, then combining graph-based traversal with vector similarity search for retrieval that understands how concepts connect to each other.
The framework offers five distinct query modes — naive for simple vector search, local and global for different graph traversal depths, hybrid combining both approaches, and mix for the most comprehensive results. Its incremental update system lets you add new documents without rebuilding the entire index, preserving existing graph connections while integrating fresh content. LightRAG supports a wide range of storage backends including PostgreSQL, MongoDB, Neo4j, Milvus, Qdrant, ChromaDB, and Faiss, making it adaptable to any production infrastructure. The built-in server provides an Ollama-compatible API and a web UI for document management, knowledge graph visualization, and interactive querying.
LightRAG has evolved into a broader ecosystem with RAG-Anything, a multimodal extension that processes PDFs, Office documents, images, tables, and mathematical formulas through a unified pipeline. The framework is model-agnostic, working with OpenAI, Anthropic, Google, Ollama, and other LLM providers, though it recommends 32B+ parameter models for optimal entity-relationship extraction. Docker deployment, Kubernetes configs, and Gunicorn multi-worker support make it production-ready, while its Python SDK with async support enables seamless integration into existing applications.