GraphRAG Guide

Source-accurate engine understanding for your AI. Available in the Pro and Team Studio editions; indexes more than 16 million nodes across all 27 UE5 versions.

What Is UE-GraphRAG?

AgentUX ships with UE-GraphRAG, a knowledge base built directly from UE source code. It gives Claude source-code-level understanding of every class, function, property, module, plugin, CVar, and documentation page in the engine. The Pro edition indexes more than 16 million nodes across all 27 UE5 versions (5.0.0 through 5.7.4 plus NvRTX) with full version awareness. Team Studio adds shared multi-user access plus indexing of your studio's custom engine forks.

Here's the problem: AI models have a training cutoff. They don't know about APIs that changed last month, and they can't look up exact property names on the fly. So they guess, and sometimes they're wrong. GraphRAG fixes that. It's built directly from the UE source tree, so your AI always has version-accurate knowledge instead of stale training data.

Key Statistics

16M+
Total Nodes (Pro)
27
UE5 Versions (Pro)
2,313
Modules
716
Plugins
9,602
CVars
14,857
Doc Chunks
33
MCP Tools

How It Works

Under the hood, GraphRAG uses two storage backends for different kinds of questions:

  • Neo4j: Graph database for structural queries: class hierarchies, module relationships, function signatures, inheritance chains, and version-scoped lookups
  • LanceDB: Vector database for semantic queries: natural language search over source code and documentation using ONNX embeddings

When Claude needs to verify a property name or explore an API, it picks the right MCP tool. Structural queries like get_class_details and get_class_hierarchy hit Neo4j directly and return in 4-45ms. Fast enough that Claude doesn't even pause. Semantic queries like search_ue_source run through LanceDB vector search, coming back in under 300ms.

MCP Tool Reference

GraphRAG is exposed through 34 MCP tools organized into six categories (the sixth is the Experience system covered later on this page):

Category Tools Backend
Source Code search_ue_source, search_ue_class, get_class_details, get_class_hierarchy, get_function_signature, find_api_surface, find_related_classes Neo4j + LanceDB
Modules & Plugins list_modules, get_module_info, list_plugins, search_by_plugin Neo4j
Documentation search_ue_docs, get_doc_page, get_ue_guidance LanceDB + Neo4j
Parameters search_params, get_param_details Neo4j + LanceDB
Versioning list_versions, get_version_diff, get_version_history Neo4j

All tools accept an optional ue_version parameter for version-scoped queries. See Multi-Version Queries below.

Source Code Tools

search_ue_source: Semantic Source Code Search

Search the entire UE source tree using natural language. Uses vector embeddings to find the most relevant classes, functions, and module summaries.

# Find how actors are spawned
search_ue_source(query="how to spawn an actor in the world")

# Find Niagara particle system creation code
search_ue_source(query="create particle system emitter", plugin_name="Niagara")

# Find editor subsystem classes only
search_ue_source(query="editor subsystem for asset management", chunk_type="class", category="Editor")

get_class_details: Full Class Information

Get complete details for a UE class: inheritance chain, all functions with signatures, properties, delegates, module, and file path. Always use this before guessing UPROPERTY or UFUNCTION names.

# Get all properties and functions on a fog component
get_class_details(class_name="UExponentialHeightFogComponent")
# Returns: FogDensity (float), bEnableVolumetricFog (bool), VolumetricFogAlbedo (FLinearColor), etc.

Important: Property names are case-sensitive. FogDensity is correct; fogDensity, Density, and fog_density are all wrong and will silently fail.

get_class_hierarchy: Inheritance Tree

Get ancestors, descendants, or both for any class. Essential for finding where inherited properties are defined.

# Find where Intensity is defined in the light hierarchy
get_class_hierarchy(class_name="USpotLightComponent", direction="up")
# Returns: USpotLightComponent -> UPointLightComponent -> ULocalLightComponent -> ULightComponent
# Intensity, LightColor, Temperature are on ULightComponent (parent)

find_api_surface: Blueprint/Exec Callable Functions

Find functions with specific UFUNCTION specifiers on a class or module.

# Find all BlueprintCallable functions on a fog component
find_api_surface(target="UExponentialHeightFogComponent", specifiers=["BlueprintCallable"])
# Returns: SetFogDensity(float), SetVolumetricFog(bool), etc.

Documentation Tools

search_ue_docs: Semantic Documentation Search

Search ~14,857 doc chunks from C++ API descriptions, UDN tooltips, Blueprint API docs, and community guides.

# How does dynamic lighting work?
search_ue_docs(query="how to set up dynamic lighting")

