RAG et systèmes de connaissances

LightRAG: Simple and Fast Retrieval-Augmented Generation

hkuds/lightrag

A lightweight, graph-based retrieval-augmented generation (RAG) framework that uses a dual-layer architecture combining knowledge graphs and vector embeddings to deliver efficient indexing, low-cost incremental updates, and high-quality contextual retrieval.

★ 38,4KÉtoiles
⑂ 5,4KForks
219Problèmes ouverts
PythonLangue
MITLicence
Q@project.QualityScoreScore éditorial

Captures d'écran du projet

Capture d’écran de LightRAG: Simple and Fast Retrieval-Augmented Generation Capture d’écran de LightRAG: Simple and Fast Retrieval-Augmented Generation Capture d’écran de LightRAG: Simple and Fast Retrieval-Augmented Generation Capture d’écran de LightRAG: Simple and Fast Retrieval-Augmented Generation

Vue d’ensemble

LightRAG is an open-source Python framework designed as an efficient alternative to traditional graph-based RAG systems. It bridges vector-based and graph-based RAG by managing both knowledge graphs and vector embeddings concurrently. The framework addresses common challenges in large-scale RAG deployments, such as high computational overhead, slow response times, and the cost of incremental data updates. It supports multiple document parsing engines, text chunking strategies, storage backends, and role-specific LLM configurations. Recent updates have introduced multimodal content processing, allowing it to handle images, tables, and formulas within documents.

Fonctionnalités clés

  • Dual-layer architecture combining knowledge graphs and vector embeddings
  • Dual-level retrieval mechanism for comprehensive context integration
  • Incremental updates and selective document deletion with KG regeneration
  • Role-specific LLM configuration (EXTRACT, QUERY, KEYWORD, VLM)
  • Five query modes: local, global, hybrid, naive, and mix
  • Multiple document parsing engines: MinerU, Docling, and Native
  • Four text chunking strategies: Fixed, Recursive, Vector, and Paragraph
  • Multimodal content processing for images, tables, and formulas
  • Support for multiple storage backends including PostgreSQL, Neo4j, and MongoDB
  • WebUI and REST API for document insertion, querying, and visualization

Prérequis, installation et démarrage rapide

LightRAG can be installed via PyPI using 'uv tool install "lightrag-hku[api]"' or pip. For source installation, clone the repository and run 'make dev' to bootstrap the environment, followed by building the frontend artifacts with 'bun install --frozen-lockfile' and 'bun run build'. Docker Compose is also supported by cloning the repository, configuring the .env file, and running 'docker compose up'. An interactive setup wizard is available via 'make env-base', 'make env-storage', and 'make env-server' commands to generate configuration files.

Utilisation

After installation, configure the .env file with LLM and embedding model settings. Launch the server using the 'lightrag-server' command, which provides a WebUI and REST API. Users can insert documents, select query modes (default is 'mix'), and retrieve context-aware responses. The embedding model must be selected before indexing and cannot be easily changed afterward without re-embedding all content.

Compatibilité des modèles et cas d’usage

LightRAG supports configurable models for four roles. For extraction, non-thinking models like GPT-5.6-luna, Claude Haiku, Gemini-mini, DeepSeek-V4-lite, or Kimi are recommended; locally, Qwen3-30B-A3B-Instruct is a minimum. The query role requires a stronger, potentially thinking-capable model. The keyword role requires a fast, non-thinking model. The VLM role supports mainstream multimodal models, with Qwen3.6-35B-A3B suggested for local deployment. For embeddings, low-dimensional, fast models like BAAI/bge-m3 are recommended.

Licence et notes sur les risques

The repository is licensed under the MIT License.

Editorial verification 2026-08-09: repository URL, owner, description, license and repository statistics were reviewed. License metadata: MIT. README was fetched for the channel draft; re-check repository dependencies, releases and model terms before production use.

Publication et maintenance

The repository indicates acceptance to EMNLP2025. Recent updates include merging RagAnything for multimodal processing, adding Smart Heading recognition for Word documents, introducing four text chunking strategies, integrating OpenSearch, adding a setup wizard, and supporting role-specific LLM configurations. The repository was created on 2024-10-02 and has accumulated 38,423 stars and 5,403 forks.

LanceDB

lancedb/lancedb

★ 11,1KRust

EvalScope

modelscope/evalscope

★ 3,2KPython

Infino

infino-ai/infino

★ 67Rust