skillfed

lightrag-hku

LightRAG: Simple and Fast Retrieval-Augmented Generation

lightrag-hku v1.5.6 277.4K downloads/30d#8,147 on PyPI38,864
Permissive license MIT Active released

What it is and what it does

LightRAG is a Python framework for building retrieval-augmented generation (RAG) systems that combine knowledge graph extraction with semantic search. It ingests documents, extracts entities and relationships into a graph structure, and answers queries by retrieving relevant context from that graph and passing it to an LLM for synthesis. The package supports multiple storage backends (PostgreSQL, Neo4j, MongoDB, OpenSearch, nano-vectordb), multiple LLM providers (Google GenAI, OpenAI-compatible APIs), and multimodal document parsing (text, images, tables, PDFs).

The framework is designed for developers building question-answering systems, document analysis pipelines, or knowledge management applications. It handles chunking strategy selection, role-specific LLM configuration (separate models for extraction, querying, keyword generation, and vision tasks), reranking, and citation tracking. Installation is straightforward via pip, and a web UI and Docker Compose deployment option are available for rapid prototyping.

Use it for:

  • Build a Q&A system over internal documentation or knowledge bases by ingesting PDFs and Office documents, then querying them with natural language.
  • Extract structured knowledge graphs from unstructured text to support downstream analytics, recommendation, or compliance workflows.
  • Deploy a multimodal RAG service that processes mixed document types (text, images, tables) and returns cited answers with source traceability.
  • Evaluate RAG quality using integrated RAGAS evaluation and trace query execution with Langfuse for debugging and optimization.
  • Run a local RAG server with Docker Compose using open-source LLMs (Qwen, Ollama) and PostgreSQL for air-gapped or privacy-sensitive environments.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

LightRAG is a retrieval-augmented generation framework that builds knowledge graphs from documents and answers queries by combining graph-based retrieval with LLM reasoning, supporting multiple storage backends and embedding providers.

Yes. LightRAG is actively maintained, has no known vulnerabilities, installs with low friction, and offers a mature feature set (knowledge graphs, multimodal parsing, multiple backends, evaluation integration). The MIT license is permissive. Install it if you need a production-ready RAG framework with flexibility in storage and LLM choice; skip it only if you need a simpler, lighter-weight alternative or have strict offline requirements without pre-configured backends.

Install

lightrag-hku on PyPI

pip

pip install lightrag-hku

uv

uv add lightrag-hku

poetry

poetry add lightrag-hku

Installing lightrag-hku

Before you install

Low install friction with a wheel distribution. Active maintenance with a recent release (8 days old) and strong repository signals (38864 stars, last commit 2026-08-13). Requires Python >=3.10 and pulls in 19 runtime dependencies including aiohttp, pydantic, and google-genai, but all are standard packages.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects, with minimal restrictions beyond attribution.

Quickstart

pip install 'lightrag-hku[api]'

from lightrag import LightRAG

rag = LightRAG(working_dir="./rag_storage")
rag.insert("Your document text here")
result = rag.query("Your question here")

Requires Python >=3.10. LLM and embedding provider credentials (e.g., Google GenAI API key) must be configured via .env file before queries will work.

Verify before relying

  • Whether the package works offline or requires live API calls to external LLM/embedding providers by default.
  • Performance characteristics (latency, throughput) for typical document sizes and query patterns.
  • Storage backend requirements and whether nano-vectordb is sufficient for production use or if PostgreSQL/Neo4j/MongoDB are recommended.
  • Whether multimodal support (images, tables, equations) requires additional system dependencies beyond Python packages.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 19 — aiohttp, configparser, google-api-core, google-genai, json_repair, nano-vectordb, networkx, numpy, packaging, pandas, pipmaster, pydantic, pypinyin, PyYAML, python-dotenv, setuptools, tenacity, tiktoken, xlsxwriter
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Downloads 277,360/month — #8,147 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lightrag_hku-1.5.6-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

retrieval augmented generationknowledge graph RAGdocument question answeringsemantic search with LLMmultimodal document processinggraph-based information retrievalRAG framework Python
rag-frameworkknowledge-graphdocument-qa

More Python Modules packages

Further reading