LightRAG Tool icon

LightRAG Tool

Let an AI Agent query a LightRAG knowledge base

LightRAG Tool

AI-generated

Summary

Queries a LightRAG knowledge base as an AI Agent tool, returning retrieved text chunks for the agent to use. Configure the retrieval strategy and limits, then connect the node to an AI Agent.

Inputs

  • LightRAG API credentials (required) — Credentials for the LightRAG server, including its base URL.
  • Mode — Retrieval strategy: Naive (default, vector-only), Local (entity-focused), Global (relationship-focused), Hybrid (combined graph), or Mix (graph and vector). Non-Naive modes may take longer because they can use an LLM to extract keywords.
  • KG Top K — Maximum knowledge-graph entities or relationships to retrieve; defaults to 5.
  • Chunk Top K — Maximum text chunks to retrieve; defaults to 5.
  • Max Entity Tokens — Token limit for entity context; defaults to 2000.
  • Max Relation Tokens — Token limit for relationship context; defaults to 2000.
  • Max Total Tokens — Total LightRAG context budget, including its system prompt, query, and reserved tokens; defaults to 2000.
  • Enable Rerank — Whether to use the server-side reranker; defaults to false.
  • Request Timeout (Seconds) — Maximum wait for a retrieval request; defaults to 30 seconds.
  • Tool Description — Description shown to the AI Agent to guide when it uses the tool. If blank, a generic description is used.
  • query (required) — The AI Agent supplies a question or search query of at least three characters.

Output shape

An AI Tool connection for an AI Agent; each call returns retrieved chunk text to the agent.

Successful chunks are joined into a single string with numbered fragment labels. If no relevant chunks are found, the tool returns a LIGHTRAG_NO_RESULTS message; timeouts return LIGHTRAG_TIMEOUT. Other retrieval errors are raised. The tool instructs the agent to rely on retrieved fragments and not invent information when results are absent or the service times out.

Examples

Example 1: Ask the agent to find information in the connected LightRAG knowledge base.

Choose a retrieval mode and optional limits, reranking, and timeout. Leave Tool Description blank to use the generic guidance.

Links

Discussion