Overview
Shannon’s internal architecture uses gRPC (HTTP/2 + Protocol Buffers) for high-performance inter-service communication. This document provides complete Protocol Buffer definitions for all 5 services and 39 RPC methods.Public vs Internal APIs: gRPC services are internal and not exposed by the public SDK. For application integration, use the Gateway REST API (
http://localhost:8080/api/v1/*) or the Python SDK (ShannonClient(base_url=...)).- OrchestratorService (20 RPCs) - Task orchestration, workflow management, and scheduling
- StreamingService (1 RPC) - Real-time event streaming
- AgentService (6 RPCs) - Agent execution and tool management
- LLMService (5 RPCs) - LLM provider gateway
- SessionService (7 RPCs) - Multi-turn conversation management
Common Types
Shared types used across all services.ExecutionMode
SIMPLE: Direct tool invocation or cache lookup (fastest)STANDARD: Single-agent LLM-powered execution (balanced)COMPLEX: Multi-agent DAG with parallel execution (most capable)
ModelTier
- Small: $0.001-0.002 per 1K tokens
- Medium: $0.01-0.03 per 1K tokens
- Large: $0.03-0.075 per 1K tokens
StatusCode
TaskMetadata
TokenUsage
ExecutionMetrics
OrchestratorService
Task orchestration and workflow management service.Service Definition
SubmitTask
Submit a new task for execution. Request:GetTaskStatus
Retrieve current status and result of a task. Request:CancelTask
Cancel a running task. Request:ListTasks
List tasks with optional filtering. Request:GetSessionContext
Retrieve session context and history. Request:ListTemplates
List available task templates. Request:ApproveTask
Approve or deny a task requiring human approval. Request:GetPendingApprovals
List pending approval requests. Request:StreamingService
Real-time event streaming service.Service Definition
StreamTaskExecution
Stream real-time events for a task (server-streaming RPC). Request:AgentService
Agent execution and tool management service.Service Definition
ExecuteTask
Execute a task with a single agent (unary RPC). Request:StreamExecuteTask
Execute task with streaming updates (server-streaming RPC). Request: Same asExecuteTask
Response (stream):
GetCapabilities
Get agent capabilities. Request:HealthCheck
Check agent service health. Request:DiscoverTools
Discover available tools by query or category. Request:GetToolCapability
Get detailed capability of a specific tool. Request:LLMService
LLM provider gateway service.Service Definition
GenerateCompletion
Generate LLM completion (unary RPC). Request:StreamCompletion
Generate streaming LLM completion (server-streaming RPC). Request: Same asGenerateCompletion
Response (stream):
EmbedText
Generate text embeddings. Request:AnalyzeComplexity
Analyze query complexity and recommend execution mode. Request:ListModels
List available LLM models. Request:SessionService
Multi-turn conversation management service.Service Definition
CreateSession
Create a new conversation session. Request:GetSession
Retrieve session details. Request:UpdateSession
Update session context or extend TTL. Request:DeleteSession
Delete a session. Request:ListSessions
List user sessions. Request:AddMessage
Add message to session history. Request:ClearHistory
Clear session message history. Request:Error Handling
Status Codes
All responses include aStatusCode:
STATUS_CODE_OK (1)- SuccessSTATUS_CODE_ERROR (2)- Generic errorSTATUS_CODE_TIMEOUT (3)- Operation timeoutSTATUS_CODE_RATE_LIMITED (4)- Rate limit exceededSTATUS_CODE_BUDGET_EXCEEDED (5)- Token/cost budget exceeded
gRPC Status Codes
Standard gRPC status codes used:OK (0)- SuccessCANCELLED (1)- Request cancelledINVALID_ARGUMENT (3)- Invalid request parametersDEADLINE_EXCEEDED (4)- TimeoutNOT_FOUND (5)- Resource not foundALREADY_EXISTS (6)- Resource already existsPERMISSION_DENIED (7)- Insufficient permissionsRESOURCE_EXHAUSTED (8)- Rate limit/quota exceededUNAUTHENTICATED (16)- Missing/invalid credentialsUNAVAILABLE (14)- Service unavailableINTERNAL (13)- Internal server error
Example Error Handling (Python)
Service Endpoints
Gateway REST API also available on port 8080 (HTTP/REST wrapper around gRPC).
See REST API Reference for HTTP endpoints.
Code Generation
Generate client code from .proto files:Python
Go
TypeScript
Related Topics
REST API
HTTP REST endpoints
Event Types
Streaming event catalog
Python SDK
Python client library
Database Schema
Data persistence