Agent Graph System (AGS)
Learn how to create hierarchical constraints for your agents using the Agent Graph System
What is the Agent Graph System?
The Agent Graph System (AGS) lets you define hierarchical constraints for your AI agents, controlling which operations they can use and in what order.
While agents can see all available operations, they must follow the workflow you define. This balances autonomy with predictable behavior.
Core Concepts
An agent graph consists of three simple components:
- Nodes - Individual operations (tools) your agent can use
- Connections - Define which operations must happen before others
- Hierarchical levels - Group operations by their position in the workflow
Example Agent Workflow that requires AGS
Let’s explore a practical example of an agent that needs to follow a specific workflow:
Users might ask the agent to research a specific topic, and the agent should follow this sequence:
- First, search for general information about the topic
- Once basic information is found, extract specific details
- Finally, analyze or summarize the collected information
Without AGS constraints, the agent might skip steps or perform them in an incorrect order, leading to incomplete or inaccurate results. With AGS we can design a graph that enforces the correct sequence of operations without limiting the agent’s ability to make decisions.
This example shows how AGS enforces the correct sequence of operations, ensuring data is gathered methodically and reliably.
Implementation Methods
You can create agent graphs using either the visual UI or programmatically with the SDK. Both approaches offer the same functionality, with the visual builder being more intuitive for non-developers and the SDK providing more flexibility for programmers.
The xpander.ai UI provides a drag-and-drop interface for creating agent graphs:
Access the Graph Builder
Navigate to your agent in the xpander.ai dashboard and select the “Graph” tab
Add Operations
Drag operations from the sidebar into your graph workspace
Create Connections
Draw lines between operations to establish dependencies
Test Your Graph
Use the interface options to test your agent with different invocation methods
Deploy
Save changes to deploy your updated graph
The visual builder gives you all the power of AGS without writing code, making it accessible to both developers and non-developers.
The xpander.ai UI provides a drag-and-drop interface for creating agent graphs:
Access the Graph Builder
Navigate to your agent in the xpander.ai dashboard and select the “Graph” tab
Add Operations
Drag operations from the sidebar into your graph workspace
Create Connections
Draw lines between operations to establish dependencies
Test Your Graph
Use the interface options to test your agent with different invocation methods
Deploy
Save changes to deploy your updated graph
The visual builder gives you all the power of AGS without writing code, making it accessible to both developers and non-developers.
The SDK offers a programmatic approach that provides the same capabilities as the visual builder, but with the flexibility to create and modify graphs through code:
Add Operations to Your Agent
Create Graph Nodes
Define Hierarchical Constraints
Deploy Your Agent
Creating a Graph Example
Here’s an example of creating a workflow graph with the SDK:
Real-world Example: Meeting Recorder Agent
This example shows how to initialize a basic agent for a meeting recording application:
Troubleshooting & Best Practices
Next Steps
Now that you understand the Agent Graph System, you might want to explore: