Favicon of LightRAG

LightRAG

An open-source RAG framework under the MIT license. Run it locally or in Docker with local models or hosted LLMs to query your documents.

LightRAG combines knowledge graphs with vector search to answer questions across a document collection. It's a self-hosted Python framework for developers building document assistants, particularly where answers depend on relationships between facts in different files, such as legal or financial material.

It runs on macOS, Windows and Linux, with Docker deployment available. The code uses the MIT license. Offline deployment is supported with dependencies and models prepared in advance. Local model choices include Qwen3-30B-A3B-Instruct for extracting relationships and Qwen3.6-35B-A3B for image input. Hosted models such as Claude Haiku are also supported; choosing those sends model requests to an external service rather than keeping that processing local.

Retrieval combines specific facts with broader concepts, and answers can include source citations. A browser interface lets you add documents, ask questions and inspect the knowledge graph, while a REST API connects it to other applications. You can use separate models for document extraction and answering questions, balancing processing speed against answer quality.

Document handling covers PDFs, Office files and Markdown, including images, tables and formulas through MinerU, Docling and native parsing. Section-aware splitting helps keep headings with their content and preserve table structure. The knowledge base accepts incremental updates and selective document deletion, rebuilding affected relationships. Storage choices include PostgreSQL, MongoDB, Neo4j and OpenSearch; the default local file stores are intended for small-scale testing rather than production.

Similar to LightRAG