Lightweight graph-enhanced RAG framework combining knowledge graphs with vector retrieval for accurate, context-rich document question answering.
A lightweight system for AI-powered document search that uses knowledge graphs — finds accurate answers by understanding how concepts connect.
LightRAG is an open-source retrieval-augmented generation framework that combines the speed of vector search with the relationship understanding of knowledge graphs. Unlike heavyweight solutions like Microsoft's GraphRAG, LightRAG is designed to be lightweight and efficient while still capturing the entity relationships that make complex queries answerable.
The framework operates by extracting entities and relationships from documents during indexing, building a compact knowledge graph alongside traditional vector embeddings. During retrieval, it uses both graph traversal and vector similarity to find relevant context, producing answers that understand relationships between concepts — not just individual text chunks.
LightRAG supports three retrieval modes: naive (pure vector search), local (entity-focused graph search), and hybrid (combining both). The hybrid mode is the default and typically provides the best results, balancing the precision of vector search with the relationship awareness of graph retrieval.
Setup is remarkably simple — LightRAG can be running in under 10 lines of Python code. It supports multiple LLM providers for entity extraction and query processing, and multiple vector/graph storage backends including Neo4j, NetworkX, OpenSearch, and built-in lightweight stores.
The framework is particularly effective for document collections where relationships matter: legal contracts referencing other clauses, technical documentation with cross-references, research papers citing each other, or organizational knowledge bases where understanding 'who does what' is as important as individual facts.
LightRAG's efficiency makes it practical for local deployments and smaller teams. It can run with local LLMs for both indexing and querying, keeping costs near zero while providing graph-enhanced retrieval quality. The indexing cost is a fraction of heavier GraphRAG implementations.
The project was accepted as a paper at EMNLP 2025 and has gained rapid GitHub traction as a practical middle ground between simple vector RAG and full GraphRAG. Recent updates include OpenSearch as a unified storage backend and a setup wizard for easier onboarding.
Was this helpful?
Combines knowledge graph traversal with vector similarity search for context-rich answers that understand entity relationships, using a dual-level retrieval paradigm that operates at both specific and abstract levels.
Use Case:
Answering 'Which departments collaborate on compliance projects?' from organizational documents by traversing entity relationships rather than matching keywords.
Efficient LLM-based extraction of entities and relationships during indexing with lower compute cost than full GraphRAG — typically 2-3x source token count versus 5-10x for GraphRAG.
Use Case:
Indexing a 10,000-page technical documentation set with manageable LLM costs that a small team can afford.
Naive (vector-only), local (graph-focused), and hybrid (combined) modes let you trade off speed vs. relationship awareness depending on the query type.
Use Case:
Using hybrid mode for complex relational queries like 'how do these regulations interact?' and naive mode for simple factual lookups.
New documents can be added to the index without re-processing the entire collection, and the graph structure updates automatically with new entities and relationships.
Use Case:
Adding daily news articles to a knowledge base without re-indexing the full corpus each time.
Full support for local LLMs through Ollama for both entity extraction during indexing and query-time processing, enabling zero-cost operation on private infrastructure.
Use Case:
Running a HIPAA-compliant medical document Q&A system on-premise with no external API dependencies.
Support for Neo4j, NetworkX, OpenSearch (new in 2026), and built-in lightweight stores for both graph and vector data, with OpenSearch providing unified storage across all four LightRAG storage types.
Use Case:
Starting with built-in storage for prototyping and migrating to Neo4j + OpenSearch for production-scale deployments.
Free
Developers and teams who want graph-enhanced RAG without licensing costs
Ready to get started with LightRAG?
View Pricing Options →LightRAG works with these platforms and services:
We believe in transparent reviews. Here's what LightRAG doesn't handle well:
Weekly insights on the latest AI tools, features, and trends delivered to your inbox.
Knowledge & Documents
Microsoft's graph-based retrieval augmented generation for complex document understanding and multi-hop reasoning.
AI Agent Builders
LlamaIndex: Build and optimize RAG pipelines with advanced indexing and agent retrieval for LLM applications.
AI Agent Builders
The industry-standard framework for building production-ready LLM applications with comprehensive tool integration, agent orchestration, and enterprise observability through LangSmith.
AI Memory & Search
Open-source framework that builds knowledge graphs from your data so AI systems can analyze and reason over connected information rather than isolated text chunks.
No reviews yet. Be the first to share your experience!
Get started with LightRAG and see if it's the right fit for your needs.
Get Started →Take our 60-second quiz to get personalized tool recommendations
Find Your Perfect AI Stack →Explore 20 ready-to-deploy AI agent templates for sales, support, dev, research, and operations.
Browse Agent Templates →