N8N Tools - GraphRAG icon

N8N Tools - GraphRAG

AI Tool for GraphRAG operations: document processing, knowledge graphs, vector search, and intelligent analysis. Can be used by AI agents.

Actions9

Overview

This node, named "N8N Tools - GraphRAG," provides an AI-powered tool for querying knowledge graphs constructed from document data. Specifically, the Graph Construction resource with the Query operation allows users to submit queries against a knowledge graph built from processed documents and vector embeddings. It supports advanced configurations including external vector and graph databases as well as optional Large Language Model (LLM) enhancements for deeper analysis.

Common scenarios where this node is beneficial include:

  • Retrieving structured insights or relationships from large document collections.
  • Performing semantic queries on knowledge graphs enhanced by vector search.
  • Integrating graph database queries with AI-driven natural language understanding.
  • Enhancing query results using LLMs for more contextual or summarized answers.

Practical example:

  • A user inputs a corpus of company reports into the system, builds a knowledge graph, and then uses this node to query relationships between entities such as products, markets, and competitors, optionally leveraging an LLM to generate a concise summary of findings.

Properties

Name Meaning
Input Data Document text or data to process and query against the knowledge graph.
Additional Options Collection of options to customize processing:
β€’ Language: English, Portuguese, Spanish, French
β€’ Result Limit: Maximum number of results to return
β€’ Chunk Size: Size of text chunks for processing
β€’ Chunk Overlap: Overlap between text chunks
Database Configuration Configure external vector and graph databases:
β€’ Vector Database: Local (FAISS/ChromaDB), Pinecone, Weaviate, Qdrant, Milvus
β€’ Vector DB Connection URL and API Key (for external vector DBs)
β€’ Graph Database: Local (NetworkX), Neo4j, ArangoDB, Amazon Neptune
β€’ Graph DB Connection URL, Username, Password, Database Name (depending on provider)
β€’ AWS credentials and region for Amazon Neptune
πŸ€– LLM Enhancement Configure Large Language Model enhancement:
β€’ Enable LLM Enhancement (true/false)
β€’ LLM Provider: N8N Tools internal service, OpenAI GPT models, Anthropic Claude models
β€’ LLM Model: specific model selection depending on provider (e.g., GPT-4o Mini, GPT-4o, Claude Haiku, Claude Sonnet)

Output

The node outputs a JSON object containing the response from the GraphRAG API. This typically includes the results of the knowledge graph query, which may be structured data representing nodes, edges, or query answers derived from the graph and vector search.

If LLM enhancement is enabled, the output may also contain enriched or summarized insights generated by the selected language model.

No binary data output is indicated.

Example output structure (conceptual):

{
  "results": [
    {
      "entity": "Example Entity",
      "relation": "related_to",
      "target": "Another Entity",
      "score": 0.95
    }
  ],
  "summary": "Optional LLM-generated summary if enabled"
}

Dependencies

  • Requires an API key credential for the N8N Tools API service (n8nToolsApi).
  • Optional external vector databases: FAISS/ChromaDB (local), Pinecone, Weaviate, Qdrant, Milvus.
  • Optional external graph databases: NetworkX (local), Neo4j, ArangoDB, Amazon Neptune.
  • For Amazon Neptune, AWS credentials (Access Key ID, Secret Access Key) and region configuration are required.
  • Optional LLM providers require appropriate API access configured in n8n (OpenAI, Anthropic, or internal N8N Tools).

Troubleshooting

  • Authentication errors: Ensure the API key for the N8N Tools API and any external database credentials are correctly set and valid.
  • Connection issues: Verify URLs and network accessibility for external vector and graph databases.
  • Invalid input data: Confirm that the input document text or query string is properly formatted and not empty.
  • Exceeded result limits: If too many results are requested, reduce the "Result Limit" property.
  • LLM errors: If LLM enhancement is enabled but fails, check API keys and model availability for the chosen provider.
  • Error messages: The node throws errors prefixed with "GraphRAG Tool error:" followed by the message from the API or internal validation. Use these messages to identify misconfigurations or invalid parameters.

Links and References

Discussion