Examples Overview
The Agent Kernel repository includes a comprehensive set of examples demonstrating different multi-cloud deployment patterns, frameworks, and integrations for AWS, Azure, and GCP. All examples are located in the examples directory and are organized by deployment method and use case.
Directory Structure
The examples are organized into the following main categories:
📁 API Examples (/examples/api)
Examples demonstrating Agent Kernel's API capabilities and integrations:
a2a/- Agent-to-Agent (A2A) compatibility examplesmulti/- Multi-agent runtime with Smolagents and OpenAI agents exposed as A2A compatible
mcp/- Model Context Protocol (MCP) integration examplesmulti/- Multi-agent runtime with agents exposed as MCP tools
agui/- AG-UI protocol example: an OpenAI Agents SDK agent driven by a React/Vite frontend over a streamed AG-UI event surface, with shared state and client-context toolsslack/- Slack integration examplewhatsapp/- WhatsApp integration exampleinstagram/- Instagram integration exampletelegram/- Telegram integration exampleschedule-openai/- Deferred and recurring chats: a chat request carrying ascheduleblock is registered instead of run (HTTP 202), with the in-processlocalprovider, anin_memorytask store, the/api/v1/schedulesmanagement routes, and an agent that can schedule work itself
📁 CLI Examples (/examples/cli)
Command-line interface examples for local development and testing:
adk/- Google ADK (Agent Development Kit) agents with CLI interactioncrewai/- CrewAI framework integration examplesguardrail/- Content safety and compliance validation examplesopenai/- OpenAI Guardrails integration with LangGraph agents
langgraph/- LangGraph framework integration exampleslogfire/- Pydantic Logfire tracing over the OpenAI Agents SDK examplemulti/- Multi-agent examples combining different frameworksopenai/- OpenAI Agent SDK integration examplesopenai-dynamic/- OpenAI Agent SDK agents registered dynamically at runtimeopenai_structured/- OpenAI Agent SDK agent returning structured (Pydantic) outputpydanticai/- Pydantic AI framework integration examplessmolagents/- HuggingFace smolagentsCodeAgentintegration examplesknowledgebase/openai/- OpenAI Agents knowledge base demos split intochromadb/,neo4j/,starburst/, andmulti/
Per-run framework context/state demos — a grocery assistant that carries a cart across turns through the reserved framework_context session key, one per framework, using each framework's native context mechanism (see the Session guide):
openai_context/- OpenAI Agents SDK, viaRunContextWrapper.contextlanggraph_context/- LangGraph, via a declared state channel on a custom graphadk_context/- Google ADK, viaToolContext.statepydanticai_context/- Pydantic AI, viaRunContext.deps
📁 Sandbox Examples (/examples/sandbox)
Sandbox capability examples (execute code/commands in an isolated, permission-bounded environment). See the Sandbox guide:
basic/- Enable the sandbox, run code, persist a workspace across turns, manage named sessionsprofiles/- Multiple named workload profiles (provider + scope routing: a docker-backed workspace and a local throwaway sandbox)policy/- Policy/permissions on the docker provider: an enforced envelope (network deny, resource limits) and the fail-closedstrictmodel for what docker cannot enforce (egress allowlist)docker/- The docker provider: container-isolated execution, package installs, and enforced network policy (requires a Docker daemon)daytona/- The daytona provider: cloud container sandboxes with enforced network and resource policy and native idle auto-stop (requires a Daytona API key)e2b/- The e2b provider: Firecracker micro-VM sandboxes with a stateful Jupyter kernel (variables persist across executions) and enforced network policy (requires an E2B API key)identity/- Sandbox code running under the authenticated end user's identity, end-to-end over REST (custom pre-hook, principal resolver, and bring-your-own provider)ec2-ssm/- The ec2_ssm provider (mode-3 attach): execute code on an existing EC2 instance over SSM (manual; requires a real instance and AWS credentials)broker-kafka/- The queue broker flavor over Kafka: a two-process split where the worker runs read-only kubectl pods in a kind cluster via the kubernetes provider, with RBAC as the security boundary (requires Docker, kind, kubectl)broker-nats/- The queue broker fully in-cluster: pipeline plus sandbox worker deployed by the ak-k8s Helm chart over NATS, with sandbox pods in a hardened namespace (requires a micro-cluster and Helm)
📁 Containerized Examples (/examples/containerized)
Docker-based deployment examples:
openai/- OpenAI agents running in Docker containers with REST API access
📁 AWS Containerized Examples (/examples/aws-containerized)
AWS ECS/Fargate deployment examples:
adk/- Google ADK agents deployed on AWS container servicescrewai/- CrewAI agents deployed on AWS container servicesopenai-dynamodb-scalable/- OpenAI agents on AWS ECS with SQS queue mode for scalable, asynchronous request processing and DynamoDB response storageopenai-websocket/- OpenAI agents on AWS ECS over a WebSocket API in direct (non-queue) mode: one service authenticates$connect, runs the agent inline, and pushes the reply back over the same connectionopenai-websocket-scalable/- OpenAI agents on AWS ECS over a WebSocket API in queue mode: the REST/IO service enqueues chat frames and pushes responses, while a separately-scalable Agent Runner service processes them from SQSopenai-stream/- OpenAI agents on AWS ECS over a WebSocket API in direct (non-queue), STREAM execution mode: the reply is delivered token-by-token asSTREAM_CHUNKmessages instead of one finalCHAT_RESPONSEopenai-stream-queue-mode/- OpenAI agents on AWS ECS over a WebSocket API in queue-based STREAM execution mode: the Agent Runner streams token-by-token chunks onto the Output Queue so it can scale independently of ingressopenai-schedule/- Deferred and recurring chats on AWS ECS: EventBridge Scheduler owns the timers and delivers each occurrence into the Input Queue, with a DynamoDB schedule store and the/api/v1/schedulesmanagement routes on the REST service
📁 AWS Serverless Examples (/examples/aws-serverless)
AWS Lambda serverless deployment examples:
adk/- Google ADK agents running on AWS Lambdacrewai/- CrewAI agents running on AWS Lambdalanggraph/- LangGraph agents running on AWS Lambdaopenai/- OpenAI agents running on AWS Lambdawebsocket-openai/- OpenAI agents with WebSocket API for real-time bidirectional communicationstreaming-openai/- OpenAI agents with WebSocket event streaming (execution.mode: stream)schedule-openai/- Deferred and recurring chats on AWS Lambda: EventBridge Scheduler delivers each occurrence into the Input Queue for the agent-runner Lambda, backed by a DynamoDB schedule store
📁 Azure Containerized Examples (/examples/azure-containerized)
Azure Container Apps deployment examples:
adk/- Google ADK agents deployed on Azure Container Appscrewai/- CrewAI agents deployed on Azure Container Apps
📁 Azure Serverless Examples (/examples/azure-serverless)
Azure Functions serverless deployment examples:
adk/- Google ADK agents running on Azure Functionscrewai/- CrewAI agents running on Azure Functionslanggraph/- LangGraph agents running on Azure Functionsopenai/- OpenAI agents running on Azure Functions
📁 GCP Serverless Examples (/examples/gcp-serverless)
GCP Cloud Run serverless deployment examples (scale-to-zero):
openai/- OpenAI agents on Cloud Run with Redis sessionsopenai-auth/- OpenAI agents with JWT authentication via API Gatewayopenai-firestore/- OpenAI agents with Firestore session storage
📁 GCP Containerized Examples (/examples/gcp-containerized)
GCP Cloud Run containerized deployment examples (always-on):
openai/- OpenAI agents on Cloud Run with Redis sessionsopenai-auth/- OpenAI agents with JWT authentication via API Gateway
Supported Frameworks
Agent Kernel supports multiple AI agent frameworks:
| Framework | Description | Examples Available |
|---|---|---|
| Google ADK | Google's Agent Development Kit | CLI, AWS Containerized, AWS Serverless, Azure Containerized, Azure Serverless |
| CrewAI | Multi-agent orchestration framework | CLI, AWS Containerized, AWS Serverless, Azure Containerized, Azure Serverless, API |
| LangGraph | Graph-based agent framework | CLI, AWS Serverless, Azure Serverless |
| OpenAI Agent SDK | OpenAI's official agent framework | CLI, Containerized, AWS Serverless, AWS Containerized, Azure Serverless, Azure Containerized, GCP Serverless, GCP Containerized, API |
| Pydantic AI | Type-safe agent framework from the Pydantic team | CLI, API |
| smolagents | HuggingFace's code-first agent framework | CLI |
Deployment Patterns
Local Development
- CLI Examples: Perfect for local development, testing, and prototyping
- Run agents directly from command line with immediate feedback
API Integration
- A2A Compatibility: Enable agent-to-agent communication
- MCP Integration: Expose agents as Model Context Protocol tools
- REST API: Standard HTTP API for agent interaction
Container Deployment (Multi-Cloud)
- Docker: Containerized agents with REST API endpoints
- AWS ECS/Fargate: Scalable container deployment on AWS
- Azure Container Apps: Scalable container deployment on Azure
- GCP Cloud Run (Containerized): Always-on container deployment on GCP
Serverless Deployment (Multi-Cloud)
- AWS Lambda: Event-driven, serverless agent execution on AWS
- Azure Functions: Event-driven, serverless agent execution on Azure
- GCP Cloud Run (Serverless): Scale-to-zero agent execution on GCP
- Cost-effective for sporadic workloads
- Automatic scaling based on demand across all cloud platforms
Getting Started
Each example includes:
- README.md: Detailed setup and usage instructions
- build.sh: Dependency installation script
- Demo files: Working example implementations
- Tests: Validation and testing capabilities
Quick Start Steps
- Choose your deployment pattern (CLI, Containerized, or Serverless)
- Select your preferred framework (ADK, CrewAI, LangGraph, or OpenAI)
- Navigate to the example directory
- Follow the README instructions for setup and execution
Common Setup Pattern
Most examples follow this pattern:
# Install dependencies
./build.sh
# For local development
./build.sh local
# Run the example
python demo.py # or server.py for API examples
Integration Features
A2A (Agent-to-Agent) Compatibility
Enable agent-to-agent communication by setting a2a.enabled = True in your configuration.
MCP (Model Context Protocol) Support
Expose agents as MCP tools by setting:
mcp.enabled = True
mcp.expose_agents = True
Multi-Agent Runtimes
Several examples demonstrate running multiple agent frameworks within a single Agent Kernel runtime, showcasing the platform's flexibility and interoperability.
Prerequisites
Depending on the example you choose, you may need:
- Python 3.12+ with UV package manager
- Docker (for containerized examples)
- AWS CLI and credentials (for AWS examples)
- Azure CLI and credentials (for Azure examples)
- GCP CLI (
gcloud) and credentials (for GCP examples) - Terraform (for multi-cloud infrastructure deployment)
- Valid API keys for the respective AI services (OpenAI, etc.)
Use Cases: Skills-Driven End-to-End Agents
The use-cases/ directory contains complete agent projects built end-to-end using Agent Kernel skills and a coding assistant. Each use case starts from a SPEC.md describing the agent's purpose and requirements, then uses the ak-init, ak-build, ak-add-capabilities, ak-cloud-deploy, and ak-test skills to generate all project files.
Available Use Cases
waste-sorting-assistant/: A waste sorting advisor agent that recommends disposal categories (recycle, compost, landfill, hazardous waste) based on item material and the user's local recycling rules. Includes OpenAI Agents SDK integration, session memory for region-specific rules, and AWS Lambda deployment with DynamoDB-backed session persistence.
How to Use the Use Cases
See use-cases/README.md for the full workflow, from installing Agent Kernel skills to asking a coding assistant to generate a complete project from a SPEC.md.
Unlike the examples/ directory (which demonstrates specific deployment patterns and integrations), the use-cases/ directory shows complete domain-specific agents that were built by a coding agent using the Agent Kernel skills pack.
Next Steps
- Browse the specific framework examples that match your use case
- Start with CLI examples for local development
- Progress to containerized or serverless deployments for production
- Explore multi-agent examples for complex orchestration scenarios
- See
use-cases/for complete agents built with Agent Kernel skills
For detailed implementation guides, refer to the individual README files in each example directory.