# Actor lifecycle
search_ue_docs(query="actor lifecycle initialization order")

get_ue_guidance: Best Practices & Patterns

Search curated guidance: community guides, best practices, code examples, and design patterns.

# GAS best practices
get_ue_guidance(query="Gameplay Ability System best practices", topic="gameplay-ability-system")

# Plugin architecture patterns
get_ue_guidance(query="how to structure a UE5 C++ plugin")

Versioning Tools

get_version_diff: Compare Class Between Versions

Compare a class between two UE versions, showing added/removed/changed functions and properties.

# What changed in AActor between UE 5.4 and 5.5?
get_version_diff(class_name="AActor", from_version="5.4.0", to_version="5.5.0")

get_version_history: Class Lifecycle Across All Versions

Track when a class was introduced, removed, and how it evolved across all 27 indexed releases (5.0.0 through 5.7.4 plus NvRTX).

# When was PCGGraph introduced?
get_version_history(class_name="UPCGGraph")
# Returns: first appeared in 5.2.0, per-version function/property counts

Common Workflows

Before Writing UE C++ Code

Always verify names before writing code that references UE types:

# 1. Find the class
search_ue_class(pattern="ExponentialHeightFog")
# -> AExponentialHeightFog

# 2. Get exact property names
get_class_details(class_name="UExponentialHeightFogComponent")
# -> FogDensity (float), NOT "Density" or "fogDensity"

# 3. Find callable functions
find_api_surface(target="UExponentialHeightFogComponent", specifiers=["BlueprintCallable"])
# -> SetFogDensity(float), SetVolumetricFog(bool)

# 4. Check parent classes for inherited properties
get_class_hierarchy(class_name="UExponentialHeightFogComponent", direction="up")

Combining Editor Control with GraphRAG

Use GraphRAG to look up the correct API, then use AgentUX editor commands:

# 1. Look up the correct property name
get_class_details(class_name="UDirectionalLightComponent")
# -> Intensity is on parent ULightComponent

# 2. Verify via hierarchy
get_class_hierarchy(class_name="UDirectionalLightComponent", direction="up")

# 3. Use AgentUX to set it
{"method": "editor.rc.property", "params": {
  "path": "/Game/Maps/Main.Main:PersistentLevel.DirectionalLight.LightComponent0",
  "property": "Intensity", "value": 10.0, "access": "WRITE"
}}

Exploring a Plugin

# 1. Browse plugin contents
search_by_plugin(plugin_name="PCG", limit=50)

# 2. Drill into a specific class
get_class_details(class_name="UPCGGraph")

# 3. Find related classes
find_related_classes(class_name="UPCGGraph")

Understanding a System

# 1. Semantic search for the concept
search_ue_source(query="world partition streaming levels")

# 2. Read the documentation
search_ue_docs(query="world partition streaming setup")

# 3. Get best practices
get_ue_guidance(query="world partition best practices")

# 4. Find relevant CVars
search_params(query="world partition streaming", system="CVar")

Multi-Version Queries

All tools accept a ue_version parameter with these values:

Value Behavior
(omitted)Defaults to the latest indexed version (currently 5.7.4)
"5.5.0"Exact version match
"5.5"Matches the latest patch in the 5.5 series
"latest"Resolves to the latest indexed version
"all"Cross-version query that searches across all indexed versions (Pro only)
# Get AActor's API in UE 5.4
get_class_details(class_name="AActor", ue_version="5.4.0")

# Cross-version search
search_ue_class(pattern="NaniteStaticMesh*", ue_version="all")

Safety Enhancement

GraphRAG powers the second layer of AgentUX's safety system. With 7,350+ indexed assertions from the engine source, your AI gets warned about dangerous preconditions before triggering them.

  • Layer 1 (Hardcoded Guards) (always active): Block known unsafe operations like saving during PIE
  • Layer 2 (GraphRAG-Enhanced) (when connected): Queries the knowledge base for check() and ensure() calls, covering thousands of additional edge cases per session

Without GraphRAG, Layer 1 still provides core safety. With GraphRAG, coverage expands dramatically, especially for operations on less-common classes where hardcoded guards may not exist.

Performance

Operation Latency Notes
Neo4j cold start~5.5sJVM + database startup
MCP server startup~2sNeo4j connect + verify
First semantic query~18sOne-time ONNX model load (~600MB)
Warm semantic query~300msEmbed + vector search combined
Per-query embedding~31msAfter model is loaded
Structural queries4–45msClass lookup, hierarchy traversal
Vector search63–290ms~290ms source, ~63ms docs

