graphrag-toolkit
Python toolkit for building graph-enhanced GenAI applications
claude mcp add --transport stdio awslabs-graphrag-toolkit python -m graphrag_toolkit
How to use
The GraphRAG Toolkit is a collection of Python tools designed to simplify building graph-enhanced generative AI applications. It includes components for constructing and querying a hierarchical lexical graph (Lexical Graph) and modules related to knowledge graph question answering (BYOKG-RAG). Once installed, you run the toolkit as a Python module, which exposes CLI-like capabilities and programmatic interfaces for integrating graph-based retrieval and reasoning into your AI workflows. Use the Lexical Graph component to automatically build and query a hierarchical lexical graph from unstructured data, and pair it with graph-aware QA strategies to improve accuracy over standard vector-based retrieval. The BYOKG-RAG portion lets you bring your own knowledge graph and perform complex QA over it, enabling more precise answers grounded in your existing data.
How to install
Prerequisites:
- Python 3.8 or newer
- pip (usually included with Python)
- Optional: virtual environment tool (e.g., venv, virtualenv)
Installation steps:
-
Create and activate a virtual environment (recommended)
- macOS/Linux: python3 -m venv venv source venv/bin/activate
- Windows: python -m venv venv .\venv\Scripts\activate
-
Upgrade pip
- python -m pip install --upgrade pip
-
Install the graphrag-toolkit package
- pip install graphrag-toolkit Note: If the package name differs in your environment, install the package that provides graphrag_toolkit as a module.
-
Verify installation
- python -m graphrag_toolkit --version
-
Run the toolkit module (example)
- python -m graphrag_toolkit If you need a specific submodule (e.g., lexical-graph tooling), invoke the corresponding entry point as documented in the project docs.
Optional: If you prefer not to install system-wide, use a virtual environment or container to isolate dependencies.
For advanced usage, refer to the project documentation for any CLI flags, configuration files, or environment variables that control graph construction, QA strategies, and data sources.
Additional notes
Tips and considerations:
- Environment variables: Some deployments may require configuring API keys, database connections, or service endpoints. Prepare a dotenv or environment variable file if your deployment environment requires it.
- Data sources: The Lexical Graph component builds graphs from unstructured data; ensure your input data is accessible to the module (e.g., local files, cloud storage, or feed endpoints).
- Performance: Large lexical graphs can be memory-intensive. Consider running in a container with sufficient RAM or using streaming/partial graph construction when dealing with very large datasets.
- Compatibility: Ensure your Python version and dependencies match the tool’s requirements. Use a virtual environment to avoid conflicts with other packages.
- Troubleshooting: If the module cannot be found, verify the installation path and PYTHONPATH, and ensure you are invoking the correct module name (graphrag_toolkit vs graphrag_toolkit) as provided by the package.
- Documentation: Refer to the official GraphRAG Toolkit docs for CLI options, module APIs, and examples for Lexical Graph and BYOKG-RAG workflows.
Related MCP Servers
ApeRAG
ApeRAG: Production-ready GraphRAG with multi-modal indexing, AI agents, MCP support, and scalable K8s deployment
pokemon-chat
基于 LightRAG、LangGraph、MCP、RagFlow、微调LLMs宝可梦主题的智能聊天助手
langconnect-client
A Modern GUI Interface for Vector Database Management(Supports MCP integration)
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
jmeter
✨ JMeter Meets AI Workflows: Introducing the JMeter MCP Server! 🤯
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian