Where AI Agents Meet Kubernetes Infrastructure
Define collaborative AI agents as Kubernetes custom resources. SAIL wires them into event-driven pipelines — no routing code, no service discovery, no boilerplate. Just prompts and Kubernetes.
⚙ The Problem We Solve
Building multi-agent AI systems is complex. Routing, discovery, scaling, retries — all of that is infrastructure work, not AI work. SAIL absorbs it.
Write a YAML with a system prompt and a user prompt. SAIL's operator automatically creates the Knative Service, Trigger, and Redis registry entry. You never write routing code.
At runtime, each agent queries Redis and learns the names and descriptions of every other deployed agent. The LLM decides who to call next — just like a team of engineers in Slack.
Built on Knative Serving. Idle agents consume zero resources. Messages queue in Kafka; agents spin up on demand. Pay only for what you use, even at enterprise scale.
Every message is a CloudEvent routed through the Knative Broker. Human inputs, agent outputs, and system triggers are all the same format. Add new agents without touching existing ones.
No secrets in code. Kubernetes Secrets inject the OpenAI key, Redis host, and Kafka TLS certificates. RBAC, namespaces, and network policies work exactly as you expect.
Set agentClassName to extend the base runtime
with custom Java logic. SAIL derives the container image
automatically from the class name. Custom ≠ complex.
⚙ Under the Hood
SAIL orchestrates three independent components and a cloud-native messaging backbone. Messages flow from Kafka through Knative into agent pods and back — fully automated.
Human / external system
│
│ POST JSON → Kafka "agents-messages"
▼
┌──────────────┐
│ KafkaSource │ consumes agents-messages
└──────┬───────┘
│ CloudEvent
▼
┌──────────────────┐
│ EventTransform │ JSONata: data.to → "targetagent" CE attribute
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Knative Broker │ routes on CE attribute
└────────┬─────────┘
│
▼
┌──────────────────────┐ ┌───────────────────────┐
│ Trigger │ │ Knative Service │
│ filter: targetagent │────▶│ sail-base-openid │
└──────────────────────┘ │ (agent container) │
└──────────┬────────────┘
│
1. Render Qute prompt
2. Query Redis for peers
3. Call OpenAI (LangChain4j)
4. LLM calls sendMessage MCP tool
│
▼
┌───────────────────┐
│ sail-mcp-server │ → Kafka
└───────────────────┘
Watches GenericAgent CRs. Creates Knative Service, Trigger, and Redis entry.
JSON posted to Kafka is consumed by KafkaSource, transformed into a CloudEvent.
Knative Broker checks the targetagent attribute and delivers to the right service.
Renders prompt, discovers peers from Redis, calls OpenAI via LangChain4j.
LLM calls sendMessage MCP tool → MCP server publishes to Kafka → next agent activates.
⚙ The Building Blocks
Each subproject is fully standalone — no shared modules, no parent POM. Deploy only what you need.
Watches GenericAgent custom resources (CRD group sebi.org/v1)
and provisions a Knative Service + Trigger for each agent using server-side apply.
Stores agent metadata in Redis for peer discovery. Uses a finalizer to clean up
Redis keys on deletion.
Stateless HTTP/SSE server exposing a single sendMessage tool via the
Model Context Protocol. All agents call this shared endpoint to publish
SailMessage objects to the agents-messages Kafka topic.
Receives CloudEvents from Knative, renders Qute prompt templates with SailMessage
context, queries Redis for available agents, then calls OpenAI via LangChain4j.
The LLM uses MCP tools to route messages onward.
⚙ The Stack
⚙ Define an Agent
No code required for standard agents. Write a prompt, give it a name, apply it to Kubernetes — SAIL handles the rest.
apiVersion: sebi.org/v1
kind: GenericAgent
metadata:
name: creative-writer-agent
namespace: sail
spec:
description: "Generates short creative story drafts"
systemMessage: |
You are a creative writer called
'creative-writer-agent'.
userMessage: |
Generate a 3-sentence story about:
{sailMessage.inputs['creative-writer-agent']}
Send the result to an audience editor agent
using the sendMessage tool. Include the
original inputs {sailMessage.inputs}.
sailMessage — the incoming message, inputs, and sender name.
agentClassName to a fully-qualified Java class
to use a custom container image. SAIL derives the image name automatically.
⚙ Ready to Build
From zero to a running 3-agent pipeline in under 10 minutes (assuming you have a Kubernetes cluster).
One script sets up minikube with Knative Serving, Knative Eventing, Strimzi Kafka, and Redis — fully automated for local dev.
./scripts/install-knative-dev.sh
# Then in a separate terminal:
minikube tunnel --profile sail
Applies the CRD, operator, MCP server, and all eventing resources in the correct order, waiting for each to become ready.
./scripts/install-sail-resources.sh \
--skip-tls \
sail-kafka-kafka-bootstrap.kafka.svc.cluster.local:9092
Apply the sample 3-agent pipeline: creative writer → audience editor → style editor.
cd sail-operator && make agents-add
# Or apply individually:
kubectl apply -f sail-operator/sample/agents/creative-writer-agent.yaml
Publish a message to the creative-writer-agent via Kafka.
Watch all three agents collaborate automatically.
kafka-console-producer.sh \
--bootstrap-server <bootstrap-server> \
--topic agents-messages \
--property parse.headers=true \
--property headers=content-type:application/json \
< sail-operator/sample/sail-messages/human-to-creative-writer.json
⚙ Start Building
SAIL is open source, Kubernetes-native, and designed for engineers who want powerful multi-agent AI without the infrastructure overhead.