LightRAG: Retrieval-augmented generation with knowledge graphs
Graph-based retrieval framework for structured RAG reasoning.
Learn more about LightRAG
LightRAG is a Python framework for retrieval-augmented generation that integrates knowledge graph structures into the retrieval process for enhanced contextual reasoning. The system constructs and maintains a graph-based index from ingested text documents, where entities and relationships are extracted and stored as nodes and edges within a working directory structure. During retrieval operations, the framework traverses this knowledge graph to identify semantically relevant information paths rather than relying solely on vector similarity search. The architecture combines traditional embedding-based retrieval with graph traversal algorithms to provide more structured and contextually coherent results for downstream language model generation tasks.
Graph-based retrieval
Uses extracted entities and relationships to construct a knowledge graph for retrieval, enabling structured queries that capture semantic relationships between concepts rather than relying on vector similarity alone.
Flexible storage backends
Supports multiple storage options including PostgreSQL and local storage, allowing deployment in different infrastructure contexts and enabling document deletion with graph regeneration.
Multimodal document processing
Integrates with RAG-Anything for handling diverse document formats including PDFs, images, tables, and equations, extending beyond text-only processing.
pip install lightrag-hkuRemoves deprecated chunk-based query methods; adds PDF decryption, Langfuse observability, RAGAS evaluation, and native Gemini LLM support.
- –Remove calls to deprecated chunk-based query methods before upgrading to avoid runtime errors.
- –Enable Langfuse integration or RAGAS evaluation framework to monitor and assess RAG pipeline quality.
Requires qdrant-client ≥1.11.0 for tenant indexing; large datasets will face significant migration time.
- –Upgrade qdrant-client to 1.11.0+ before deploying; Qdrant now uses payload-based multi-tenancy partitioning.
- –Install PyCryptodome if processing encrypted PDFs; entity deletion now cleans residual edges from vector DB.
Hotfix release bundles missing Swagger UI static files in the package and improves Gunicorn signal handling.
- –Update to v1.4.9.6 to fix missing swagger-docs static files that broke API documentation endpoints.
- –Gunicorn deployments now handle SIGTERM and SIGINT gracefully for cleaner shutdowns.
See how people are using LightRAG
Related Repositories
Discover similar tools and frameworks used by developers
yolov5
Real-time object detection with cross-platform deployment support.
unsloth
Memory-efficient Python library for accelerated LLM training.
stablediffusion
Text-to-image diffusion in compressed latent space.
ComfyUI-Manager
Graphical package manager for ComfyUI custom nodes.
streamlit
Python framework for reactive data web applications.