# LightRAG

A retrieval-augmented generation framework that builds a knowledge graph from documents and combines it with vector retrieval, aiming for simpler and faster indexing and querying than typical RAG pipelines.

LightRAG indexes documents into a knowledge graph alongside vector storage, then answers queries by combining graph traversal with vector retrieval. It supports four selectable text-chunking strategies, role-specific LLM configuration for extraction, querying, keyword and vision-language tasks, and a reranker for mixed queries.

It can parse multimodal documents, including PDFs, images, Office files, tables and formulas, through integrated MinerU or Docling services, and supports document deletion with automatic knowledge-graph regeneration. Storage backends include PostgreSQL, MongoDB, Neo4J and OpenSearch, and it integrates with RAGAS for evaluation and Langfuse for tracing. A web UI lets a user insert, query and visualize the knowledge graph, and a setup wizard supports local deployment of embedding, reranking and storage backends through Docker.

It is written in Python and licensed under the MIT license.

Website: https://arxiv.org/abs/2410.05779
