Kagent

更新时间:
复制 MD 格式

Kagent is a Kubernetes-native framework for building, deploying, and running AI applications. After you deploy Kagent, you can use declarative APIs to create agents and MCP Servers. Kagent supports integration with multiple large language models (LLMs).

Agent fundamentals

An agent is an application that interacts with users using natural language. It uses an LLM to generate responses to user requests and can perform actions on behalf of the user.

Each agent consists of the following components:

  • LLM: Interprets user requests and generates responses. Examples include Qwen and ChatGPT.

  • Agent instructions: A set of instructions that define the agent’s behavior and capabilities. These are also called system prompts. Instructions typically specify the agent’s role, interaction guidelines with users, supported actions, and response logic. For example: “You are a Kubernetes O&M engineer. You help users manage their Kubernetes resources.”

  • Tools: Functions that let the agent interact with its environment. A tool can be an MCP Server that supports the MCP protocol or another agent that supports the A2A protocol. For example:

    1. The ACK MCP Server lets you retrieve cluster information, run cluster diagnostics, and view Prometheus metrics.

    2. A custom agent handles specialized tasks such as retrieving product information.

Core features

Kagent is a Kubernetes-native agent deployment and orchestration framework. You can use Kagent to do the following:

  1. Deploy a ready-to-use agent in an ACK cluster quickly by applying a YAML file.

  2. Deploy an MCP Server in an ACK cluster quickly by applying a YAML file and enable interaction between the MCP Server and agents.

  3. Integrate your own MCP Server to build purpose-built agents.

  4. Orchestrate multiple agents using YAML files to implement a multi-agent architecture.

  5. Orchestrate your own agents uniformly.

Core APIs

Kagent uses Kubernetes CustomResourceDefinitions (CRDs) as its core APIs. The main resources are:

  1. ModelConfig: Configures how to call an LLM, including the provider URL (such as Qwen or OpenAI), model name, and API key.

  2. RemoteMCPServer: Registers an HTTP-based MCP Server. After configuration, you can reference it in agents. You can register either an external MCP Server by its URL or an MCP Server deployed inside the cluster as a Kubernetes Service.

  3. Agent: Defines an agent. An agent is abstracted as a combination of an LLM, instructions, and tools. The LLM processes calls from humans or other agents based on the configured prompt and uses callable MCP Servers to complete specific tasks. Tools can be either MCP Servers or agents that support the A2A protocol.

image

Kagent architecture

Kagent consists of three main parts:

  1. Controller: Handles all Kagent-related APIs and converts them into agent applications in the cluster.

  2. App/Engine: The core component of Kagent. It is a Python application built on the ADK. The controller translates each created agent resource into an Agent App in real time. The App handles conversation loops and supports the A2A protocol.

  3. UI: Kagent includes a default web UI. You can use a browser to create and manage agents through the UI. You can also interact directly with agents in the UI.

Usage notes

The installation template provided by the Kagent community has high RBAC permissions. ACK restricts this template by default. It grants only essential permissions in the kagent namespace—such as creating and deleting Deployment and Service resources and reading Secret resources. As a result, you can create Agent, ModelConfig, and other resources only in the kagent namespace. To create resources in other namespaces, add a ClusterRole to the Kagent-related roles.

Kagent APIs are currently in Alpha. Before upgrading, check whether the new version introduces breaking changes.

References