Several users have asked if they can bring their own existing graph and have it summarized for query with GraphRAG. This page describes a simple method that aligns with the existing GraphRAG workflows.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/microsoft/graphrag/llms.txt
Use this file to discover all available pages before exploring further.
Overview
To cover the basic use cases for GraphRAG query, you should have two or three tables derived from your data:
The approach is to run a custom GraphRAG workflow pipeline that assumes text chunking, entity extraction, and relationship extraction have already occurred.
Required tables
Entities
For graph summarization purposes, you need the following fields from the full entities schema:| Field | Type | Required | Description |
|---|---|---|---|
id | str | Yes | Unique identifier for the entity |
title | str | Yes | Name of the entity |
description | str | Yes | Textual description of the entity |
text_unit_ids | str[] | Optional | List of source text chunks (if available) |
Example entities.parquet
Example entities.parquet
Relationships
For graph summarization purposes, you need the following fields from the full relationships schema:| Field | Type | Required | Description |
|---|---|---|---|
id | str | Yes | Unique identifier for the relationship |
source | str | Yes | Name of the source entity |
target | str | Yes | Name of the target entity |
description | str | Yes | Description of the relationship |
weight | float | Yes | Edge weight (important for Leiden communities!) |
text_unit_ids | str[] | Optional | List of source text chunks (if available) |
Example relationships.parquet
Example relationships.parquet
Text units (optional)
Text units are chunks of your documents sized to fit into the context window of your model. Some search methods use these. See the full text_units schema for all fields.Example text_units.parquet
Example text_units.parquet
Workflow configuration
GraphRAG allows you to specify only the specific workflow steps you need. For basic graph summarization and query, configure the following in yoursettings.yaml:
- Global search only
- All search types
- FastGraphRAG variant
For Global Search (community-based summarization):This will:
settings.yaml
- Run Leiden community detection on your graph
- Generate LLM-based community reports
This is the minimal configuration for GraphRAG Global Search.
Setup steps
Here’s how to put it all together:Prepare your data
Create Parquet files for entities and relationships (and optionally text_units) following the schemas above.
Run indexing
Run the GraphRAG indexer:This will:
- Skip document loading and graph extraction (already done)
- Perform community detection on your existing graph
- Generate community reports
- (Optionally) generate embeddings
Complete example
Here’s a complete end-to-end example:convert_graph.py
Configuration file
Here’s a completesettings.yaml for bring-your-own-graph scenarios:
settings.yaml
Limitations and considerations
Missing descriptions
Missing descriptions
If your graph doesn’t have entity or relationship descriptions:
- Use
create_community_reports_textinstead ofcreate_community_reports - Ensure you have text_units with valid entity/relationship links
- Consider adding synthetic descriptions based on entity names/types
Edge weights
Edge weights
Edge weights are critical for Leiden community detection:
- Provide meaningful weights (0.0 to 1.0 recommended)
- Higher weight = stronger connection
- If unknown, use 1.0 for all edges
Text units
Text units
Text units are optional for Global Search but required for:
- Local Search
- DRIFT Search
- Text-based community reports
Graph size
Graph size
For large graphs:
- Adjust
max_cluster_sizeincluster_graphsettings - Consider using
use_lcc: trueto focus on the main component - Community detection may take significant time
Next steps
Outputs
Understand the output table schemas
Querying
Learn how to query your graph
Global search
Use community-based search on your graph
Configuration
Configure community detection parameters