ADK Multi-Agent Architecture
Serverless AI Agents at Your Service
🚀 Serverless Agents with Function Calling
ADK exposes Kubiya’s serverless AI agents that leverage state-of-the-art techniques:
- Function Calling: Agents use simple function calls to execute workflow tools
- Serverless Execution: Spin up on-demand, no persistent processes
- Tool Integration: Seamlessly call workflow steps as functions
- Best-in-Class Models: Leverages top AI models for reasoning
- Deterministic Outputs: Structured responses that fit into workflows
The Power of Inline Agents
Unlike traditional agent frameworks that require complex setups, Kubiya’s inline agents are:- Just workflow steps - No separate agent infrastructure
- Function-based - Agents call tools through simple function interfaces
- Context-aware - Access workflow state and previous outputs
- Serverless - No always-on processes consuming resources
- Integrated - Part of your workflow DAG, not external
How ADK Agents Work
The ADK provider orchestrates multiple specialized agents to transform natural language into production-ready workflows:Agent Roles
1. Loop Orchestrator
The Loop Orchestrator is the conductor of the entire process:- Purpose: Coordinates all other agents
- Responsibilities:
- Manages the generation lifecycle
- Handles error recovery and retries
- Enforces iteration limits
- Maintains conversation state
2. Context Loader Agent
Loads platform-specific context to inform workflow generation:- Fetches: Runners, integrations, secrets, organization settings
- Outputs: Structured context for the generator
- Uses: Kubiya API tools
The Context Loader ensures generated workflows use only available resources and integrations.
- Available runners and their capabilities
- Installed integrations (Slack, AWS, etc.)
- Accessible secrets (names only, not values)
- Organization policies and constraints
3. Workflow Generator Agent
The creative powerhouse that generates workflow code:- Model: DeepSeek V3 (default) or configurable
- Input: Task description + platform context
- Output: Python SDK code using the DSL
4. Compiler Agent
Validates and compiles the generated code:- Validates: Syntax, imports, workflow structure
- Compiles: Python code to workflow JSON
- Checks: Dependencies, circular references
- Reports: Errors and warnings
- ✓ Valid Python syntax
- ✓ Correct SDK imports and usage
- ✓ Runner exists and is accessible
- ✓ Required integrations are available
- ✓ Step dependencies are valid
- ✓ No circular dependencies
5. Refinement Agent
Fixes errors through intelligent iteration:- Input: Original code + compilation errors
- Process: Analyzes errors and generates fixes
- Smart: Learns from previous attempts
The refinement agent will attempt up to
max_loop_iterations
fixes before giving up.- Fix syntax errors
- Resolve missing imports
- Correct API usage
- Add error handling
- Optimize performance
6. Output Agent
Formats the final result:- Formats: JSON, YAML, or streaming events
- Adds: Metadata, usage instructions
- Handles: Both plan and act modes
Agent Communication
Agents communicate through structured messages:Customizing Agent Behavior
Model Selection
Different models for different agents:Custom Tools
Add custom tools to agents:Agent Hooks
Intercept agent communications:Performance Optimization
Caching
Caching
Enable caching for faster repeated requests:
Parallel Processing
Parallel Processing
Some agents can work in parallel:
Early Stopping
Early Stopping
Stop refinement when good enough:
Monitoring Agents
Logging
Enable detailed agent logging:Metrics
Track agent performance:Streaming Agent Events
Monitor agents in real-time:Best Practices
Model Selection
Use powerful models for generation, fast models for validation
Context Optimization
Provide only necessary context to reduce token usage
Error Handling
Always set reasonable iteration limits and timeouts
Monitoring
Track agent metrics to optimize performance
Troubleshooting
Agent Timeouts
Agent Timeouts
If agents timeout:
Refinement Loops
Refinement Loops
If stuck in refinement:
Context Errors
Context Errors
If context loading fails: