Skip to main content

Architecture

Request Flow

All API endpoints use Restate's HTTP invocation pattern: POST /<package.ServiceName>/<Method> with a JSON (protojson) request body.

Gateway Routing

Component Types

Gateways

Stateless Restate services that extract auth context from request headers (x-user-id, x-user-email) and route to downstream actors, services, or workflows via the Restate SDK.

GatewayDomainDownstream
LLM GatewayConversationsConversationManagerActor, MCPService, MemoryService
Socayo GatewayHealth CoachingSocayoUserActor
Storage GatewayStorageStorageManagerActor
Integrations GatewayIntegrationsPipedreamService
Webhook GatewayWebhooksWebhookService
Notification GatewayNotificationsNovu REST API
Auth GatewayAuthApiKeyService

Actors

Stateful components keyed by ID. Each actor instance maintains its own state via Restate's durable state.

ActorKeyPurpose
ConversationActorconversation_keyIndividual conversation state and message history
ConversationManagerActoruser_idPer-user conversation management (list, create, delete)
SocayoUserActoruser_idUser profile and onboarding data
StorageManagerActoruser_idPer-user file storage operations and quota
FirebaseBridgeActoruser_idFirebase Auth token bridge

Services

Stateless processors that handle specific integrations or computations.

  • OpenRouter — LLM inference via OpenRouter API
  • MCP — Model Context Protocol tool server management
  • Pinecone — Vector database operations
  • Memory — Mem0 memory search and management
  • Storage — Object storage backend (S3-compatible)
  • OpenFGA — Fine-grained authorization checks
  • Pipedream — Third-party app integrations
  • Pipecat / Daily / Cerebrium — Voice AI pipeline

Workflows

Long-running orchestrations that coordinate multiple services.

WorkflowPurpose
SocayoPlanGeneratorWorkflowGenerate coaching plans from user profiles
GenerationWorkflowContent generation with LLM
DeploymentWorkflowService deployment orchestration

Infrastructure

Deployment

Services are built with ko (Go) or Docker, pushed to GHCR, and automatically deployed via Flux image automation policies.