Skip to content

Version 1.5 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

HugeGraph-AI

Apache License 2.0 Ask DeepWiki

hugegraph-ai integrates HugeGraph with artificial intelligence capabilities, providing comprehensive support for developers to build AI-powered graph applications.

✨ Key Features

  • GraphRAG: Build intelligent question-answering systems with graph-enhanced retrieval
  • Knowledge Graph Construction: Automated graph building from text using LLMs
  • Graph ML: Integration with 20+ graph learning algorithms (GCN, GAT, GraphSAGE, etc.)
  • Python Client: Easy-to-use Python interface for HugeGraph operations
  • AI Agents: Intelligent graph analysis and reasoning capabilities

🚀 Quick Start

Note

For a complete deployment guide and detailed examples, please refer to hugegraph-llm/README.md

Prerequisites

  • Python 3.9+ (3.10+ recommended for hugegraph-llm)
  • uv (recommended package manager)
  • HugeGraph Server 1.3+ (1.5+ recommended)
  • Docker (optional, for containerized deployment)
 1# Clone the repository
 2git clone https://github.com/apache/incubator-hugegraph-ai.git
 3cd incubator-hugegraph-ai
 4
 5# Set up environment and start services
 6cp docker/env.template docker/.env
 7# Edit docker/.env to set your PROJECT_PATH
 8cd docker
 9docker-compose -f docker-compose-network.yml up -d
10
11# Access services:
12# - HugeGraph Server: http://localhost:8080
13# - RAG Service: http://localhost:8001

Option 2: Source Installation

 1# 1. Start HugeGraph Server
 2docker run -itd --name=server -p 8080:8080 hugegraph/hugegraph
 3
 4# 2. Clone and set up the project
 5git clone https://github.com/apache/incubator-hugegraph-ai.git
 6cd incubator-hugegraph-ai/hugegraph-llm
 7
 8# 3. Install dependencies
 9uv venv && source .venv/bin/activate
10uv pip install -e .
11
12# 4. Start the demo
13python -m hugegraph_llm.demo.rag_demo.app
14# Visit http://127.0.0.1:8001

Basic Usage Examples

GraphRAG - Question Answering

 1from hugegraph_llm.operators.graph_rag_task import RAGPipeline
 2
 3# Initialize RAG pipeline
 4graph_rag = RAGPipeline()
 5
 6# Ask questions about your graph
 7result = (graph_rag
 8    .extract_keywords(text="Tell me about Al Pacino.")
 9    .keywords_to_vid()
10    .query_graphdb(max_deep=2, max_graph_items=30)
11    .synthesize_answer()
12    .run())

Knowledge Graph Construction

 1from hugegraph_llm.models.llms.init_llm import LLMs
 2from hugegraph_llm.operators.kg_construction_task import KgBuilder
 3
 4# Build KG from text
 5TEXT = "Your text content here..."
 6builder = KgBuilder(LLMs().get_chat_llm())
 7
 8(builder
 9    .import_schema(from_hugegraph="hugegraph")
10    .chunk_split(TEXT)
11    .extract_info(extract_type="property_graph")
12    .commit_to_hugegraph()
13    .run())

Graph Machine Learning

1from pyhugegraph.client import PyHugeClient
2# Connect to HugeGraph and run ML algorithms
3# See hugegraph-ml documentation for detailed examples

📦 Modules

hugegraph-llm Ask DeepWiki

Large language model integration for graph applications:

  • GraphRAG: Retrieval-augmented generation with graph data
  • Knowledge Graph Construction: Build KGs from text automatically
  • Natural Language Interface: Query graphs using natural language
  • AI Agents: Intelligent graph analysis and reasoning

hugegraph-ml

Graph machine learning with 20+ implemented algorithms:

  • Node Classification: GCN, GAT, GraphSAGE, APPNP, etc.
  • Graph Classification: DiffPool, P-GNN, etc.
  • Graph Embedding: DeepWalk, Node2Vec, GRACE, etc.
  • Link Prediction: SEAL, GATNE, etc.

hugegraph-python-client

Python client for HugeGraph operations:

  • Schema Management: Define vertex/edge labels and properties
  • CRUD Operations: Create, read, update, delete graph data
  • Gremlin Queries: Execute graph traversal queries
  • REST API: Complete HugeGraph REST API coverage

📚 Learn More

🤝 Contributing

We welcome contributions! Please see our contribution guidelines for details.

Development Setup:

  • Use GitHub Desktop for easier PR management
  • Run ./style/code_format_and_analysis.sh before submitting PRs
  • Check existing issues before reporting bugs

View the HugeGraph-AI contributors.

📄 License

hugegraph-ai is licensed under Apache 2.0 License.

📞 Contact Us

Apache HugeGraph WeChat QR Code{width=“200” height=“63”}