# AI use cases for LightRAG (HKUDS/LightRAG)

Repo: [HKUDS/LightRAG](https://github.com/HKUDS/LightRAG) | Use cases: 3 | Page: https://dedupedai.com/use-cases/hkuds-lightrag/

LightRAG is a lightweight knowledge-graph RAG framework from HKU, positioned as an efficient alternative to Microsoft GraphRAG. It builds both a knowledge graph and vector embeddings from your documents, ships a server with a WebUI to insert, query and visualize knowledge, supports rerankers, citations, document deletion with graph regeneration, multimodal parsing through MinerU or Docling, and storage backends such as PostgreSQL, Neo4j, MongoDB and OpenSearch.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a knowledge-graph RAG server with a web UI: https://dedupedai.com/use-cases/hkuds-lightrag/run-a-graph-rag-server-with-a-web-ui/
- Deploy LightRAG with Docker Compose: https://dedupedai.com/use-cases/hkuds-lightrag/deploy-lightrag-with-docker-compose/
- Configure LightRAG safely with the setup wizard: https://dedupedai.com/use-cases/hkuds-lightrag/configure-lightrag-with-the-setup-wizard/

## How to run a knowledge-graph RAG server with a web UI with LightRAG

Repo: [HKUDS/LightRAG](https://github.com/HKUDS/LightRAG) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Install the LightRAG Server, point it at your models and query documents through the WebUI.

**Who it is for:** A researcher who wants answers that connect people, companies and events across many documents.

**The problem:** Plain vector RAG returns fragments and misses how entities relate across files.

**The outcome:** A local LightRAG server where you insert documents, ask questions and see the knowledge graph.

### Steps

1. Install the server as a tool with `uv tool install "lightrag-hku[api]"`
2. Copy the example config with `cp env.example .env` and set your LLM and embedding settings
3. Start it with `lightrag-server`
4. Open the WebUI to insert documents, query them and visualize the graph
5. Before exposing it on a network, set LIGHTRAG_API_KEY or AUTH_ACCOUNTS with TOKEN_SECRET in .env

### Prompt to paste into your agent

```text
Install HKUDS/LightRAG Server with uv, configure .env for <LLM> and <embedding model>, bind it to 127.0.0.1, and load <documents>. Then ask <question> and show me the entities and relations it used.
```

### Caveat

Graph extraction quality depends heavily on the LLM; the README notes improvements for open models such as Qwen3-30B-A3B.

Risk, insecure-default: The server binds to all interfaces by default and every endpoint is public without auth, so configure authentication or bind to 127.0.0.1 first.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hkuds-lightrag/run-a-graph-rag-server-with-a-web-ui/

## How to deploy LightRAG with Docker Compose with LightRAG

Repo: [HKUDS/LightRAG](https://github.com/HKUDS/LightRAG) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Clone the repo, fill in .env and bring the whole stack up with one command.

**Who it is for:** A developer who wants LightRAG running on a server without managing Python environments.

**The problem:** Installing Python dependencies, a frontend and storage services by hand is slow and error prone.

**The outcome:** A LightRAG container stack running with your LLM and embedding settings.

### Steps

1. Clone with `git clone https://github.com/HKUDS/LightRAG.git` and `cd LightRAG`
2. Run `cp env.example .env` and set the LLM and embedding settings
3. Start everything with `docker compose up`
4. Optionally verify official GHCR images with Sigstore Cosign, as the Docker deployment docs describe
5. On Apple Silicon without Docker Desktop, follow the Apple container setup doc instead

### Prompt to paste into your agent

```text
Deploy HKUDS/LightRAG with Docker Compose on <server>, configure .env for <LLM> and <embedding model> with authentication turned on, and confirm the WebUI loads. Report the URL and any startup warnings.
```

### Caveat

Historical image versions are on GHCR; pin a version if you need reproducible deployments.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hkuds-lightrag/deploy-lightrag-with-docker-compose/

## How to configure LightRAG safely with the setup wizard with LightRAG

Repo: [HKUDS/LightRAG](https://github.com/HKUDS/LightRAG) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Use the interactive make targets to generate .env, add storage backends and audit security.

**Who it is for:** Someone who finds the long env.example intimidating and wants a guided, safe setup.

**The problem:** Hand-editing a large config file is easy to get wrong, especially auth and storage settings.

**The outcome:** A configured .env, optional compose services for storage, and a security audit of the result.

### Steps

1. Install from source with `git clone https://github.com/HKUDS/LightRAG.git`, `cd LightRAG` and `make dev`
2. Run `make env-base` to set the LLM, embedding and reranker
3. Add storage backends and databases with `make env-storage` if you need them
4. Set port, auth and SSL with `make env-server`
5. Audit the result with `make env-security-check`, then launch with `lightrag-server`

### Prompt to paste into your agent

```text
Set up HKUDS/LightRAG from source using the setup wizard: run make env-base for <LLM>, make env-storage for <backend>, make env-server with auth on, then make env-security-check. Fix anything the check flags before starting lightrag-server.
```

### Caveat

make dev installs the test toolchain, the offline stack and builds the frontend, so the first run downloads a lot.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hkuds-lightrag/configure-lightrag-with-the-setup-wizard/
