Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

gRPC Service Design

Agent Studio exposes its backend via a gRPC service defined in Protocol Buffers. For external harnesses, we recommend starting from the Open Inference Protocol (OIP) as your protobuf foundation and evolving gRPC interfaces to support your harness’s specific needs. Agent Studio’s own proto (agent_studio.proto) is an implementation detail — it is tightly coupled to the Cloudera AI platform and should not be adopted directly.

OIP defines standard protobuf messages for AI inference traces, spans, and evaluations. It aligns with OpenTelemetry semantic conventions and is already used by Agent Studio’s telemetry layer (via the openinference-instrumentation-* packages).

For a harness that needs to:

  • Execute and observe agent workflows → extend OIP trace/span definitions
  • Manage templates and deployments → define your own CRUD service RPCs
  • Proxy between a frontend and backend → follow the REST-to-gRPC proxy pattern described below

Agent Studio’s Service Architecture (Reference Only)

Agent Studio’s gRPC service is organized into domain-specific RPC groups:

DomainKey RPCsCount
ModelsListModels, AddModel, TestModel, SetStudioDefaultModel8
Tool TemplatesListToolTemplates, AddToolTemplate, UpdateToolTemplate5
Tool InstancesListToolInstances, CreateToolInstance, TestToolInstance5
MCP TemplatesListMcpTemplates, AddMcpTemplate, UpdateMcpTemplate5
MCP InstancesListMcpInstances, CreateMcpInstance, UpdateMcpInstance5
AgentsListAgents, AddAgent, UpdateAgent5
TasksListTasks, AddTask, UpdateTask5
WorkflowsListWorkflows, AddWorkflow, CloneWorkflow, TestWorkflow, DeployWorkflow12
Workflow TemplatesListWorkflowTemplates, ExportWorkflowTemplate, ImportWorkflowTemplate6
Agent/Task TemplatesCRUD for reusable agent and task blueprints10+
Deployed WorkflowsListDeployedWorkflows, UndeployWorkflow, Suspend/Resume5
UtilityHealthCheck, FileUpload/Download, GetAssetData9

Total: 125+ RPCs.

Service Pattern

The gRPC service (studio/service.py) acts as a thin router:

class AgentStudioApp(AgentStudioServicer):
    def __init__(self):
        self.dao = AgentStudioDao()

    def ListWorkflows(self, request, context):
        return list_workflows(request, cml=self.cml, dao=self.dao)

    def ExportWorkflowTemplate(self, request, context):
        return export_workflow_template(request, cml=self.cml, dao=self.dao)

Each RPC delegates to a domain function that receives (request, cml, dao). Business logic lives entirely in the domain modules (studio/agents/, studio/tools/, studio/workflow/, etc.).

Key Programmatic Entry Points

For template management, the most important RPCs are:

  • ExportWorkflowTemplate(id) → Returns a ZIP file path containing the complete template package
  • ImportWorkflowTemplate(file_path) → Imports a ZIP, regenerates UUIDs, copies assets, creates DB records
  • DeployWorkflow(workflow_id, config) → Packages and deploys a workflow to a target endpoint
  • TestWorkflow(workflow_id, inputs) → Executes a workflow on an in-studio runner with full telemetry

Frontend Proxy Pattern

The Next.js frontend does not speak gRPC directly. Instead, API routes translate HTTP requests:

The proxy uses slug-based routing — the URL path segment maps to the gRPC method name. This pattern means any REST client can interact with the backend without a gRPC client library.

Additionally, Phoenix traffic is proxied via Next.js rewrites:

/api/ops/*  →  http://localhost:50052/*

Recommendations for External Harnesses

  1. Define your own proto starting from OIP trace definitions. Add CRUD RPCs as needed for your entity model.
  2. Keep the service layer thin — route to domain modules. This makes the service testable and extensible.
  3. Expose a REST proxy if your frontend doesn’t support gRPC natively. The slug-based pattern is simple and effective.
  4. Use the Import/Export ZIP format as your interchange format with Agent Studio. The Template Specification chapters document this format exhaustively.
  5. Don’t depend on agent_studio.proto — it is versioned for internal use and subject to change without notice.