5 min read

LightRAG: Fast Knowledge-Graph RAG for Your Documents (GitHub, Scanned)

Chat with your documents using a knowledge graph plus vectors, with a server and web UI.

LightRAG logo
✅
Scan: safe. Nothing malicious. The server listens on every network interface with no login by default, and its Docker image pins a long list of dependencies with advisories, so keep it local or behind authentication. Scanned Oct 19, 2026; the full report is below.

LightRAG answers questions about your documents by building a knowledge graph from them. As it indexes a file, a language model pulls out the entities and the relationships between them, and LightRAG stores those alongside ordinary vector embeddings of the text. At question time it can search the precise local facts around an entity, the broad themes across documents, plain text chunks, or all three at once, which handles questions like how two people or projects are connected far better than chunk search alone.

It began as a research paper from the University of Hong Kong as a lighter, cheaper alternative to Microsoft's GraphRAG, and has grown into a full server: a web UI for uploading files and exploring the graph, a REST API, an Ollama-compatible chat endpoint so tools like Open WebUI can talk to it, document parsing with MinerU or Docling, multimodal handling of images and tables, and storage backends from local files up to PostgreSQL, Neo4j and Milvus. It works with OpenAI, Gemini, Bedrock, Ollama and other providers.

It is MIT-licensed, with about 40,200 stars and 353 contributors, at v1.5.7 when scanned, and installs from PyPI as lightrag-hku.

  • Repository: github.com/HKUDS/LightRAG
  • Licence: MIT (MIT License)
  • Language: Python. Stars: 40.2K. Forks: 5,706. Last push: Oct 15, 2026.
  • Scan: safe, Oct 19, 2026, commit aaebfe1

Who it is for

Developers building a question-answering system over company documents, research papers or notes, and anyone who has found plain vector RAG missing connections that span several documents.

Getting started

1. Install the server (with uv, or pip install "lightrag-hku[api]")

uv tool install "lightrag-hku[api]"

2. Get the example settings and add your LLM and embedding keys

curl -o .env https://raw.githubusercontent.com/HKUDS/LightRAG/main/env.example

3. Start the server and web UI

lightrag-server

4. Open the web UI

open http://localhost:9621

Before starting, set HOST=127.0.0.1 in .env unless you have also set LIGHTRAG_API_KEY or AUTH_ACCOUNTS: the example file binds to every interface. Indexing uses an LLM call for every chunk, so a large document set costs real money on a paid API or takes time on a local model.

Safety scan

We cloned HKUDS/LightRAG at commit aaebfe1 on Oct 19, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • No secrets and no committed binaries across 1,331 files and about 489,000 lines. The 3 pattern hits are the Dockerfile installing Rust with rustup's official installer and two Makefile lines printing the uv and Bun install commands. The one bare-IP URL is an Ollama server in an unofficial community example.
  • The server binds to 0.0.0.0 by default, and with neither LIGHTRAG_API_KEY nor AUTH_ACCOUNTS set every endpoint is open, including uploads and deletes; the README and the example settings say so in capitals. It does refuse to start with logins configured but the default token secret.
  • 147 known advisories (6 critical, 63 high) in uv.lock, which the Docker image installs exactly. Most are in libraries LightRAG uses narrowly: the NLTK criticals concern loading untrusted pickle files, the PyJWT and python-jose ones affect apps verifying tokens with public keys while LightRAG signs with a shared secret, and the AnyIO one concerns IDNA host names. Installing from PyPI pulls newer versions within its ranges, which avoids most of them.
  • The installer scripts are Kubernetes deployment helpers and an interactive setup.sh that writes a .env file; none uses sudo or edits shell profiles.
  • 11 workflows, none using pull_request_target; only 3 of 21 third-party actions are pinned to commits. Licence, security policy, contributing guide and Dependabot present.

What the scanner counted

