Agent Architecture
GAIA’s agent system consists of two main agents:- Comms Agent: Handles user interaction with natural language responses
- Executor Agent: Manages task execution with full tool access
Core Components
Every agent requires:- State: Defines the data structure passed between nodes
- Graph Builder: Constructs the agent workflow
- Tools: Functions the agent can call
- Prompts: System instructions for the LLM
- Checkpointer: Persists conversation state
Creating a Basic Agent
1. Define State
Create a state class inapp/agents/core/state.py:
2. Build the Graph
Create a graph builder inapp/agents/core/graph_builder/:
3. Register with Lazy Provider
Use the lazy provider pattern to register your agent:4. Register in Graph Manager
Add your agent toapp/agents/core/graph_manager.py:
Agent Execution Patterns
GAIA provides two execution modes:Streaming Mode
For real-time chat interfaces:Silent Mode
For background processing:Node Hooks
Add custom logic at different execution stages:Pre-Model Hooks
Run before LLM invocation:End-Graph Hooks
Run after agent completes:Memory Management
Integrate memory into your agent:Configuration
Build agent config with user context:Testing Your Agent
See Testing Agents for comprehensive testing strategies.Next Steps
Creating Tools
Learn how to build custom tools for your agents
Creating Prompts
Master prompt engineering for agent behavior