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
| Capability | Description | Example |
|---|---|---|
| Find Actions | Search for entities | "Find all Person nodes" |
| Edit Actions | Modify graph structure | "Add property 'email' to Person" |
| Preview | See changes before applying | Shows affected nodes |
| Confirm/Cancel | Approve or reject changes | Interactive confirmation |
Accessing AI Graph Editor
Location
- Navigate to your RAG project
- Open the Graph Visualization tab
- Click the AI Graph Editor chat icon (sparkle/sparkles icon)
UI Components
The AI Graph Editor interface includes:
- Chat Panel - Conversation history with AI
- Input Field - Enter natural language commands
- Quick Actions - Pre-defined command templates
- Preview Panel - Shows pending changes
- Confirm/Cancel Buttons - Approve or reject changes
Testing Graph Search
Find Action Examples
| Command | What 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
| Operation | Example 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
| Action | Template |
|---|---|
| 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
- Click a quick action button
- Fill in the placeholders
- 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
| Field | Description |
|---|---|
entities | Matching nodes with categories |
relationships | Connections between entities |
paths | Multi-hop relationship chains |
Community Search
For GraphRAG with communities enabled:
| Command | Result |
|---|---|
| "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
| Issue | Possible Cause | Solution |
|---|---|---|
| No nodes found | Graph not generated | Complete graph generation first |
| Wrong entities highlighted | Ambiguous query | Be more specific in command |
| Preview shows too many nodes | Query too broad | Add more conditions |
| Edit fails | Invalid operation | Check entity types match |
| Command not understood | Unclear phrasing | Use 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
- Test queries for graph search
- Expected graph results for validation
- Baseline response format for comparison
- Any graph edits you want to track
Tips for Success
- Start Simple: Begin with basic find commands
- Use Preview: Always review before confirming
- Be Specific: Clear commands get better results
- Save Important Queries: Document useful commands
- Test Incrementally: Make one change at a time
