Skip to main content
Version: 0.9.0

Deployment Overview

Agent Kernel is a multi-cloud AI agent runtime that supports multiple deployment flavors across AWS, Azure, and GCP, from a single REST container to queue-backed, auto-scaling, WebSocket-streaming topologies.

Deployment Flavors

Execution Modes

Independently of where you deploy, execution.mode selects how requests are processed and replies delivered. Chat execution always runs on the queue pipeline: in-process with the default in_memory transport on every server flavor, over durable SQS queues on AWS Lambda/ECS, or over Kafka/NATS on-prem or Kubernetes via the Helm chart. WebSocket delivery runs on API Gateway on AWS and on the pipeline's own WebSocket gateway tier everywhere else.

ModeTransportHow the client gets the replyQueuesResponse storeSupported on
rest_sync (also when mode is unset)HTTPJSON on the same connection (server awaits the store internally)in_memory / SQS FIFO / Kafka / NATSIn-memory / DynamoDB / Redis / ValkeyAll server flavors (in-process); AWS Lambda, AWS ECS (SQS); Kubernetes (Kafka/NATS/SQS)
rest_asyncHTTP202 ACCEPTED + request_id, client pollsin_memory / SQS FIFO / Kafka / NATSIn-memory / DynamoDB / Redis / ValkeyAll server flavors (in-process); AWS Lambda, AWS ECS (SQS); Kubernetes (Kafka/NATS/SQS)
asyncWebSocketSingle CHAT_RESPONSE push when the agent finishesAny transportNot usedAWS Lambda, AWS ECS (API Gateway); Kubernetes and self-hosted (the pipeline's gateway tier)
streamSSE or WebSocketOne StreamChunk per stream event as they are generatedin_memory (SSE path) / any broker (WebSocket path)Not usedREST API surfaces (SSE); AWS Lambda, AWS ECS (API Gateway WebSocket); Kubernetes and self-hosted (the pipeline's gateway tier)

Surfaces mounted with explicit handlers (the thread handler, messaging integrations, custom handlers) execute inline rather than through the pipeline.

note

AWS ECS supports execution_mode = "stream" for WebSocket mode in both direct and queue-backed topologies: in direct mode the chat route broadcasts each chunk inline via ChatService.process_stream_chat_async; in queue mode ECSAgentRunner.run() dispatches to ECSStreamAgentRunner, which fans out one Output Queue message per chunk instead of one for the full reply. See AWS Containerized for details.

Protocol support by flavor:

FlavorJSON RESTSSE streamingWebSocket (async + streaming)Queue mode
Local REST API / self-hosted-✅ in-process (in_memory)
AWS Lambda- (use WebSocket)✅ SQS
AWS ECS Fargate-✅ (async and stream)✅ SQS
Azure Functions--- (per-invocation, inline)
Azure Container Apps-✅ in-process (in_memory)
GCP Cloud Run (both flavors)-✅ in-process (in_memory)
Kubernetes (Helm chart)-✅ (async and stream, ws-gateway tier)✅ NATS / Kafka / SQS
info

SSE streaming is served by the built-in FastAPI RESTAPI server, so it is available anywhere that server runs (local, ECS single-container REST, Azure Container Apps, GCP Cloud Run). AWS Lambda delivers streaming over WebSocket instead, since API Gateway REST endpoints don't support SSE responses from standard Lambda integrations. CrewAI and Smolagents don't support token streaming; use rest_sync with those frameworks.

Quick Comparison

FlavorBest ForScalabilityCold StartCostFault Tolerance
Local/CLIDevelopment, testingN/AInstantFreeManual restart
REST APIWeb apps, APIsManual scalingInstantServer costsManual
AWS LambdaVariable load (AWS)Auto-scaling1-3sPay per useHigh - Auto-retry, multi-AZ, SQS retry/DLQ in queue mode
AWS ECSConsistent/high load (AWS)Auto-scaling (backlog-based in queue mode)InstantRunning containersVery High - Multi-AZ, auto-recovery
Azure FunctionsVariable load (Azure)Auto-scaling1-3sPay per useHigh - Auto-retry, multi-region
Azure Container AppsConsistent load (Azure)Auto-scaling (KEDA)InstantRunning containersVery High - Multi-zone, auto-recovery
GCP Cloud Run ServerlessVariable load (GCP)Auto-scaling (scale-to-zero)1-3sPay per useHigh - Auto-retry, multi-zone
GCP Cloud Run ContainerizedConsistent load (GCP)Auto-scaling (min≥1)InstantRunning containersVery High - Always-on, auto-recovery
Kubernetes (Helm)On-prem, any cluster, EKSAuto-scaling (KEDA queue depth)InstantCluster capacityVery High - Broker-backed retry/DLQ, rolling deploys, graceful drain
MCP ServerAI integrationsManualInstantServer costsManual
A2A ServerAgent networksManualInstantServer costsManual
note

GCP "serverless" and "containerized" are both Cloud Run: the difference is min_instance_count = 0 (scale-to-zero) vs ≥ 1 (always-on), not a different compute product.

Scalable Queue Topologies

Queue mode decouples request ingestion from agent execution. The same five-component pipeline runs everywhere: in-process on any server flavor (the in_memory default), split across compute over SQS FIFO queues on AWS, or over Kafka/NATS JetStream on-prem or Kubernetes via the Helm chart (baremetal + EKS flavors).

RoleLocal / any server flavor (in-process)AWS Lambda (serverless)AWS ECS (containerized)Kubernetes (Helm chart)
Request handlerRequestHandler on the rest-api threadRequest Handler LambdaECSQueueRequestHandler thread in the IO containerRequestHandler thread in the io-handler Deployment
Agent runnerAgentRunner worker threads (same process)Agent Runner Lambda (SQS event source mapping)ECSAgentRunner service, a pool of long-poll consumer threadsAgentRunner consumer threads in the agent-runner Deployment
Response handlerResponseHandler worker thread (same process)Response Handler LambdaECSOutputConsumer thread pool in the IO containerResponseHandler thread pool in the io-handler Deployment
Reply deliveryResponse store (in-memory), or SSE bridging (stream)Response store, or WebSocket push (async/stream)Response store, or WebSocket push (async/stream)Response store (Valkey/Redis), or ws-gateway push (async/stream)
Scalingno_of_consumers threadsAutomatic per SQS batchBacklog-per-task target trackingKEDA on queue depth (Kafka lag / NATS pending / SQS length)

See AWS Serverless, AWS Containerized, On-Prem / Kubernetes, and the Queue Mode Guide for full component walkthroughs.

Getting Started per Flavor

Local Development

Uses the agentkernel.cli module.

python my_agent.py
  • Interactive CLI, instant feedback, no deployment needed

Learn more →

REST API Server

Uses the agentkernel.api.RESTAPI module.

python my_agent.py
  • HTTP + SSE endpoints, easy integration, self-hosted

Learn more →

AWS Serverless

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • Lambda functions, API Gateway (REST + WebSocket)
  • Optional SQS queue mode with response store
  • Token streaming over WebSocket
  • Auto-scaling, pay per request

Learn more →

AWS Containerized

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • ECS Fargate + Application Load Balancer
  • Optional two-container scalable queue mode with backlog-based auto-scaling
  • Optional WebSocket mode (async/stream) for real-time, connection-based interactions
  • Consistent performance, lower latency

Learn more →

Azure Serverless

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • Azure Functions (Flex Consumption) + API Management
  • Auto-scaling, pay per request

Learn more →

Azure Containerized

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • Azure Container Apps + API Management
  • SSE streaming supported (runs the built-in REST server)

Learn more →

GCP Serverless

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • Cloud Run (scale-to-zero) + API Gateway
  • SSE streaming supported, pay per request

Learn more →

GCP Containerized

Uses Agent Kernel Terraform modules.

terraform init && terraform apply
  • Cloud Run (always-on, min_instance_count ≥ 1) + API Gateway
  • SSE streaming supported, no cold starts

Learn more →

On-Prem / Kubernetes

Uses the Agent Kernel Helm chart.

helm install ak ak-deployment/ak-k8s/chart -f values-<flavor>.yaml
  • io-handler + agent-runner Deployments over Kafka/NATS JetStream (or SQS on EKS)
  • Optional WebSocket gateway tier (async/stream), KEDA queue-depth autoscaling
  • Baremetal, EKS, and dev/micro-cluster flavors as values files

Learn more →

Choosing a Deployment Mode

  • DevelopmentLocal/CLI: fast iteration, no setup
  • Small web appREST API: simple, self-hosted
  • Variable traffic on AWSAWS Lambda: auto-scales, pay per use; add queue mode for backpressure and retries
  • High traffic / long-running agents on AWSAWS ECS in queue mode: consistent performance, backlog-based auto-scaling
  • Real-time UX on AWSWebSocket mode: async for push delivery, stream for token streaming: both on Lambda or ECS
  • Variable traffic on AzureAzure Functions; high trafficAzure Container Apps (KEDA scaling, SSE streaming)
  • Variable traffic on GCPCloud Run scale-to-zero; high trafficCloud Run always-on
  • On-prem, existing Kubernetes, or cloud-portablethe Helm chart: NATS-backed queue mode with KEDA autoscaling; Kafka where the organization standardizes on it
  • AI integrationMCP/A2A: protocol-based integration

Multi-Cloud Strategy

Agent Kernel's multi-cloud support enables you to:

  • Deploy the same agent code to AWS, Azure, or GCP without modification
  • Avoid vendor lock-in: switch clouds or run on multiple clouds
  • Optimize costs: choose the best pricing model for each workload
  • Geographic redundancy: distribute across cloud providers
  • Leverage cloud-specific services: use the best of each platform

Fault Tolerance Considerations

Agent Kernel provides different levels of fault tolerance depending on your deployment mode:

Production-Grade Fault Tolerance

AWS ECS/Fargate offers the highest level of fault tolerance on AWS:

  • Multi-AZ task distribution for zone-level failures
  • Automatic task replacement on failures; graceful in-container thread shutdown (ThreadRunner) so a crashed consumer restarts the whole task cleanly
  • In queue mode: SQS visibility-timeout retries, optional dead-letter queues, and error responses written to the response store so clients never hang
  • Backlog-based auto-scaling of the agent-runner service
  • Rolling deployments with zero downtime behind an ALB

Learn more about AWS ECS fault tolerance →

AWS Lambda provides built-in fault tolerance:

  • Serverless architecture with automatic scaling, multi-AZ execution by default
  • In queue mode: partial-batch failure reporting (batchItemFailures), visibility-timeout retries, optional DLQs
  • Automatic retry on failures, no infrastructure management

Learn more about AWS serverless fault tolerance →

Azure Container Apps offers the highest level of fault tolerance on Azure:

  • Multi-zone replica distribution, automatic replica replacement
  • Health check-based routing, KEDA-based auto-scaling
  • Rolling deployments with zero downtime

Learn more about Azure Container Apps fault tolerance →

Azure Functions provides built-in serverless fault tolerance with automatic retry and scaling.

Learn more about Azure serverless fault tolerance →

GCP Cloud Run (both flavors) provides automatic scaling, multi-zone execution, automatic retries, and no infrastructure management; the containerized flavor adds always-on instances for consistent performance.

GCP serverless → · GCP containerized →

State Persistence

All production deployment modes support resilient state management:

AWS Options:

  • DynamoDB: Multi-AZ replication, automatic backups, 99.999% SLA
  • ElastiCache Redis / Valkey: Cluster mode with automatic failover, replication

Azure Options:

  • Cosmos DB: Multi-region replication, automatic backups, 99.999% SLA
  • Azure Cache for Redis: Cluster mode with automatic failover, replication

GCP Options:

  • Firestore: Multi-region replication, automatic backups, 99.999% SLA
  • Memorystore Redis: High availability with automatic failover

Learn more about fault tolerance →

Next Steps

Ready to Ship Your
First Agent?

Free, open-source, Apache 2.0. No licensing costs, no vendor lock-in. Join hundreds of developers building production AI agents with Agent Kernel.

Agent Kernel
Ask Agent Kernel