Agent Studio
Production - Agent creation, templates, preview sandbox, deployment pipeline
Agent Studio provides a visual and API-driven interface for creating, configuring, testing, and deploying custom agents. It includes a template library, a live preview sandbox, and a deployment pipeline that takes agents from development through staging to production.
12.2.6.1Studio Architecture
Agent Studio is implemented across three services in data-plane/ai-service/src/agents/studio/:
| Service | File | Purpose |
|---|---|---|
AgentStudioService | studio_service.py | Core CRUD for agent definitions |
TemplateService | template_service.py | Pre-built agent template library |
PreviewService | preview_service.py | Live sandbox for testing agents |
Studio API Routes
The Studio API is registered as part of the Core module and exposes endpoints under /api/v1/studio/:
# List available templates
curl http://localhost:8000/api/v1/studio/templates?tenant_id=acme-corp
# Create agent from template
curl -X POST http://localhost:8000/api/v1/studio/agents \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{
"name": "Sales Analyst Bot",
"template_id": "bi-analyst",
"config": {
"system_prompt": "You are a sales data analyst...",
"tools": ["execute_sql", "create_chart"],
"max_iterations": 8,
"temperature": 0.3
}
}'
# Preview agent (sandbox execution)
curl -X POST http://localhost:8000/api/v1/studio/agents/{agent_id}/preview \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{
"message": "Show me revenue trends",
"mock_tools": true
}'
# Deploy agent to production
curl -X POST http://localhost:8000/api/v1/studio/agents/{agent_id}/deploy \
-H "X-Tenant-ID: acme-corp" \
-d '{"target": "production"}'12.2.6.2Template Library
The template library provides pre-configured agent definitions:
| Template ID | Name | Description |
|---|---|---|
bi-analyst | BI Analyst | Data analysis and visualization |
sql-expert | SQL Expert | Advanced SQL generation and optimization |
data-engineer | Data Engineer | Pipeline and data quality management |
customer-support | Customer Support | Help desk and troubleshooting |
leadership-briefing | Leadership Briefing | Executive-level summaries |
mlops-engineer | MLOps Engineer | Model lifecycle management |
platform-admin | Platform Admin | Infrastructure and monitoring |
Template Configuration
class TemplateServiceConfig(BaseModel):
templates_base_path: str = "templates/agents"
auto_load_on_startup: bool = True
cache_ttl_seconds: int = 30012.2.6.3Preview Sandbox
The preview sandbox allows testing agents without affecting production data:
- Mock tool execution: Tool calls return simulated results
- Isolated sessions: Preview sessions are ephemeral
- Token tracking: Monitors LLM token usage during preview
- Response comparison: Compare responses across different configurations
{
"preview_id": "preview-uuid-123",
"agent_id": "agent-uuid-456",
"response": {
"content": "Based on the sales data, revenue grew 15% QoQ...",
"tool_calls": [
{"name": "execute_sql", "mocked": true, "arguments": {"sql": "SELECT..."}}
]
},
"tokens_used": 1245,
"execution_time_ms": 1830,
"warnings": []
}