CheckResult
SecretsNone found.
Suspicious code3 pattern hits found and read; every one is listed under the raw findings.
Install-time code7 installer scripts
Committed binariesNone.
CI workflows11 workflows. None use pull_request_target. 18 of 21 third-party actions pinned to a tag rather than a commit.
Network hosts40 distinct hosts referenced from source; most often api.openai.com, github.com, docling.test, api.example.com. 1 URL to a bare IP address, listed under the raw findings.
Known vulnerabilities147 advisories across 249 pinned packages: 6 critical, 63 high, 69 moderate, 9 low. requirements-offline-smart-heading.txt: 1 packages, 0 advisories; uv.lock: 248 packages, 147 advisories.
Project hygieneHas security policy, automated dependency updates, licence file, contributing guide. Missing CodeQL.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Pattern hits (3)
WhereRuleMatch
Dockerfile:35download-piped-to-shell&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Makefile:62download-piped-to-shellprintf "Unix/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh\n"; \
Makefile:69download-piped-to-shellprintf "macOS/Linux: curl -fsSL https://bun.sh/install | bash\n"; \
URLs to bare IP addresses (1)
WhereRuleMatch
examples/unofficial-sample/lightrag_openai_neo4j_milvus_redis_demo.py:49ip-literal-urltexts, embed_model="shaw/dmeta-embedding-zh", host="http://117.50.173.35:11434"
Installer scripts (7)
Worst known vulnerabilities (24 of 147)
AdvisorySeverityPackageSummary
GHSA-82r6-8w77-94w6criticalanyio@4.13.0AnyIO: TLSStream IDNA 2003 host name encoding enables potential TLS certificate spoofing
GHSA-m4rf-3fr8-xwx3criticalnltk@3.9.4NLTK: JVM argument injection bypass via per-call options in the NLTK Stanford wrappers (incomplete fix of CVE-2026-12841…
GHSA-rhp5-r9x4-f5g2criticalnltk@3.9.4NLTK: Unsafe Pickle Deserialization in TransitionParser Allows Remote Code Execution
GHSA-x99w-6fgc-pmfwcriticalnltk@3.9.4NLTK: Allowlisted pickle loaders still permit code execution in current source
GHSA-ffc3-869f-jxw9criticalpyjwt@2.8.0PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guar…
GHSA-3qf3-8w2g-rqmxcriticalpython-jose@3.5.0python-jose algorithm confusion guard bypassed by DER-encoded public keys
GHSA-cq5v-8q36-5273highaiohttp@3.13.5AIOHTTP: Out-of-bounds heap read in C HTTP response parser error path (malformed chunked response)
GHSA-c3jg-qh8m-j3h2highcairosvg@2.9.0CairoSVG: Quadratic-time DoS parsing a crafted SVG <path>
GHSA-g6cj-pr64-35w5highcryptography@48.0.1cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
GHSA-jwv3-5hgf-82wwhighcryptography@48.0.1python-cryptography: Duplicate self-signed intermediates can cause exponential path-building
GHSA-wj6h-64fc-37mphighecdsa@0.19.2Minerva timing attack on P-256 in python-ecdsa
GHSA-27vj-qcqg-25rchighfsspec@2026.2.0fsspec: Server-Side Template Injection in ReferenceFileSystem leads to Remote Code Execution
GHSA-7mj9-2mp8-4m2phighhttpcore2@2.5.0HTTPX2: Secure WebSocket traffic sent without TLS through SOCKS proxies
GHSA-8xx6-hgc6-gc2mhighhttpx2@2.5.0HTTPX2: Streaming response decompression does not bound peak memory (decompression amplification)
GHSA-fvww-7h3r-vfhphighlanggraph-sdk@0.3.14LangGraph SDK custom auth silently ignores actions= on resource decorators
GHSA-f4xh-w4cj-qxq8highlangsmith@0.8.3LangSmith SDK TracingMiddleware: Arbitrary server-side file read
GHSA-3gq4-3j92-5w49highnltk@3.9.4NLTK: Corpus Reader Sandbox Bypass
GHSA-568f-pv23-39p4highnltk@3.9.4NLTK: Stable FrameNet and NKJP readers parse outside-root XML
GHSA-6hm5-jgcp-p838highnltk@3.9.4Natural Language Toolkit (NLTK): Path Traversal in NKJPCorpusReader leads to Arbitrary File Read and bypasses the nltk.p…
GHSA-6hwm-xvph-95vmhighnltk@3.9.4NLTK: Uncontrolled search path when invoking the Graphviz 'dot' binary
GHSA-6ww7-3frv-cqxhhighnltk@3.9.4NLTK: pathsec SSRF protection can be bypassed when a proxy is configured
GHSA-8mgp-746c-j5xphighnltk@3.9.4NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots
GHSA-97qj-x29f-37w7highnltk@3.9.4NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses
GHSA-fg7f-2386-8897highnltk@3.9.4Natural Language Toolkit (NLTK): ReDoS in NLTK ReviewsCorpusReader FEATURES regex

By the numbers

Stars40.2K
Forks5,706
Contributors353
Commits10.9K
Open issues238
Open pull requests153
Releases83
Latest releasev1.5.7
LicenceMIT
Main languagePython
Project age2 years
Last pushOct 15, 2026
Tracked files1,331
Lines of code489.1K
Checkout size28 MB

Lines by language: Python 406.1K, TypeScript 37.6K, Markdown 25.8K, Shell 8,631, JSON 7,355, YAML 2,672.

Questions

Is LightRAG free?

Yes. LightRAG is MIT-licensed and free to self-host. You pay for the language model and embedding calls it makes, unless you run models locally with Ollama or a similar server.

How is LightRAG different from GraphRAG?

Both build a knowledge graph from documents. LightRAG skips GraphRAG's community reports and multi-step reasoning, so it needs far fewer LLM calls to index and answer, and it can add or delete documents without rebuilding everything. GraphRAG can do better on very broad summary questions across a whole corpus.

Can I use LightRAG with a local model?

Yes. It supports Ollama and other OpenAI-compatible servers for both the LLM and the embeddings. Entity extraction is demanding, so the README suggests a capable model with a long context window; very small models produce a thinner graph.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.