Structural graph queries (get_class_details, get_class_hierarchy) are fast from the start since they don't use embeddings. The one-time ~18s delay only applies to the first semantic search tool call.

Tip: Start Neo4j as a Windows service (neo4j install-service && neo4j start) so it's always running when the editor launches.

Neo4j Setup

GraphRAG requires Neo4j Community Server 5.x. If you haven't installed it yet:

  1. Download Neo4j Community Edition 5.x
  2. Ensure Java 21+ is installed
  3. Extract and start:
    neo4j console
  4. Verify at bolt://localhost:7687
  5. Run the AgentUX installer to populate the database:
    python install.py

For persistent background operation on Windows:

neo4j install-service
neo4j start

Troubleshooting

Neo4j connection errors

  • Verify Neo4j is running: neo4j status
  • Check that bolt://localhost:7687 is accessible
  • Verify Java 21+ is installed: java -version

Slow first query

The first semantic query loads the ONNX embedding model (~600MB). This is a one-time cost per session. Subsequent queries complete in under 300ms. If Neo4j is cold, add ~6 seconds for JVM startup.

MCP server not connecting

  • Verify GRAPHRAG_CONFIG env var points to the correct config.yaml
  • Run python install.py --skip-deps to reconfigure
  • Check that LanceDB data is present at the configured path

Stale or missing data

If the knowledge base seems incomplete or outdated, rebuild it from the source docs. See the Installation Guide's GraphRAG Setup section.

Tips

  • Always verify names: UE property and function names are case-sensitive. A wrong name silently fails. Use get_class_details before guessing.
  • Check parent classes: Many properties are inherited. Use get_class_hierarchy(direction="up") to find where a property is defined.
  • Use semantic search for concepts: search_ue_source and search_ue_docs understand natural language.
  • Struct parameters: Functions with struct parameters often can't be called via editor.rc.call. Use editor.rc.property WRITE instead.
  • Combine tools: Use search_ue_docs for "how it works", get_ue_guidance for "how to do it well", and search_ue_source for "show me the code".
  • Version shorthand: Use "5.5" instead of "5.5.0". It auto-resolves to the latest patch.
  • Default version: If you omit ue_version, queries run against the latest indexed version. You usually don't need to specify a version for current-engine work.

Experience System (Pro)

Pro and Team Studio editions only. The experience system is not available in Free.

GraphRAG gives your AI static knowledge about the engine. The experience system adds something different: knowledge learned from actually using it. When Claude discovers something non-obvious during a session (an API that behaves differently than expected, a call ordering that matters, a silent failure), it captures that discovery and stores it in Neo4j. Future sessions retrieve relevant knowledge automatically, so the same mistakes don't happen twice.

flowchart LR
    A["Capture\n\nClaude discovers\nsomething non-obvious"] --> B["Classify\n\nAssign importance tier\nquick-tip to never-forget"]
    B --> C["Store\n\nSession-end hook\nwrites to Neo4j"]
    C --> D["Retrieve\n\nNext session queries\nrelevant knowledge"]
    D --> A
    C --> E["Maintain\n\nPeriodic pruning\nrespects tiers"]
    E --> C

    style A fill:#1e3a5f,stroke:#4a9eff,color:#e0e0e0
    style B fill:#3d3a1a,stroke:#ffa500,color:#e0e0e0
    style C fill:#1a3d2e,stroke:#50c878,color:#e0e0e0
    style D fill:#3d1a3d,stroke:#c77dff,color:#e0e0e0
    style E fill:#3d1a1a,stroke:#ff6b6b,color:#e0e0e0

Every captured entry is classified into one of four importance tiers that control how aggressively it can be pruned:

  • never-forget: Immune to all pruning. You mark these explicitly.
  • hard-won: Learned from real debugging failures. Flagged for human review only, never auto-deleted.
  • life-experience: The default tier. Only pruned if contradicted by newer information.
  • quick-tip: Trivial, easily re-discovered. All pruning checks apply.

Maintenance runs automatically on a loop, applying six checks while respecting tier protections. For the full architecture, diagrams, and maintenance details, see the Knowledge Architecture page.

Getting UE Source Code

Source indexing requires a copy of the Unreal Engine source code. Epic Games hosts the source on GitHub, free for anyone with an Epic Games account. Here's how to get access:

1. Link your GitHub account to Epic Games

  1. Go to unrealengine.com and sign in (or create a free account)
  2. Go to Account > Connected Accounts
  3. Connect your GitHub account
  4. Accept the invitation from the EpicGames GitHub organization (check your email)

