LightRAG/docs
Raphael MANSUY 2b292d4924
docs: Enterprise Edition & Multi-tenancy attribution (#5)
* Remove outdated documentation files: Quick Start Guide, Apache AGE Analysis, and Scratchpad.

* Add multi-tenant testing strategy and ADR index documentation

- Introduced ADR 008 detailing the multi-tenant testing strategy for the ./starter environment, covering compatibility and multi-tenant modes, testing scenarios, and implementation details.
- Created a comprehensive ADR index (README.md) summarizing all architecture decision records related to the multi-tenant implementation, including purpose, key sections, and reading paths for different roles.

* feat(docs): Add comprehensive multi-tenancy guide and README for LightRAG Enterprise

- Introduced `0008-multi-tenancy.md` detailing multi-tenancy architecture, key concepts, roles, permissions, configuration, and API endpoints.
- Created `README.md` as the main documentation index, outlining features, quick start, system overview, and deployment options.
- Documented the LightRAG architecture, storage backends, LLM integrations, and query modes.
- Established a task log (`2025-01-21-lightrag-documentation-log.md`) summarizing documentation creation actions, decisions, and insights.
2025-12-04 18:09:15 +08:00
..
archives docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0001-quick-start.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0002-architecture-overview.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0003-api-reference.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0004-storage-backends.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0005-llm-integration.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0006-deployment-guide.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0007-configuration-reference.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
0008-multi-tenancy.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00
README.md docs: Enterprise Edition & Multi-tenancy attribution (#5) 2025-12-04 18:09:15 +08:00

LightRAG Enterprise Documentation

Version 2.0.0-enterprise | Graph-Enhanced Retrieval-Augmented Generation

╔═══════════════════════════════════════════════════════════════════════════╗
║                                                                           ║
║     ██╗     ██╗ ██████╗ ██╗  ██╗████████╗██████╗  █████╗  ██████╗       ║
║     ██║     ██║██╔════╝ ██║  ██║╚══██╔══╝██╔══██╗██╔══██╗██╔════╝       ║
║     ██║     ██║██║  ███╗███████║   ██║   ██████╔╝███████║██║  ███╗      ║
║     ██║     ██║██║   ██║██╔══██║   ██║   ██╔══██╗██╔══██║██║   ██║      ║
║     ███████╗██║╚██████╔╝██║  ██║   ██║   ██║  ██║██║  ██║╚██████╔╝      ║
║     ╚══════╝╚═╝ ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝       ║
║                                                                           ║
║              ENTERPRISE EDITION                                          ║
║         Simple and Fast Graph-Enhanced RAG System                        ║
║                                                                           ║
╚═══════════════════════════════════════════════════════════════════════════╝

🔱 Fork Project | This is an enterprise-ready fork of LightRAG by Raphaël MANSUY.

Goal: Create an enterprise-ready version of LightRAG with production-grade features.

First Enterprise Feature: Multi-tenancy support with RBAC, tenant isolation, and knowledge base management.


Documentation Overview

Document Description
Quick Start Get up and running in 5 minutes
Architecture Overview System design, data flow, and core concepts
API Reference Complete REST API documentation
Storage Backends Configure KV, vector, and graph storage
LLM Integration LLM providers and embedding models
Deployment Guide Docker, Kubernetes, and production setup
Configuration Reference All environment variables and options
Multi-Tenancy Tenant isolation and RBAC

Getting Started

# Install
pip install lightrag-hku

# Start server
export OPENAI_API_KEY=sk-xxx
python -m lightrag.api.lightrag_server

Python Usage

from lightrag import LightRAG, QueryParam

rag = LightRAG(working_dir="./rag_storage")
await rag.ainsert("Your document text...")
result = await rag.aquery("Your question?", param=QueryParam(mode="hybrid"))

REST API

# Insert document
curl -X POST http://localhost:9621/documents/text \
  -H "Content-Type: application/json" \
  -d '{"text": "Document content..."}'

# Query
curl -X POST http://localhost:9621/query \
  -H "Content-Type: application/json" \
  -d '{"query": "Your question?", "mode": "hybrid"}'

Docker

docker run -p 9621:9621 -e OPENAI_API_KEY=sk-xxx ghcr.io/hkuds/lightrag:latest

System Overview

┌─────────────────────────────────────────────────────────────────────────────┐
│                              LightRAG                                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   Documents ──▶ Chunking ──▶ Entity Extraction ──▶ Knowledge Graph          │
│                    │                                      │                  │
│                    ▼                                      ▼                  │
│              Embeddings ──────────────────────▶ Hybrid Retrieval            │
│                                                       │                      │
│                                                       ▼                      │
│                              Query ──▶ LLM Generation ──▶ Response          │
│                                                                              │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  Storage Backends:                                                           │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐                       │
│  │ KV Storage   │  │ Vector Store │  │ Graph Store  │                       │
│  │ JSON/Redis/  │  │ NanoVectorDB │  │ NetworkX/    │                       │
│  │ PostgreSQL/  │  │ pgvector/    │  │ Neo4j/AGE/   │                       │
│  │ MongoDB      │  │ Milvus/FAISS │  │ Memgraph     │                       │
│  └──────────────┘  └──────────────┘  └──────────────┘                       │
│                                                                              │
│  LLM Providers:                                                              │
│  OpenAI │ Anthropic │ Ollama │ Azure │ Bedrock │ HuggingFace │ ...         │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Query Modes

Mode Description Best For
naive Basic vector similarity search Simple lookups
local Entity-focused retrieval Specific facts
global High-level community summaries Broad questions
hybrid Combined local + global Balanced queries
mix Full KG + vector integration Complex reasoning

Deployment Options

Option Use Case Guide
Local Development pip install lightrag-hku
Docker Staging/Production Docker Guide
Kubernetes Production/Scale K8s Guide

Storage Topology

Environment KV Vector Graph
Development JSON NanoVectorDB NetworkX
Production PostgreSQL pgvector Neo4j
High-Scale Redis Milvus Neo4j

Configuration Quick Reference

Essential Environment Variables

# LLM
LLM_BINDING=openai
LLM_MODEL=gpt-4o-mini
OPENAI_API_KEY=sk-xxx

# Embedding
EMBEDDING_BINDING=openai
EMBEDDING_MODEL=text-embedding-ada-002
EMBEDDING_DIM=1536

# Storage
LIGHTRAG_KV_STORAGE=JsonKVStorage
LIGHTRAG_VECTOR_STORAGE=NanoVectorDBStorage
LIGHTRAG_GRAPH_STORAGE=NetworkXStorage

# Server
PORT=9621

See Configuration Reference for all options.


Feature Highlights

Knowledge Graph Integration

┌────────────────────────────────────────────────────┐
│              KNOWLEDGE GRAPH                        │
│                                                     │
│    [Person: Einstein] ─────developed──────▶        │
│           │                               │        │
│     born_in                        [Theory:        │
│           │                        Relativity]     │
│           ▼                               │        │
│    [Location: Germany]           describes_│       │
│                                           ▼        │
│                                  [Concept:         │
│                                   Spacetime]       │
└────────────────────────────────────────────────────┘

Multi-Tenant Isolation

Tenant A          Tenant B          Tenant C
    │                 │                 │
    ▼                 ▼                 ▼
┌────────┐       ┌────────┐       ┌────────┐
│ KB-1   │       │ KB-1   │       │ KB-1   │
│ KB-2   │       │ KB-2   │       └────────┘
│ KB-3   │       └────────┘
└────────┘

Resources

Enterprise Fork

Original Project


Document Index

  1. Quick Start Guide

    • Installation options
    • Python SDK basics
    • REST API basics
    • Common patterns
  2. Architecture Overview

    • System design diagrams
    • Core concepts (entities, relations, chunks)
    • Data flow pipeline
    • Query execution flow
  3. API Reference

    • Document endpoints
    • Query endpoints
    • Graph endpoints
    • Admin endpoints
  4. Storage Backends

    • KV storage options
    • Vector storage options
    • Graph storage options
    • Configuration tables
  5. LLM Integration

    • Provider configurations
    • Embedding models
    • Reranking options
    • Custom implementations
  6. Deployment Guide

    • Local development
    • Docker deployment
    • Kubernetes/Helm
    • Production best practices
  7. Configuration Reference

    • Environment variables
    • CLI arguments
    • QueryParam options
    • Complete .env example
  8. Multi-Tenancy Guide

    • Tenant isolation
    • RBAC roles/permissions
    • TenantRAGManager
    • API endpoints

Original LightRAG built with ❤️ by HKUDS

Enterprise Edition maintained by Raphaël MANSUY @ Elitizon