Overview
Visualizing your knowledge graph helps you:- Understand structure: See how entities and relationships are organized
- Identify clusters: Discover communities and themes in your data
- Debug issues: Spot problems with entity extraction or relationships
- Communicate insights: Share visual representations with stakeholders
Prerequisites
Before visualizing your graph, you need:- A completed GraphRAG index with GraphML snapshots enabled
- Gephi installed on your system
- The Leiden Algorithm plugin for Gephi
Enable GraphML snapshots
GraphML snapshots must be enabled during indexing to generate visualization files.Configure settings.yaml
Open your
settings.yaml and ensure GraphML snapshots are enabled:settings.yaml
Visualization workflow
Follow these steps to create a professional graph visualization:1. Import into Gephi
2. Install Leiden Algorithm plugin
The Leiden algorithm detects communities in your graph, which is essential for meaningful visualization.Find Leiden Algorithm
- Click the Available Plugins tab
- Search for “Leiden Algorithm”
- Check the box next to it
- Click Install
3. Run statistics
Generate statistics that will help you visualize the graph structure.Calculate Average Degree
In the Statistics panel (right side):
- Find Average Degree
- Click Run
- Click Close on the report dialog
4. Color nodes by cluster
Color-code nodes based on their community membership.Configure node colors
- Click the Nodes tab
- Click Partition (not Ranking)
- Click the color palette icon in the upper right
- Select Cluster from the dropdown
Generate color palette
- Click Palette…
- Click Generate…
- Uncheck Limit number of colors
- Click Generate
- Click OK
5. Resize nodes by degree centrality
Make important nodes (with many connections) larger.Select ranking mode
In the Appearance panel:
- Ensure Nodes is selected
- Click Ranking (not Partition)
- Click the sizing icon (three circles of different sizes)
6. Layout the graph
Arrange nodes spatially to reveal structure.Step 1: OpenORD layout
Configure settings
Set the following stage iterations:
- Liquid: 50
- Expansion: 50
- Cooldown: 0
- Crunch: 0
- Simmer: 0
Step 2: ForceAtlas2 layout
Configure settings
Adjust the following settings:
- Scaling: 15
- Dissuade Hubs: ✓ checked
- LinLog mode: ✗ unchecked
- Prevent Overlap: ✓ checked
7. Add labels (optional)
Display entity names on the visualization.Configure label appearance
- Click the label settings button
- Adjust:
- Font size: Based on your preference
- Show labels: For visible nodes only
- Label color: Black or contrasting color
Understanding your visualization
Graph elements
Nodes
Represent entities extracted from your documents (people, organizations, concepts)
Edges
Represent relationships between entities
Colors
Indicate communities - groups of closely related entities
Size
Indicates centrality - how many connections an entity has
Interpreting patterns
Dense clusters: Topics or themes with many interconnected entities Bridge nodes: Entities connecting different communities (often important cross-cutting concepts) Peripheral nodes: Mentioned infrequently or in isolation Star patterns: Central entities with many direct connections (key people, organizations, or concepts)Export and share
Export as image
Configure preview
Adjust settings for best appearance:
- Preset: Default
- Background color: White
- Show labels: As desired
Export interactive version
Gephi can export interactive web visualizations:- Install the Sigma Exporter plugin
- Go to File → Export → Sigma.js template
- Configure and export to create an interactive HTML visualization
Advanced techniques
Filter by community
Focus on specific communities:Size by other metrics
You can size nodes by different centrality measures:- Betweenness centrality: Nodes that connect different parts of the graph
- Closeness centrality: Nodes close to all others
- Eigenvector centrality: Nodes connected to other important nodes
Multi-level analysis
GraphRAG’s Leiden algorithm creates hierarchical communities. To visualize different levels:- Run Leiden multiple times with different resolution parameters
- Create separate visualizations for each level
- Compare to see how communities nest within each other
Troubleshooting
Graph appears as a dense ball
Graph appears as a dense ball
Solution:
- Run ForceAtlas2 longer (it may take time to untangle)
- Increase Scaling parameter to 20-30
- Enable Prevent Overlap
- Try Fruchterman Reingold layout instead
Nodes are all the same color
Nodes are all the same color
Solution:
- Ensure you ran the Leiden Algorithm
- Check that you selected Partition not Ranking
- Verify Cluster appears in the dropdown
- Re-run Leiden if needed
Cannot find graph.graphml file
Cannot find graph.graphml file
Solution:
- Verify
snapshots.graphml: truein settings.yaml - Re-run indexing with snapshots enabled
- Check the
storage.base_dirsetting for output location
Gephi crashes or runs slowly
Gephi crashes or runs slowly
Solution:
- Increase Gephi’s memory allocation
- Filter the graph to show fewer nodes
- Use a more powerful machine for large graphs
- Consider sampling your data before indexing
Example workflow summary
Here’s the complete process at a glance:Next steps
Configuration
Learn about all configuration options
Best practices
Optimize your GraphRAG workflow
Query methods
Learn different search approaches
Data model
Understand the output schema