Once accepted, you have access to github.com/EpicGames/UnrealEngine. This is a private repository, so it won't appear in search results, but direct links and git commands will work.

2. Clone the source

Pick the version you're developing against. For UE 5.7, the release branch is 5.7:

git clone --branch 5.7 --single-branch --depth 1 https://github.com/EpicGames/UnrealEngine.git UE-5.7-source

The --depth 1 flag skips full history and keeps the download to about 3 GB instead of 50+ GB. You only need the headers and source files, not the commit history.

If you want a specific patch release (e.g., 5.7.3), use the tag instead:

git clone --branch 5.7.3-release --single-branch --depth 1 https://github.com/EpicGames/UnrealEngine.git UE-5.7.3-source

3. Index it

Once you have the source, point rebuild.py at it:

python rebuild.py --ue-source D:\UE-5.7-source

The indexer reads from Engine/Source/ and Engine/Plugins/ inside the directory you provide. It does not compile anything or require Setup.bat to have been run.

Note: You don't need a source build of UE to index the source. The indexer only reads C++ headers and plugin descriptors. Your editor can run on the retail (Epic Games Launcher) build while the indexer works from the cloned source.

Custom Source Trees (Pro)

Pro and Team Studio editions only. Custom source tree indexing is not available in Free. Team Studio extends this to a shared, multi-user knowledge base for studio engine forks.

The pre-built knowledge base covers stock Unreal Engine releases. But if your project runs on a custom engine fork, those stock indexes won't know about your modifications. Pro includes the Python build scripts that generated the pre-built knowledge base, so you can run them against your own source tree.

Point the scripts at any UE 5.x source directory and they'll extract classes, functions, properties, modules, plugins, and documentation into the same graph structure used by the pre-built data. Once indexed, every MCP tool works against your codebase exactly the same way it works against stock Unreal.

What you can index

  • Custom engine forks: NvRTX and its variants, studio-specific branches, any modified UE 5.x source tree
  • Proprietary plugins: In-house plugins with C++ headers that follow UE conventions (UCLASS, UPROPERTY, UFUNCTION)
  • Older or newer versions: AgentUX runs on 5.7, but you can index any 5.x source tree for reference. Developing on 5.7 while shipping on 5.4? Index both.

How it works

The build scripts parse C++ headers for UE reflection macros, extract module and plugin descriptors, and build the Neo4j graph. The process is the same one used to generate the 16 million+ node pre-built knowledge base. See the build scripts reference below for full usage details.

Build Scripts Reference (Pro)

Pro edition only. The GraphRAG build scripts ship with Pro and Team Studio. They are located in the GraphRAG/ directory.

The simplest way to rebuild the knowledge base is rebuild.py, which runs the full pipeline in one command. For finer control, each step has its own script. All scripts read defaults from config.yaml and accept CLI overrides.

rebuild.py: Full Pipeline

One-command rebuild. Runs all steps in sequence: scan modules, parse headers, build graph, build vectors, build docs, and extract params. Point it at your source tree and walk away.

$ python rebuild.py --help
usage: rebuild.py [-h] [--ue-source UE_SOURCES] [--clean] [--workers WORKERS]
                  [--steps STEPS] [--skip-scrape] [--skip-clone]
                  [--no-validate]

UE-GraphRAG: One-command knowledge base rebuild pipeline.

options:
  --ue-source UE_SOURCES   Path to UE source tree (repeatable for multiple roots;
                           overrides config.yaml ue_source_roots)
  --clean                  Wipe existing data before rebuilding
  --workers WORKERS        Number of parallel workers for parsing (default: from config or 8)
  --steps STEPS            Comma-separated step numbers to run (e.g., '1,2,3' or '3-6')
  --skip-scrape            Skip HTTP scraping in build_docs (for offline use)
  --skip-clone             Skip git clone of community guides in build_docs
  --no-validate            Skip post-build validation step
# Full rebuild from a custom source tree
python rebuild.py --ue-source /path/to/your/engine --clean

# Rebuild from multiple source roots (e.g., stock + NvRTX)
python rebuild.py --ue-source /path/to/epic --ue-source /path/to/nvrtx

# Run only steps 3-6 (skip scan/parse, rebuild graph and vectors)
python rebuild.py --steps 3-6

parse_all.py: Parse UE Headers

Parses C++ headers for UCLASS, UPROPERTY, UFUNCTION, and other UE reflection macros. Outputs structured JSON for the graph builder. Supports custom source roots and variant tagging.

