kagent Documentation

website·Indexed 34 days ago

https://kagent.dev/docs

Documentation for kagent 0.x, a framework for creating and managing AI agents. It features support for multiple LLM providers including OpenAI, Anthropic, Gemini, Amazon Bedrock, and Ollama, as well as integration with MCP (Model Context Protocol) tools, Agent Substrate, and A2A protocols. The platform supports Human-in-the-Loop workflows, custom skill types, and integrations with Slack, CrewAI, and LangGraph.

Tokens
160.6K
Snippets
727
Records
1.1K
Agent score
72%

What's inside kagent

  1. Overview of kagent MCP Tool Servers

    kagent utilizes the Model Context Protocol (MCP) to provide a rich set of built-in tools. There are two primary MCP servers:

    • kagent-tool-server: Provides tools for Kubernetes, Helm, Istio, Cilium, Argo Rollouts, and Kubescape.
    • kagent-grafana-mcp: Provides tools for Prometheus, Grafana, Loki, and incident/on-call management.
  2. Overview of the Lightweight OTel Stack

    The Lightweight OTel stack is a minimal observability setup designed for collecting telemetry from kagent and Agent Substrate. It is optimized for lower memory usage compared to the full OTel stack (which includes Grafana and Loki).

    Components include:

    • Traces: Distributed tracing via Jaeger.
    • Metrics: Time-series collection via Prometheus.
    • Collection: Routing and collection via the OpenTelemetry Collector.
    • Logs: No dedicated backend; logs are printed to the OTel collector's output for verification.
  3. Overview of the kagent A2A service

    The kagent controller implements the lf.a2a.v1.A2AService on port 8083. This service is used by the kagent CLI, MCP servers, and custom clients to communicate with AgentInstances.

    Unlike REST APIs, AgentInstances are not addressed via URL paths. Instead, callers must provide the AgentInstance's ID in the x-kagent-agent-instance-id request metadata header for the controller to route the call to the correct Actor.

    Security Warning: The open-source build does not authenticate port 8083. Do not expose this port outside the cluster, as any caller with network access can invoke any AgentInstance.

  4. Overview of Human-in-the-Loop (HITL) mechanism

    The Human-in-the-Loop (HITL) mechanism allows an agent to stop mid-turn when it requires human intervention—either to get permission before executing a tool or to ask a question. When a pause occurs, the task state changes to INPUT_REQUIRED. The agent remains paused until the client sends a response message on the same task, at which point the agent resumes from where it left off.
  5. Overview of the documentation agent architecture

    A documentation agent allows an LLM to answer questions based on a specific source (like a documentation website) rather than relying solely on its internal training data. The architecture consists of three main components:

    1. doc2vec: A CLI tool used to crawl a website or repository, chunk the content, embed it, and store it in a vector database.
    2. doc2vec MCP server: A containerized server that reads the vector database and exposes semantic search capabilities as Model Context Protocol (MCP) tools.
    3. kagent: The orchestration layer that uses a RemoteMCPServer resource to connect to the MCP server and an AgentTemplate to bind specific tools to an agent.
  6. Overview of the kagent MCP server

    The kagent controller includes a built-in MCP server that exposes AgentInstances as tools, allowing MCP clients to discover and delegate work to agents. This enables orchestration where one agent can act as a sub-agent to another.

    Key technical details:

    • Endpoint: Served at /mcp on port 8083 by default.
    • Transport: Supports Streamable HTTP only. Server-Sent Events (SSE) and stdio are unsupported.
    • Sessions: Stateless; each request is independent.
    • Extensions: Advertises the io.modelcontextprotocol/tasks extension for non-blocking invocations.
    • Identity: The open-source build is unauthenticated. It identifies users via the X-User-Id header (defaults to admin@kagent.dev). Do not expose port 8083 outside the cluster.
  7. Overview of kagent Kubernetes-native AI runtime

    kagent is an open-source, CNCF sandbox project that provides a Kubernetes-native runtime for AI agents. It allows agents to be deployed, scaled, and operated as first-class Kubernetes resources using standard CRDs, RBAC, GitOps, and observability tools. It supports various runtimes (NemoClaw, OpenClaw), agent frameworks (ADK, LangGraph), and LLM providers (OpenAI, Anthropic, Gemini).
  8. Overview of kagent Tools

    Tools in kagent are functions that allow agents to interact with their environment (e.g., listing Kubernetes pods or fetching logs). kagent supports built-in tools, Model Context Protocol (MCP) tools, HTTP tools, and the ability to use other agents as tools.
  9. Overview of AgentHarness

    AgentHarness is a kagent resource used to create a long-running remote execution environment on Agent Substrate. Unlike standard agents, it does not package a kagent runtime into the workload; instead, the backend provisions a sandbox running a coding agent (either OpenClaw or Hermes). This allows the agent to be managed via the kagent API/UI and wired into messaging channels like Slack.
  10. Overview of kagent Agent Memory

    Agent memory allows an AgentInstance to carry learned information from one conversation into future ones. Unlike short-term conversation transcripts, long-term memory stores facts as vectors and retrieves them via cosine similarity. Memories are scoped to the specific agent and the user who created them; agents cannot access memories from other agents, even within the same Harness. Retrieval returns up to five memories with a similarity score above 0.3.
  11. Overview of kagent MCP servers

    A kagent installation includes two pre-registered Model Context Protocol (MCP) servers. These servers are deployed as subcharts of the kagent chart and create RemoteMCPServer resources in the kagent namespace. By default, they are not bound to any agent; you must add a tool binding to an AgentTemplate for an agent to access these tools.

    • kagent-tool-server: Provides 124 tools for Kubernetes, Helm, Istio, Cilium, Argo Rollouts, Prometheus, and Kubescape. Enabled via Helm value kagent-tools.enabled.
    • kagent-grafana-mcp: Grafana's own MCP server for dashboards, data sources, alerts, Loki logs, and incidents. Enabled via Helm value grafana-mcp.enabled.
  12. Overview of kagent platform

    kagent is an open-source, Kubernetes-native platform for running AI agents. It treats agent runtimes and behaviors as Kubernetes custom resources, allowing them to be managed via GitOps and standard observability tools. It supports all major LLM providers and runs agents using Go and Python engines (based on Google's Agent Development Kit), Codex, Claude coding agents, or custom images. Each agent conversation runs within 'Agent Substrate', a sandboxed compute layer designed for bursty, mostly idle workloads that supports suspend-and-resume functionality.