원클릭으로
lightrag
Graph-based RAG system for knowledge extraction and Q&A
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Graph-based RAG system for knowledge extraction and Q&A
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Ask which skill or flow fits your situation. A router over the user-invoked skills in this repo.
Stages all changes and generates a lean Conventional Commits message via caveman-commit — user reviews and commits manually. Triggers on any commit intent: "commit", "stage my changes", "ready to push", "let's commit", "make a commit", "commit this", "push changes", "squash and commit", or any variation. Use whenever the user signals they're done with changes and ready to commit, even if they don't mention "message" or "caveman". Does NOT run git commit — outputs a ready-to-run command for the user to execute after review.
Autonomous ML research - agent modifies GPT training code, runs 5-min experiments, keeps improvements
Always use browser-harness for any web interaction: automation, scraping, testing, or site/app work.
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
AI spend analytics — see where your token budget goes by task, model, tool, and project across 31 AI coding tools including Claude Code. Use when the user asks about AI costs, token usage, spend breakdown, or wants to optimize their AI budget.
| name | lightrag |
| description | Graph-based RAG system for knowledge extraction and Q&A |
LightRAG is a graph-based Retrieval-Augmented Generation system that extracts knowledge graphs from documents for entity-relationship-aware Q&A. Outperforms naive RAG, HyDE, and GraphRAG across multiple domains.
Use when: Building document Q&A systems, knowledge bases, semantic search with graph relationships, or multimodal RAG (PDFs, images, tables).
Source: github.com/HKUDS/LightRAG (EMNLP 2025, 13K+ stars)
cd tools/lightrag-plus
uv sync
Installs lightrag-hku and dependencies in isolated venv.
Add one of these to .env:
# OpenAI
OPENAI_API_KEY=sk-...
# Claude
ANTHROPIC_API_KEY=sk-ant-...
# Gemini
GEMINI_API_KEY=...
# Ollama (local)
OLLAMA_HOST=http://localhost:11434
Default (nano-vectordb) — no setup, good for prototyping:
rag = LightRAG(working_dir="./rag_storage")
Neo4J — advanced graph queries:
# Add to .env
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=...
MongoDB — unified storage:
# Add to .env
MONGODB_URI=mongodb://localhost:27017
PostgreSQL — SQL-based queries:
# Add to .env
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=...
POSTGRES_PASSWORD=...
POSTGRES_DB=lightrag
Insert documents:
from lightrag import LightRAG, QueryParam
from lightrag.llm import openai_complete_if_cache, openai_embedding
rag = LightRAG(
working_dir="./rag_storage",
llm_model_func=openai_complete_if_cache,
embedding_func=openai_embedding
)
# Insert
with open("document.txt") as f:
rag.insert(f.read())
Query:
# Modes: naive, local, global, hybrid, mix
result = rag.query(
"What is the main topic?",
param=QueryParam(mode="hybrid")
)
print(result)
Start server:
cd tools/lightrag-plus
python -m lightrag.server --port 9621 --working-dir ./rag_storage
Query via REST API:
# Insert document
curl -X POST http://localhost:9621/insert \
-H "Content-Type: application/json" \
-d '{"text": "Your document text here"}'
# Query
curl -X POST http://localhost:9621/query \
-H "Content-Type: application/json" \
-d '{"query": "What is...?", "mode": "hybrid"}'
Web UI: http://localhost:9621 — knowledge graph visualization, node queries, subgraph filtering
| Mode | When to Use |
|---|---|
naive | Baseline retrieval without graph context |
local | Local entity-based retrieval (fast) |
global | Community-based global retrieval |
hybrid | Combines local + global (best for broad queries) |
mix | Uses reranker — best performance when reranker is configured |
Default: hybrid (no reranker) or mix (with reranker)
BAAI/bge-m3, text-embedding-3-largemode="mix"BAAI/bge-reranker-v2-m3, Jina reranker APIOpenAI:
from lightrag.llm import openai_complete_if_cache, openai_embedding
rag = LightRAG(
working_dir="./rag_storage",
llm_model_func=openai_complete_if_cache,
embedding_func=openai_embedding
)
Claude (Anthropic):
from lightrag.llm import anthropic_complete, openai_embedding # use OpenAI for embeddings
rag = LightRAG(
working_dir="./rag_storage",
llm_model_func=anthropic_complete,
embedding_func=openai_embedding
)
Ollama (Local):
from lightrag.llm import ollama_model_complete, ollama_embedding
rag = LightRAG(
working_dir="./rag_storage",
llm_model_func=ollama_model_complete,
llm_model_name="llama3.2:latest",
embedding_func=ollama_embedding,
embedding_model_name="nomic-embed-text"
)
Gemini:
from lightrag.llm import gemini_complete, openai_embedding
rag = LightRAG(
working_dir="./rag_storage",
llm_model_func=gemini_complete,
embedding_func=openai_embedding
)
rag.token_usage()rag.export_knowledge_graph()kv_store_llm_response_cache.json in working_dirrag.delete_document(doc_id) with auto KG regenerationFull docs: docs/AdvancedFeatures.md
tools/lightrag-plus/
pyproject.toml ← Dependencies (lightrag-hku)
README.md ← Full documentation
uv.lock ← Dependency lock file
.gitignore ← Excludes .venv, rag_storage, build artifacts
.venv/ ← Virtual environment (gitignored, recreated by `uv sync`)
rag_storage/ ← Working directory (gitignored, auto-created on first use)
# Install
cd tools/lightrag-plus && uv sync
# Start server
cd tools/lightrag-plus && python -m lightrag.server --port 9621 --working-dir ./rag_storage
# Test insert/query via Python
cd tools/lightrag-plus && uv run python -c "
from lightrag import LightRAG, QueryParam
rag = LightRAG(working_dir='./rag_storage')
rag.insert('The capital of France is Paris.')
print(rag.query('What is the capital of France?', param=QueryParam(mode='naive')))
"