Docs
Step 5 - AI Graph Editor (GraphRAG)

Step 5 - AI Graph Editor (GraphRAG)

Use natural language to search and edit your knowledge graph

Step 5: AI Graph Editor (GraphRAG)

Purpose

Test graph search and use natural language to edit your knowledge graph. The AI Graph Editor enables intuitive graph manipulation through chat-based commands.

Entry Point: Graph Visualization → AI Graph Editor (chat icon)

Prerequisites:

  • Graph Retrieval enabled in Pipeline Configuration
  • Graph generation completed

Expected Outcome: Verified graph search working, graph edited if needed

AI Graph Editor Overview

The AI Graph Editor allows you to:

  • Search the graph using natural language
  • Find entities and relationships
  • Edit the graph with chat commands
  • Preview changes before applying

Capabilities

CapabilityDescriptionExample
Find ActionsSearch for entities"Find all Person nodes"
Edit ActionsModify graph structure"Add property 'email' to Person"
PreviewSee changes before applyingShows affected nodes
Confirm/CancelApprove or reject changesInteractive confirmation

Accessing AI Graph Editor

Location

  1. Navigate to your RAG project
  2. Open the Graph Visualization tab
  3. Click the AI Graph Editor chat icon (sparkle/sparkles icon)

UI Components

The AI Graph Editor interface includes:

  1. Chat Panel - Conversation history with AI
  2. Input Field - Enter natural language commands
  3. Quick Actions - Pre-defined command templates
  4. Preview Panel - Shows pending changes
  5. Confirm/Cancel Buttons - Approve or reject changes

Find Action Examples

CommandWhat It Does
"Find all Person nodes"Highlights all person entities
"Show me companies in tech industry"Filters to matching companies
"Find employees working at Acme"Returns connected entities
"Search for marketing community"Finds relevant community

Expected Chat Response

User: "Find all employees working at Acme Corp"

AI: I'll search for employees connected to Acme Corp.

Found 12 nodes matching your query:
- John Smith (Engineer)
- Jane Doe (Product Manager)
- ... and 10 more

These nodes are highlighted on the graph.
Would you like me to:
1. Show details for specific employees
2. Find their connections
3. Export this list

Graph Editing Commands

Supported Operations

OperationExample Command
Add Property"Add property 'email' to all Person nodes"
Set Value"Set status to 'active' for all companies"
Change Category"Change all Location nodes to Place"
Delete Nodes"Delete all Event nodes"
Add Relationship"Add WORKS_FOR relationship between John and Acme"

Edit Workflow

Step 1: Send Command

User enters natural language command:

User: "Add property 'department' to all Person nodes"

Step 2: AI Analysis

AI parses command and identifies intent:

  • Operation type: Add Property
  • Target category: Person
  • Property name: department

Step 3: Preview

AI shows preview of changes:

AI: I'll add property "department" to 15 Person nodes:

Affected nodes:
- John Smith
- Jane Doe
- Bob Johnson
- ... and 12 more

GMGQL Query: MATCH (n:Person) SET n.department = null

[✓ Confirm]  [✕ Cancel]

Step 4: Confirmation

User reviews and confirms or cancels:

User: "Confirm" (or click Confirm button)

Step 5: Execution

Changes applied to graph:

AI: Executing changes...

Step 6: Result

Confirmation of completed changes:

AI: ✓ Complete

Modified 15 Person nodes
Added property: department (null)
Execution time: 234ms

Preview/Confirm Workflow

Why Preview Matters

  • See exactly what will change before applying
  • Catch mistakes before they affect your graph
  • Understand the generated query for learning

Preview Example

AI: I'll add property "verified" to 25 Organization nodes:

Sample affected nodes:
- Acme Corp
- TechStart Inc
- Global Solutions Ltd
- ... and 22 more

This will set verified = null for all matching nodes.
You can set specific values in a follow-up command.

GMGQL Query: MATCH (n:Organization) SET n.verified = null

[✓ Confirm]  [✕ Cancel]

Quick Actions

Pre-defined Quick Actions

ActionTemplate
Add Property"Add property '' to all nodes"
Set Value"Set to '' for all nodes"
Change Category"Change all nodes to "
Delete Nodes"Delete all nodes"
Add to Cluster"Add all nodes to cluster"

Using Quick Actions

  1. Click a quick action button
  2. Fill in the placeholders
  3. Send for preview

Example Prompts

Properties Category

"Add property 'email' to all Person nodes"
"Set status to 'active' for Organization nodes"
"Remove the 'deprecated' property from all nodes"

Selection Category

"Show me all Person nodes"
"Select nodes with name containing 'Corp'"
"Find nodes in the 'Key People' cluster"

Deletion Category

"Delete all Event nodes"
"Remove nodes with status 'inactive'"
"Delete all WORKS_FOR relationships"

Categories Change

"Change all Location nodes to Place"
"Change category from PERSON to CONTACT"

Graph Search API Behavior

When querying GraphRAG via API, graph results are included:

API Response with Graph Results

{
  "query": "Who works at Acme Corp?",
  "response": "John Smith and Jane Doe work at Acme Corp.",
  "graph_results": {
    "entities": [
      { 
        "id": "node_1", 
        "name": "John Smith",
        "category": "Person"
      },
      { 
        "id": "node_2", 
        "name": "Acme Corp",
        "category": "Organization"
      }
    ],
    "relationships": [
      { 
        "source": "node_1", 
        "target": "node_2", 
        "type": "WORKS_FOR"
      }
    ],
    "paths": [
      { 
        "nodes": ["node_1", "node_2"], 
        "relevance_score": 0.95
      }
    ]
  }
}

Response Fields Explained

FieldDescription
entitiesMatching nodes with categories
relationshipsConnections between entities
pathsMulti-hop relationship chains

For GraphRAG with communities enabled:

CommandResult
"Show all communities"List of detected communities
"Find marketing community"Community matching query
"Highlight community members"Visual highlighting on graph

Community Search Example

User: "Find the marketing community"

AI: I found 1 community matching "marketing":

Marketing Department
- 45 nodes
- Description: Marketing team members and campaigns

Would you like to:
1. Highlight community members
2. Search within this community
3. View community details

Common Issues and Solutions

IssuePossible CauseSolution
No nodes foundGraph not generatedComplete graph generation first
Wrong entities highlightedAmbiguous queryBe more specific in command
Preview shows too many nodesQuery too broadAdd more conditions
Edit failsInvalid operationCheck entity types match
Command not understoodUnclear phrasingUse simpler language

Next Step: Benchmarking & Iteration

After verifying graph search works, proceed to Step 6: Benchmarking & Iteration to set up quality tracking for your GraphRAG system.

What to Bring to Step 6

  1. Test queries for graph search
  2. Expected graph results for validation
  3. Baseline response format for comparison
  4. Any graph edits you want to track

Tips for Success

  1. Start Simple: Begin with basic find commands
  2. Use Preview: Always review before confirming
  3. Be Specific: Clear commands get better results
  4. Save Important Queries: Document useful commands
  5. Test Incrementally: Make one change at a time