$ python scripts/parse_all.py --help
usage: parse_all.py [-h] [--module MODULE] [--validate-only] [--serial]
                    [--skip-validate] [--workers WORKERS]
                    [--ue-version UE_VERSION] [--source-root SOURCE_ROOT]
                    [--source-variant SOURCE_VARIANT]

options:
  --module MODULE            Parse only a specific module (e.g., 'Editor/UnrealEd')
  --source-root SOURCE_ROOT  Override UE source root path
  --source-variant VARIANT   Source variant tag (e.g., 'epic', 'nvrtx')
  --ue-version UE_VERSION    UE version tag (e.g., 5.5.0)
  --workers WORKERS          Parallel worker processes

build_graph.py: Build Neo4j Graph

Loads parsed JSON into Neo4j as typed nodes (UClass, UFunction, UProperty, Module, Plugin) with full relationship edges. The --source-variant flag tags nodes so NvRTX and stock data coexist in the same database.

$ python scripts/build_graph.py --help
usage: build_graph.py [-h] [--clean] [--validate] [--enrich]
                      [--skip-enrichment] [--ue-version UE_VERSION]
                      [--source-variant SOURCE_VARIANT] [--config CONFIG]

options:
  --clean                          Remove existing GraphRAG nodes before loading
  --validate                       Run validation queries only (no loading)
  --enrich                         Run enrichment queries only (no loading)
  --ue-version UE_VERSION          UE version tag (e.g. 5.5.0)
  --source-variant SOURCE_VARIANT  Source variant tag (e.g., 'epic', 'nvrtx')

build_vectors.py: Build Vector Embeddings

Generates ONNX embeddings for semantic search and stores them in LanceDB. This is what powers search_ue_source and search_ue_docs queries.

$ python scripts/build_vectors.py --help
usage: build_vectors.py [-h] [--clean] [--stats] [--dry-run] [--module MODULE]
                        [--batch-size BATCH_SIZE] [--workers WORKERS]
                        [--checkpoint] [--show-progress]
                        [--ue-version UE_VERSION]

options:
  --clean              Drop existing table and rebuild from scratch
  --stats              Print store statistics and exit
  --checkpoint         Enable embedding checkpointing for resume support
  --show-progress      Show per-batch timing, ETA, memory usage

index_all_versions.py: Multi-Version Indexing

Indexes multiple UE5 versions in a single run. This is how the 27-release Pro knowledge base is built. It orchestrates scan, parse, graph, and vector steps for each version.

Heads up: This is the longest-running script. Each version can take several hours depending on your hardware, so indexing all 27 versions can take multiple days. Use --versions to index only what you need, or --resume-from to pick up where you left off.

$ python scripts/index_all_versions.py --help
usage: index_all_versions.py [-h] [--versions VERSIONS]
                             [--source-root SOURCE_ROOT] [--skip-vectors]
                             [--skip-params] [--skip-scan-parse]
                             [--skip-graph] [--workers WORKERS]
                             [--resume-from RESUME_FROM]

options:
  --versions VERSIONS        Comma-separated list of versions to index (default: all 27)
  --source-root SOURCE_ROOT  Root directory containing extracted UE sources
  --skip-vectors             Skip vector embedding step
  --resume-from VERSION      Resume from a specific version (skip earlier ones)

dump_graph.py: Export Graph Data

Exports the Neo4j knowledge base to a portable JSONL dump file. The --tier flag controls what gets included: standard exports only 5.7 data, pro exports everything.

$ python scripts/dump_graph.py --help
usage: dump_graph.py [-h] [--out OUT] [--tier {standard,pro}]
                     [--ue-version UE_VERSION]
                     [--source-variant SOURCE_VARIANT]
                     [--exclude-variant EXCLUDE_VARIANT]
                     [--knowledge-only]

options:
  --out OUT                        Output file path
  --tier {standard,pro}            Export tier (controls version scope)
  --ue-version UE_VERSION          Export only nodes for this UE version
  --source-variant SOURCE_VARIANT  Export only nodes with this variant
  --knowledge-only                 Export only curated knowledge (skip source nodes)

restore_graph.py: Restore from Dump

Restores a pre-built knowledge base from a JSONL dump file into Neo4j. This is what the installer runs. You can also use it to load a custom build into a fresh database.

$ python GraphRAG/scripts/restore_graph.py --help
usage: restore_graph.py [-h] [--input INPUT] [--uri URI] [--user USER]
                        [--password PASSWORD] [--clean] [--no-clean]

options:
  --input INPUT        Path to graphrag_dump.jsonl.gz
  --uri URI            Neo4j bolt URI
  --clean              Remove existing GraphRAG data before restore (default)
  --no-clean           Keep existing data (additive restore)

Related