better-n8n-nodes-lightrag

n8n community node for LightRAG knowledge graph API — query, document management, graph operations

Package Information

Downloads: 6 weekly / 125 monthly
Latest Version: 0.1.0
Author: Julien Dabert

Documentation

n8n-nodes-lightrag

n8n community node for the LightRAG knowledge graph API. Full coverage of the LightRAG server API v1.4.11+ with 20 operations across 5 resources.

Install

Community Node (recommended)

  1. In n8n, go to Settings > Community Nodes
  2. Enter n8n-nodes-lightrag
  3. Click Install

Manual

cd ~/.n8n/nodes
npm install n8n-nodes-lightrag
# Restart n8n

Credentials

Field Description
Base URL Your LightRAG server URL (e.g. http://localhost:9621)
API Key X-API-Key header value. Leave empty if auth is disabled.

The credential test calls GET /health to verify connectivity and authentication.

Operations

Document

Operation Description Endpoint
Insert Text Index a single text document POST /documents/text
Insert Texts Index multiple texts in one call POST /documents/texts
Upload File Upload a file for indexing POST /documents/upload
List List documents with status filter and pagination POST /documents/paginated
Get Status Poll processing status by track ID GET /documents/track_status/{id}
Delete Delete documents by ID DELETE /documents/delete_document

Query

Operation Description Endpoint
Query RAG query with LLM-generated response POST /query
Query Data Raw data retrieval (entities, relations, chunks) without LLM POST /query/data

Query modes: mix (adaptive), local (entity-focused), global (graph traversal), hybrid (local + global), naive (text search), bypass (direct LLM).

Additional options: top_k, chunk_top_k, include_references, response_type, conversation_history, hl_keywords, ll_keywords, max_total_tokens, only_need_context, only_need_prompt, user_prompt.

Graph

Operation Description Endpoint
List Labels List all entity labels in the graph GET /graph/label/list
Popular Entities Get most-connected entities GET /graph/label/popular
Search Labels Fuzzy search entity labels GET /graph/label/search
Get Subgraph Get neighborhood graph around an entity GET /graphs
Check Entity Check if an entity exists GET /graph/entity/exists
Create Entity Create a new entity node POST /graph/entity/create
Edit Entity Modify entity properties POST /graph/entity/edit
Merge Entities Merge duplicate entities into one POST /graph/entities/merge

Relation

Operation Description Endpoint
Create Create a relationship between two entities POST /graph/relation/create
Edit Update relationship properties POST /graph/relation/edit

System

Operation Description Endpoint
Health Check Get server health, config, and storage info GET /health

Batch Processing

All operations are batch-aware. When multiple items flow into the node, each item is processed independently with its own parameters. Use n8n expressions (e.g. {{ $json.query }}) to pass dynamic values per item.

Example Workflows

Insert + Poll Status

[Read File] → [LightRAG: Upload File] → [Wait 5s] → [LightRAG: Get Status]

Query + Process Results

[Trigger] → [LightRAG: Query] → [IF has references] → [Process references]

Graph Exploration

[LightRAG: Search Labels] → [LightRAG: Get Subgraph] → [Visualize]

Compatibility

  • n8n: >= 1.0.0
  • LightRAG server: >= 1.4.11
  • Node.js: 18, 20, 22

Development

git clone https://github.com/menezis-ai/n8n-nodes-lightrag.git
cd n8n-nodes-lightrag
npm install
npm run build       # Compile TypeScript
npm run lint        # Type check
npm run dev         # Watch mode

License

MIT

Discussion