GraphRAG Toolkit

v1.0.0Data Science & MLstable

Python toolkit for building graph-enhanced GenAI applications

amazon-neptuneamazon-opensearch-serverlessgraph-databasegraphragllama-index
Share:
399
Stars
0
Downloads
0
Weekly
0/5

What is GraphRAG Toolkit?

GraphRAG Toolkit is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to python toolkit for building graph-enhanced genai applications

Python toolkit for building graph-enhanced GenAI applications

This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Python toolkit for building graph-enhanced GenAI application

Use Cases

Graph-enhanced GenAI applications
Graph database integration
LlamaIndex compatibility
awslabs

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx graphrag-toolkit

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use GraphRAG Toolkit

The GraphRAG Toolkit is an AWS Labs Python library for building graph-enhanced Generative AI (GenAI) applications that combine knowledge graphs with LLM-based question answering. It provides two main components: a Lexical Graph framework that automatically builds hierarchical graphs from unstructured documents, and a BYOKG-RAG (Bring Your Own Knowledge Graph) system for graph-traversal-based retrieval. The toolkit integrates with Amazon Neptune, Amazon OpenSearch Serverless, Neo4j, FalkorDB, and PostgreSQL as storage backends, and is compatible with LlamaIndex.

Prerequisites

  • Python 3.9+ installed
  • AWS account with Amazon Neptune or Amazon OpenSearch Serverless configured (for AWS-hosted storage backends)
  • Alternatively, a self-hosted graph database such as Neo4j or FalkorDB
  • pip for installing the Python packages
  • An LLM provider API key (e.g., AWS Bedrock, OpenAI) for the GenAI components
1

Install the Lexical Graph Package

Install the core GraphRAG toolkit package from PyPI. Choose the appropriate package for your use case — lexical-graph for document ingestion pipelines, or byokg-rag for querying existing knowledge graphs.

# For document ingestion and lexical graph construction:
pip install graphrag-lexical-graph

# For querying existing knowledge graphs:
pip install graphrag-toolkit-byokg-rag
2

Configure Your Graph Store Connection

Initialize graph and vector store connections using the factory methods. The toolkit supports Neptune, Neo4j, FalkorDB for graph storage and Neptune, OpenSearch, Postgres, S3 for vector storage.

from graphrag_toolkit.storage import GraphStoreFactory, VectorStoreFactory

# Amazon Neptune example:
graph_store = GraphStoreFactory.for_graph_store(
    'neptune-db://your-cluster.cluster-xxxx.us-east-1.neptune.amazonaws.com:8182'
)

# Amazon OpenSearch Serverless example:
vector_store = VectorStoreFactory.for_vector_store(
    'aoss://your-collection.us-east-1.aoss.amazonaws.com'
)
3

Build a Lexical Graph from Documents

Use LexicalGraphIndex to ingest documents and automatically construct a hierarchical knowledge graph.

from graphrag_toolkit.indexing import LexicalGraphIndex
from llama_index.core import SimpleDirectoryReader

# Load your documents
documents = SimpleDirectoryReader('./docs').load_data()

# Build the graph
index = LexicalGraphIndex(
    graph_store=graph_store,
    vector_store=vector_store
)
index.extract_and_build(documents, show_progress=True)
4

Query with Graph-Enhanced RAG

Query the constructed graph using semantic-guided or traversal-based retrieval strategies.

from graphrag_toolkit.retrieval import GraphRAGQueryEngine

query_engine = GraphRAGQueryEngine(
    graph_store=graph_store,
    vector_store=vector_store
)

response = query_engine.query(
    "What are the key relationships between the entities in these documents?"
)
print(response)
5

Configure MCP Server Access

To expose GraphRAG capabilities via MCP, configure Claude Desktop to run the toolkit's MCP server script with your database connection details passed as environment variables.

{
  "mcpServers": {
    "graphrag-toolkit": {
      "command": "python",
      "args": ["-m", "graphrag_toolkit.mcp"],
      "env": {
        "NEPTUNE_ENDPOINT": "neptune-db://your-cluster.cluster-xxxx.us-east-1.neptune.amazonaws.com:8182",
        "AOSS_ENDPOINT": "aoss://your-collection.us-east-1.aoss.amazonaws.com",
        "AWS_DEFAULT_REGION": "us-east-1"
      }
    }
  }
}

GraphRAG Toolkit Examples

Client configuration

Claude Desktop configuration for graphrag-toolkit pointing to an Amazon Neptune graph store and OpenSearch vector store.

{
  "mcpServers": {
    "graphrag-toolkit": {
      "command": "python",
      "args": ["-m", "graphrag_toolkit.mcp"],
      "env": {
        "NEPTUNE_ENDPOINT": "neptune-db://my-cluster.cluster-abc123.us-east-1.neptune.amazonaws.com:8182",
        "AOSS_ENDPOINT": "aoss://my-vectors.us-east-1.aoss.amazonaws.com",
        "AWS_DEFAULT_REGION": "us-east-1"
      }
    }
  }
}

Prompts to try

Example queries that leverage graph-enhanced retrieval for richer, more connected answers.

- "What entities are mentioned in my documents and how are they related?"
- "Compare the GraphRAG approach to standard vector similarity search for this query"
- "Find all documents connected to the concept of 'data ingestion' in the knowledge graph"
- "Summarize the key themes and their relationships from the ingested document set"

Troubleshooting GraphRAG Toolkit

Connection timeout when connecting to Amazon Neptune

Neptune requires VPC access. Ensure your Lambda or EC2 instance is in the same VPC as your Neptune cluster, or set up a VPC endpoint. Local development typically requires an SSH tunnel or VPN connection.

ImportError when importing graphrag_toolkit modules

Make sure you installed the correct package for your use case. 'graphrag-lexical-graph' and 'graphrag-toolkit-byokg-rag' are separate packages. Check with 'pip list | grep graphrag' and install the missing one.

LLM extraction produces empty or malformed graph nodes

The toolkit relies on an LLM for entity/relationship extraction during ingestion. Ensure your LLM provider is configured correctly and that the model has sufficient context window size for your documents. Try chunking large documents into smaller pieces.

Frequently Asked Questions about GraphRAG Toolkit

What is GraphRAG Toolkit?

GraphRAG Toolkit is a Model Context Protocol (MCP) server that python toolkit for building graph-enhanced genai applications It connects AI assistants to external tools and data sources through a standardized interface.

How do I install GraphRAG Toolkit?

Follow the installation instructions on the GraphRAG Toolkit GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with GraphRAG Toolkit?

GraphRAG Toolkit works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is GraphRAG Toolkit free to use?

Yes, GraphRAG Toolkit is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Data Science & ML MCP Servers

Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "graphrag-toolkit": { "command": "npx", "args": ["-y", "graphrag-toolkit"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use GraphRAG Toolkit?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides