KAOS: Hệ thống Điều phối Tác nhân K8s
Triển khai, quản lý và điều phối các tác nhân AI trên Kubernetes

KAOS là một framework trên nền tảng Kubernetes để triển khai và điều phối các tác nhân AI với khả năng truy cập công cụ, phối hợp đa tác nhân, và tích hợp LLM một cách liền mạch.
Tính Năng
- Agentic Graphs: Triển khai mạng lưới tác nhân phân tán dưới dạng các tài nguyên Kubernetes
- MCP Primitives: Tích hợp công cụ qua tiêu chuẩn Model Context Protocol
- Multi-Agent Support: Hệ thống tác nhân phân cấp với sự ủy quyền tự động
- OpenAI-Compatible: Các tác nhân hỗ trợ điểm cuối
/v1/chat/completions - KAOS CLI: Cài đặt và quản lý tác nhân và môi trường với
kaosCLI - Bảng điều khiển trực quan: Giao diện để giám sát tác nhân, kiểm tra chat, gỡ lỗi bộ nhớ và công cụ
Bắt Đầu Nhanh
Yêu Cầu
- Cụm Kubernetes
- Đã cấu hình kubectl
- Đã cài đặt helm
Lựa Chọn 1: KAOS CLI/UI
# Cài đặt CLI
pip install kaos-cli
# Cài đặt KAOS trong cụm
kaos install
# Mở giao diện UI
kaos ui
Lựa Chọn 2: Helm/kubectl
# Thêm kho Helm
helm repo add kaos https://axsaucedo.github.io/kaos/charts
helm repo update
# Cài đặt operator
helm install kaos kaos/kaos-operator -n kaos-system --create-namespace
Triển Khai Tác Nhân Đầu Tiên
# simple-agent.yaml
apiVersion: kaos.tools/v1alpha1
kind: ModelAPI
metadata:
name: ollama
spec:
mode: Hosted
hostedConfig:
model: "smollm2:135m"
---
apiVersion: kaos.tools/v1alpha1
kind: MCPServer
metadata:
name: echo-tools
spec:
type: python-runtime
config:
tools:
fromString: |
def echo(message: str) -> str:
"""Echo back the message."""
return f"Echo: {message}"
---
apiVersion: kaos.tools/v1alpha1
kind: Agent
metadata:
name: assistant
spec:
modelAPI: ollama
mcpServers:
- echo-tools
config:
description: "AI assistant with echo tools"
instructions: "You are a helpful assistant."
env:
- name: MODEL_NAME
value: "ollama/smollm2:135m"
kubectl apply -f simple-agent.yaml
# Chờ pod sẵn sàng
kubectl wait --for=condition=ready pod -l agent=assistant --timeout=120s
# Port-forward và thử nghiệm
kubectl port-forward svc/agent-assistant 8000:8000
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "assistant", "messages": [{"role": "user", "content": "Hello!"}]}'
Kiến Trúc
flowchart TB
subgraph operator["KAOS Operator"]
ac["Agent Controller"]
mc["MCPServer Controller"]
mac["ModelAPI Controller"]
end
subgraph resources["Managed Resources"]
agent["Agent Pod<br/>Agent Runtime"]
mcp["MCP Server Pod<br/>MCP Tools"]
model["ModelAPI Pod<br/>Ollama/LiteLLM"]
end
ac --> agent
mc --> mcp
mac --> model
agent --> mcp
agent --> model
Tài liệu
- Tài liệu đầy đủ: axsaucedo.github.io/kaos
- Bắt đầu nhanh: Getting Started
- Hướng dẫn CLI: CLI Commands
- Giao diện Web UI: UI Features
- Agent CRD: Agent Reference
- Multi-Agent: Multi-Agent Tutorial
Giấy Phép
Apache 2.0