Asya🎭 is a Kubernetes-native async actor framework with pluggable components for AI/ML orchestration.
System Architecture¶
graph LR
Client([Client])
subgraph "Asya Framework"
Gateway[Gateway
MCP API] Operator[Operator
CRD controller] end subgraph "Your Actors" A1[Actor Pod 1
sidecar + runtime] A2[Actor Pod 2
sidecar + runtime] A3[Actor Pod N
sidecar + runtime] end subgraph "Infrastructure" MQ[Message Queue
RabbitMQ/SQS] KEDA[KEDA
autoscaler] end Client -->|HTTP| Gateway Gateway -->|envelope| MQ MQ -->|messages| A1 A1 -->|results| MQ MQ -->|messages| A2 A2 -->|results| MQ MQ -->|messages| A3 Operator -.->|deploys| A1 Operator -.->|deploys| A2 Operator -.->|deploys| A3 KEDA -.->|scales| A1 KEDA -.->|scales| A2 KEDA -.->|scales| A3 style Gateway fill:#e1f5ff style Operator fill:#fff3cd style A1 fill:#d4edda style A2 fill:#d4edda style A3 fill:#d4edda
MCP API] Operator[Operator
CRD controller] end subgraph "Your Actors" A1[Actor Pod 1
sidecar + runtime] A2[Actor Pod 2
sidecar + runtime] A3[Actor Pod N
sidecar + runtime] end subgraph "Infrastructure" MQ[Message Queue
RabbitMQ/SQS] KEDA[KEDA
autoscaler] end Client -->|HTTP| Gateway Gateway -->|envelope| MQ MQ -->|messages| A1 A1 -->|results| MQ MQ -->|messages| A2 A2 -->|results| MQ MQ -->|messages| A3 Operator -.->|deploys| A1 Operator -.->|deploys| A2 Operator -.->|deploys| A3 KEDA -.->|scales| A1 KEDA -.->|scales| A2 KEDA -.->|scales| A3 style Gateway fill:#e1f5ff style Operator fill:#fff3cd style A1 fill:#d4edda style A2 fill:#d4edda style A3 fill:#d4edda
Core Components¶
Framework Components¶
- Operator: Kubernetes controller that watches AsyncActor CRDs, injects sidecars, configures KEDA autoscaling
- Gateway: Optional MCP HTTP API for envelope submission, SSE streaming, and status tracking
- CLI: Command-line tool for interacting with the gateway (MCP client)
Actor Components¶
Each actor pod contains two containers:
- Sidecar: Handles queue consumption, message routing, retries, progress reporting (Go)
- Runtime: Executes your Python handler via Unix socket, handles OOM recovery
System Actors¶
- Crew Actors: Special actors with reserved roles (
happy-end,error-end) for result persistence and error handling
Infrastructure¶
- Message Queue: Pluggable transports (SQS, RabbitMQ, Kafka/NATS planned)
- KEDA: Monitors queue depth, scales actors 0→N based on workload
- Observability: Prometheus metrics, structured logging, OpenTelemetry integration
Message Flow¶
- Client sends request to Gateway (or directly to queue)
- Gateway creates envelope, routes to first actor's queue
- Sidecar consumes message from queue
- Sidecar forwards envelope to Runtime via Unix socket
- Runtime executes your Python handler, returns result
- Sidecar routes result to next actor's queue (or
happy-end/error-end) - Repeat steps 3-6 for each actor in the route
- Crew actor (
happy-endorerror-end) persists final result, reports status to gateway
Key insight: Queue → Sidecar → Your Code → Sidecar → Next Queue
Actor Lifecycle¶
- User creates AsyncActor CRD
- Operator reconciles:
- Creates queue (
asya-{actor_name}) - Injects sidecar container
- Injects runtime entrypoint
- Creates KEDA ScaledObject (if scaling enabled)
- KEDA monitors queue depth, scales pods 0→N
- Sidecar consumes messages, routes to runtime
- Runtime executes handler, returns results
- Sidecar routes results to next queue
Protocols¶
- Actor-to-Actor: Envelope structure, routing, status tracking
- Sidecar-Runtime: Unix socket communication, framing protocol, error handling
Component Details¶
- AsyncActor CRD: Workload specification, scaling configuration, timeout settings
- Autoscaling: KEDA integration, scaling strategies, queue-based autoscaling
- Observability: Metrics, logging, tracing, monitoring best practices
Deployment Patterns¶
AWS (SQS + S3):
- Operator creates SQS queues
- Actors use IAM roles (IRSA/Pod Identity) for queue access
- Results stored in S3
- KEDA uses CloudWatch metrics
Self-hosted (RabbitMQ + MinIO):
- Operator creates RabbitMQ queues via Management API
- Actors use username/password from secrets
- Results stored in MinIO (S3-compatible)
- KEDA uses RabbitMQ API
See: Installation Guides (AWS EKS, Local Kind) for detailed deployment instructions.