-
Notifications
You must be signed in to change notification settings - Fork 2
GraphRAG Integration Quickstart
Rick Hightower edited this page Feb 1, 2026
·
1 revision
Feature: 113-graphrag-integration Date: 2026-01-30
This guide shows how to enable and use the GraphRAG feature in Agent Brain.
- Agent Brain installed and working
- Documents indexed (vector + BM25)
- OpenAI API key configured (for LLM extraction)
# In your .env file or environment
export ENABLE_GRAPH_INDEX=true# For Kuzu graph store (production)
poetry install --with graphrag-kuzu
# For langextract (enhanced entity extraction)
poetry install --with graphrag# Using CLI
agent-brain index /path/to/docs --rebuild
# Or via API
curl -X POST http://localhost:8000/index \
-H "Content-Type: application/json" \
-d '{"path": "/path/to/docs", "rebuild": true}'Find results based on entity relationships:
# CLI
agent-brain query "authentication" --mode graph
# API
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"query": "authentication",
"mode": "graph",
"top_k": 10,
"traversal_depth": 2
}'Combine vector, BM25, and graph for best results:
# CLI
agent-brain query "user login flow" --mode multi
# API
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"query": "user login flow",
"mode": "multi",
"top_k": 5
}'| Variable | Default | Description |
|---|---|---|
ENABLE_GRAPH_INDEX |
false |
Enable/disable GraphRAG |
GRAPH_STORE_TYPE |
simple |
simple (JSON) or kuzu (embedded DB) |
GRAPH_MAX_TRIPLETS_PER_CHUNK |
10 |
Limit entities per chunk |
GRAPH_USE_CODE_METADATA |
true |
Extract from code AST |
GRAPH_USE_LLM_EXTRACTION |
true |
Use LLM for docs |
GRAPH_TRAVERSAL_DEPTH |
2 |
Default query depth |
# CLI
agent-brain status
# API
curl http://localhost:8000/health/statusExample output:
{
"status": "healthy",
"indexing_status": "ready",
"document_count": 1500,
"graph_index": {
"enabled": true,
"initialized": true,
"entity_count": 3200,
"relationship_count": 8500,
"store_type": "simple"
}
}Rebuild just the graph index without re-indexing documents:
curl -X POST "http://localhost:8000/index?rebuild_graph=true"# Check if enabled
echo $ENABLE_GRAPH_INDEX
# Enable it
export ENABLE_GRAPH_INDEX=true
# Restart server
agent-brain stop && agent-brain startCheck logs for extraction errors:
agent-brain logs | grep -i graph- Reduce
GRAPH_TRAVERSAL_DEPTH(default: 2) - Use Kuzu for larger indexes:
export GRAPH_STORE_TYPE=kuzu
Query for all modules that import a specific class:
agent-brain query "modules that import AuthService" --mode graphThis will traverse import relationships to find related code.
- Design-Architecture-Overview
- Design-Query-Architecture
- Design-Storage-Architecture
- Design-Class-Diagrams
- GraphRAG-Guide
- Agent-Skill-Hybrid-Search-Guide
- Agent-Skill-Graph-Search-Guide
- Agent-Skill-Vector-Search-Guide
- Agent-Skill-BM25-Search-Guide
Search
Server
Setup
- Pluggable-Providers-Spec
- GraphRAG-Integration-Spec
- Agent-Brain-Plugin-Spec
- Multi-Instance-Architecture-Spec