lightrag

Build graph-based retrieval augmented generation over documents for entity-aware Q&A.

4|4|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Roentek/Claude_Code_Boilerplate_Framework --skill lightrag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lightrag
Source: https://github.com/Roentek/Claude_Code_Boilerplate_Framework/tree/main/.claude/skills/lightrag
Command: npx skills add https://github.com/Roentek/Claude_Code_Boilerplate_Framework --skill lightrag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LightRAG helps you extract relationships and structured knowledge from documents so your Q&A can answer with graph-aware context instead of relying only on naive text similarity.

Core Features & Use Cases

  • Graph-based RAG: builds an entity/relationship knowledge graph from your source documents and uses it for entity-aware retrieval and Q&A.
  • Multiple query modes: supports naive, local, global, hybrid, and mix workflows to balance speed and answer quality.
  • Pluggable backends: persists the graph in storage backends like nano-vectordb (default), Neo4J, MongoDB, or PostgreSQL for different production needs.

Quick Start

Start by installing dependencies with uv in tools/lightrag, then configure one LLM provider API key in .env and use the provided LightRAG code (or start the server) to insert documents and query them with hybrid retrieval.

Frequently Asked Questions about lightrag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does graph-based retrieval augmented generation improve document Q&A over standard semantic search?

Graph-based retrieval augmented generation improves document Q&A by building an entity and relationship knowledge graph from source documents, enabling entity-aware context retrieval instead of relying solely on naive text similarity for answers.

How do I extract entities and relationships from PDFs and images for knowledge graph search?

You can extract entities and relationships for knowledge graph search by inserting multimodal documents like PDFs, images, and tables into LightRAG, which automatically builds a structured graph for entity-aware retrieval and Q&A.

Can I store my RAG knowledge graph in PostgreSQL or Neo4J instead of the default vector database?

Yes, you can store your RAG knowledge graph in PostgreSQL or Neo4J. LightRAG supports pluggable graph storage backends including Neo4J, MongoDB, PostgreSQL, and the default nano-vectordb for different production needs.

What query modes are available for balancing speed and answer quality in graph-backed search?

Graph-backed search offers naive, local, global, hybrid, and mix query workflows to balance retrieval speed and answer quality. Hybrid retrieval is configured by default when inserting and querying documents.

Do I need to configure an LLM and matching embeddings to use graph-aware RAG?

Yes, you need to configure an LLM for generation and matching vector embeddings for indexing and querying. You set one LLM provider API key in the environment file to start inserting documents and querying with graph-aware RAG.

When should I use global or hybrid query modes instead of naive retrieval for document Q&A?

Use global or hybrid query modes when you need broader entity-relationship context across documents. Naive retrieval suits simple text similarity matches, while hybrid and mix workflows combine local and global graph context to maximize answer quality.