diff --git a/public/images/kagent-hitl.svg b/public/images/kagent-hitl.svg new file mode 100644 index 00000000..29fc2ede --- /dev/null +++ b/public/images/kagent-hitl.svg @@ -0,0 +1,4 @@ + + +UserUserUIUIExecutorExecutorADKADKToolToolTool requires approvalSend messageA2A MessageInvoke agentCall toolrequest_confirmation()input_required eventA2A EventShow Approve / RejectApproveA2A MessageResumeExecute toolReturn resultReject (with reason)A2A MessageResume with rejectionPass rejection to LLM[Approved][Rejected]alt \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml index 64d3b783..b4092464 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,756 +2,805 @@ https://kagent.dev/agents - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/blog - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/community - 2026-02-16 + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/agent-memory + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/concepts/agents - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/concepts/architecture - 2026-02-16 + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/context-management + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/git-based-skills + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/human-in-the-loop + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/multi-runtime + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/concepts - 2026-02-16 + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/prompt-templates + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/concepts/tools - 2026-02-16 + 2026-03-11 + weekly + 0.8 + + + + https://kagent.dev/docs/kagent/concepts/tools-ecosystem + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/a2a-agents - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/a2a-byo - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/agents-mcp - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/crewai-byo - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/discord-a2a - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/documentation - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/langchain-byo - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/skills - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/examples/slack-a2a - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started/first-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started/first-mcp-tool - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started/local-development - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started/quickstart - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/getting-started/system-prompts - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/introduction/installation - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/introduction - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/introduction/what-is-kagent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/observability/audit-prompts - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/observability/launch-ui - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/observability - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/observability/tracing - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/operations/debug - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/operations/operational-considerations - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/operations - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/operations/uninstall - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/operations/upgrade - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/api-ref - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-add-mcp - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-bug-report - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-build - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-completion - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-dashboard - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-deploy - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-get - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-help - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-init - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-install - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-invoke - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-mcp - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-run - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-uninstall - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli/kagent-version - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/cli - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/faq - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/helm - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/resources/release-notes - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/amazon-bedrock - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/anthropic - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/azure-openai - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/byo-openai - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/gemini - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/google-vertexai - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/ollama - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers/openai - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kagent/supported-providers - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/deploy/install-controller - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/deploy - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/deploy/server - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/develop/fastmcp-python - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/develop/mcp-go - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/develop - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/introduction - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/quickstart - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/api-ref - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-add-tool - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-build - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-completion - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-deploy - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-help - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-init - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-install - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-run - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference/kmcp-secrets - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/reference - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs/kmcp/secrets - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/docs - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/enterprise - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/page.tsx - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/argo-rollouts-conversion-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/cilium-crd-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/helm-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/istio-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/k8s-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/kgateway-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/observability-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/agents/promql-agent - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/istio - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/kubernetes - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/prometheus - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/documentation - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/helm - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/argo - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/grafana - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/other - 2026-02-16 + 2026-03-11 weekly 0.8 https://kagent.dev/tools/cilium - 2026-02-16 + 2026-03-11 weekly 0.8 diff --git a/src/app/docs/kagent/concepts/agent-memory/page.mdx b/src/app/docs/kagent/concepts/agent-memory/page.mdx index bd4f0591..8fe39223 100644 --- a/src/app/docs/kagent/concepts/agent-memory/page.mdx +++ b/src/app/docs/kagent/concepts/agent-memory/page.mdx @@ -12,93 +12,104 @@ export const metadata = { # Agent Memory -kagent provides long-term memory for agents using vector similarity search. Agents can automatically save and retrieve relevant context across conversations. +With agent memory, your agents can automatically save and retrieve relevant context across conversations using vector similarity search. Memory is built on top of the Google ADK memory implementation. ## Overview -Memory in kagent is: -- **Vector-backed** — Uses embedding models to encode memories as 768-dimensional vectors -- **Searchable** — Retrieves relevant memories via cosine similarity -- **Automatic** — Extracts and saves memories periodically without explicit user action -- **Time-bounded** — Memories expire after a configurable TTL (default 15 days) +Agent memory provides the following capabilities. -## Supported Storage Backends - -| Backend | Description | -|---------|-------------| -| **pgvector** (PostgreSQL) | Full-featured vector search using the pgvector extension | -| **Turso/libSQL** (SQLite) | Lightweight alternative using SQLite-compatible storage | +- **Vector-backed.** A basic vector store uses embedding models to encode memories as 768-dimensional vectors. +- **Searchable.** Agents retrieve relevant memories via cosine similarity. +- **Automatic.** Agents extract and save user intent, key learnings, and preferences without explicit user action. +- **Time-bounded.** Memories expire after a configurable TTL (default 15 days). +- **Shared storage.** Memory uses the same kagent database (PostgreSQL or SQLite/Turso), not a separate database. ## Configuration ### Enable Memory on an Agent +To enable memory, set the `memory` field on the declarative agent spec. The `modelConfig` field references a `ModelConfig` object whose embedding provider generates memory vectors. + +You can also configure memory in the kagent UI when you create or edit an agent by selecting an embedding model and setting the memory TTL. + ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: memory-agent + namespace: kagent spec: type: Declarative declarative: modelConfig: default-model-config systemMessage: "You are a helpful assistant with long-term memory." memory: - enabled: true - embeddingProvider: - type: OpenAI - model: text-embedding-3-small + modelConfig: default-model-config # References the embedding provider ``` -### Memory with Separate Embedding Provider +### Custom TTL + +To change the default memory retention period, set the `ttlDays` field. ```yaml memory: - enabled: true - embeddingProvider: - type: OpenAI - model: text-embedding-3-small - secretRef: - name: openai-embedding-key + modelConfig: default-model-config + ttlDays: 30 # Memories expire after 30 days instead of the default 15 ``` ## How Memory Works ### Automatic Save Cycle -1. The agent processes user messages normally -2. Every 5th user message, the agent automatically extracts key information -3. Extracted memories are summarized and encoded as embedding vectors -4. Vectors are stored in the database with metadata and timestamps +1. The agent processes user messages normally. +2. Every 5th user message, the agent automatically extracts key information such as user intent, key learnings, and preferences. +3. The agent summarizes extracted memories and encodes them as embedding vectors. +4. The agent stores the vectors in the database with metadata and timestamps. ### Memory Retrieval (Prefetch) -Before generating a response, the agent: -1. Encodes the current user message as an embedding vector -2. Searches stored memories by cosine similarity -3. Injects the most relevant memories into the agent's context +Before generating a response, the agent performs the following steps. + +1. Encodes the current user message as an embedding vector. +2. Searches stored memories by cosine similarity. +3. Injects the most relevant memories into the agent's context. ### Memory Tools -When memory is enabled, three tools are injected into the agent: +When you enable memory, the agent receives three additional tools. | Tool | Description | |------|-------------| -| `save_memory` | Explicitly save a piece of information | -| `load_memory` | Search for relevant memories by query | -| `prefetch_memory` | Automatically run before response generation | +| `save_memory` | Explicitly save a piece of information. | +| `load_memory` | Search for relevant memories by query. | +| `prefetch_memory` | Automatically run before response generation. | + +You can also instruct the agent to use `save_memory` or `load_memory` explicitly during a conversation. + +### Viewing Memories + +In the kagent UI, you can view the memories that an agent has saved. This lets you inspect what the agent has learned and retained from past interactions. ## Memory Management via API +The following API endpoints let you manage memories programmatically. + ``` -GET /api/memories/{agentId} # List memories -DELETE /api/memories/{agentId} # Clear all memories -DELETE /api/memories/{agentId}/{id} # Delete specific memory +POST /api/memories/sessions # Add a memory +POST /api/memories/sessions/batch # Add memories in batch +POST /api/memories/search # Search memories by cosine similarity +GET /api/memories?agent_name=X&user_id=Y # List memories +DELETE /api/memories?agent_name=X&user_id=Y # Clear all memories for an agent ``` +## Limitations + +- **No per-memory deletion.** You can clear all memories for an agent, but you cannot delete individual memory entries. +- **No cross-agent memory sharing.** Each agent has its own isolated memory store. You cannot share memories across agents. +- **Not pluggable.** Memory is built on the Google ADK memory implementation and cannot be swapped for an alternative memory solution (such as Cognee). However, if an alternative memory solution exposes an MCP server, you can add it as a tool and instruct the agent to use it instead of the built-in memory. + ## Technical Details -- Embedding vectors are normalized to 768 dimensions -- Background TTL pruning runs periodically (default retention: 15 days) -- Memory is per-agent — each agent has its own isolated memory store -- Memories include timestamps and source session references +- Embedding vectors are normalized to 768 dimensions. +- Background TTL pruning runs periodically (default retention: 15 days). +- Memories include timestamps and source session references. diff --git a/src/app/docs/kagent/concepts/context-management/page.mdx b/src/app/docs/kagent/concepts/context-management/page.mdx index c58ddb60..d9cea4ca 100644 --- a/src/app/docs/kagent/concepts/context-management/page.mdx +++ b/src/app/docs/kagent/concepts/context-management/page.mdx @@ -12,45 +12,74 @@ export const metadata = { # Context Management -Long conversations can exceed LLM context windows. kagent provides **event compaction** to automatically summarize older messages, preserving key information while reducing token count. +Long conversations can exceed LLM context windows. With **event compaction**, you can automatically summarize older messages to preserve key information while reducing token count. ## Configuration +To enable compaction, set the `context.compaction` field on the declarative agent spec. + ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: long-conversation-agent + namespace: kagent spec: type: Declarative declarative: modelConfig: default-model-config systemMessage: "You are a helpful agent for extended sessions." context: - eventsCompaction: - enabled: true + compaction: + compactionInterval: 5 # Compact every 5 user invocations ``` +### Configuration Options + +| Field | Default | Description | +|-------|---------|-------------| +| `compactionInterval` | `5` | Number of new user invocations before triggering a compaction. | +| `overlapSize` | `2` | Number of preceding invocations to include for context overlap. | +| `eventRetentionSize` | — | Number of most recent events to always retain. | +| `tokenThreshold` | — | Post-invocation token threshold. When the prompt token count meets or exceeds this value, compaction triggers. | +| `summarizer` | — | Optional LLM-based summarizer configuration (see below). | + +### Summarizer + +By default, compacted events are dropped from the context without summarization. To preserve a summary of compacted events, configure the `summarizer` field. + +```yaml +context: + compaction: + compactionInterval: 5 + summarizer: + modelConfig: summarizer-model-config # Optional: uses agent's own model if omitted +``` + +| Field | Description | +|-------|-------------| +| `summarizer.modelConfig` | Name of a `ModelConfig` resource to use for summarization. If omitted, the agent's own model is used. | +| `summarizer.promptTemplate` | Custom prompt template for the summarizer. | + ## How It Works -1. As the conversation progresses, events accumulate in the session history -2. When the history approaches the model's context limit, compaction triggers -3. Older events are summarized while preserving: - - Key decisions and outcomes - - Important tool results - - Critical context from earlier in the conversation -4. The agent continues with the compacted history seamlessly +1. As the conversation progresses, events accumulate in the session history. +2. Compaction triggers when one of two conditions is met: the number of new user invocations reaches the `compactionInterval`, or the prompt token count exceeds the `tokenThreshold` (if set). +3. If a `summarizer` is configured, older events are summarized by an LLM. Otherwise, compacted events are dropped from the context. +4. The agent continues with the compacted history seamlessly. ## When to Use -Enable event compaction when: -- Agents handle long-running conversations (debugging sessions, investigations) -- Agents call many tools that generate large outputs -- You want to support extended interactions without hitting context limits +Enable event compaction when your agents meet the following criteria. + +- Agents handle long-running conversations (debugging sessions, investigations). +- Agents call many tools that generate large outputs. +- You want to support extended interactions without hitting context limits. + +You may not need event compaction for the following scenarios. -You may not need it for: -- Short, single-turn interactions -- Agents with small tool sets that generate compact outputs +- Short, single-turn interactions. +- Agents with small tool sets that generate compact outputs. ## Context Caching Note diff --git a/src/app/docs/kagent/concepts/git-based-skills/page.mdx b/src/app/docs/kagent/concepts/git-based-skills/page.mdx index 4e04a64c..9a948aa8 100644 --- a/src/app/docs/kagent/concepts/git-based-skills/page.mdx +++ b/src/app/docs/kagent/concepts/git-based-skills/page.mdx @@ -12,15 +12,16 @@ export const metadata = { # Git-Based Skills -Skills are markdown-based knowledge documents that agents load at startup. They provide domain-specific instructions, best practices, and procedures that guide agent behavior. +Skills are markdown-based knowledge documents that agents load at startup. You can use skills to provide domain-specific instructions, best practices, and procedures that guide agent behavior. -kagent supports two sources for skills: -- **OCI images** — Container images containing skill files (original approach) -- **Git repositories** — Clone skills directly from Git repos +You can load skills from two sources. + +- **OCI images.** Container images containing skill files (original approach). +- **Git repositories.** Clone skills directly from Git repos. ## Skill File Format -Each skill is a directory containing a `SKILL.md` file with YAML frontmatter: +Each skill is a directory containing a `SKILL.md` file with YAML frontmatter. ```markdown --- @@ -48,6 +49,7 @@ apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: my-agent + namespace: kagent spec: type: Declarative declarative: @@ -61,22 +63,24 @@ spec: ### With Subdirectory +You can specify a subdirectory within the repository to use as the skill root. + ```yaml skills: gitRefs: - url: https://github.com/myorg/monorepo.git ref: main - path: skills/kubernetes + path: skills/kubernetes # Only use this subdirectory ``` ### Multiple Sources -Combine Git and OCI skills: +You can combine Git and OCI skills in the same agent. ```yaml skills: refs: - - image: ghcr.io/myorg/k8s-skills:latest + - ghcr.io/myorg/k8s-skills:latest gitRefs: - url: https://github.com/myorg/skills-repo.git ref: main @@ -94,6 +98,7 @@ apiVersion: v1 kind: Secret metadata: name: git-credentials + namespace: kagent type: Opaque stringData: token: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -123,15 +128,15 @@ skills: ## How It Works -Under the hood, kagent uses a lightweight init container (~30MB) containing Git and krane tools: +Under the hood, a lightweight init container (~30MB) containing Git and krane tools runs before the agent pod starts. -1. Before the agent pod starts, the `skills-init` container runs -2. It clones each Git repository to the skills volume -3. It also pulls any OCI skill images -4. The agent runtime discovers skills from the mounted volume at startup +1. The `skills-init` container clones each Git repository to the skills volume. +2. The container pulls any OCI skill images. +3. The agent runtime discovers skills from the mounted volume at startup. ## Skill Discovery at Runtime -Once loaded, skills are available through the built-in `SkillsTool`: -- **List skills:** The agent calls the tool with no arguments to see available skills -- **Load skill:** The agent calls the tool with a skill name to get the full content +Once loaded, skills are available through the built-in `SkillsTool`. + +- **List skills.** The agent calls the tool with no arguments to see available skills. +- **Load skill.** The agent calls the tool with a skill name to get the full content. diff --git a/src/app/docs/kagent/concepts/human-in-the-loop/page.mdx b/src/app/docs/kagent/concepts/human-in-the-loop/page.mdx index 6d14344b..fc61d1a1 100644 --- a/src/app/docs/kagent/concepts/human-in-the-loop/page.mdx +++ b/src/app/docs/kagent/concepts/human-in-the-loop/page.mdx @@ -12,10 +12,10 @@ export const metadata = { # Human-in-the-Loop (HITL) -kagent implements Human-in-the-Loop functionality through two mechanisms: +You can use two Human-in-the-Loop mechanisms to maintain oversight of agent actions. -1. **Tool Approval** — Require user confirmation before executing sensitive tools -2. **Ask User** — Allow agents to interactively ask users questions during execution +1. **Tool Approval.** Require user confirmation before executing sensitive tools. +2. **Ask User.** Allow agents to interactively ask users questions during execution. Both features pause agent execution and wait for user input before continuing. @@ -25,21 +25,23 @@ Both features pause agent execution and wait for user input before continuing. Tool approval lets you mark specific tools as requiring user confirmation before execution. When an agent attempts to call an approval-required tool, execution pauses and the UI presents Approve/Reject buttons. -This is useful for destructive or sensitive operations like: -- Deleting Kubernetes resources -- Writing files -- Executing shell commands -- Modifying infrastructure +Tool approval is useful for destructive or sensitive operations. + +- Deleting Kubernetes resources. +- Writing files. +- Executing shell commands. +- Modifying infrastructure. ### Configuration -Add `requireApproval` to your Agent's tool specification. The values must be a subset of `toolNames`: +You configure tool approval in the Agent CR (not in the UI). Add `requireApproval` to your Agent's tool specification. The values must be a subset of `toolNames`. ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: k8s-agent + namespace: kagent spec: type: Declarative declarative: @@ -48,61 +50,66 @@ spec: tools: - type: McpServer mcpServer: + apiGroup: kagent.dev name: kagent-tool-server kind: RemoteMCPServer toolNames: - - read_file - - write_file - - delete_file - requireApproval: - - delete_file - - write_file + - k8s_get_resources + - k8s_describe_resource + - k8s_delete_resource + - k8s_apply_manifest + requireApproval: # These tools pause for user approval + - k8s_delete_resource + - k8s_apply_manifest ``` -In this example, `read_file` executes immediately, but `write_file` and `delete_file` will pause for user approval. +In this example, `k8s_get_resources` and `k8s_describe_resource` execute immediately, but `k8s_delete_resource` and `k8s_apply_manifest` pause for user approval. ### How It Works **Interrupt Phase:** -1. The agent calls a tool marked for approval -2. The ADK generates an `adk_request_confirmation` event -3. The UI receives the event and displays approval controls +1. The agent calls a tool marked for approval. +2. The ADK generates an `adk_request_confirmation` event. +3. The UI receives the event and displays approval controls. **Decision Phase:** -4. The user clicks **Approve** or **Reject** in the UI -5. Optionally, the user provides a rejection reason +4. The user clicks **Approve** or **Reject** in the UI. +5. Optionally, the user provides a rejection reason. **Resume Phase:** -6. **Approved** tools execute normally and return results -7. **Rejected** tools return a rejection message — the LLM sees this and responds accordingly +6. **Approved** tools execute normally and return results. +7. **Rejected** tools return a rejection message. The LLM sees this and responds accordingly. ### Parallel Tool Approval -When an agent generates multiple tool calls simultaneously, all pending approvals are presented together. Users can approve/reject individually or in batch. +When an agent generates multiple tool calls simultaneously, the UI presents all pending approvals together. You can approve or reject each tool call individually or in batch. ### Rejection Reasons -When rejecting a tool call, users can provide a free-text explanation. This reason is passed back to the LLM as context, helping it understand why the tool was blocked and adjust its approach. +When you reject a tool call, you can provide a free-text explanation. This reason is passed back to the LLM as context, helping it understand why the tool was blocked and adjust its approach. --- ## Ask User Tool -The `ask_user` tool is a built-in tool automatically added to every agent. It allows agents to pose questions to users with optional predefined choices during execution. +The `ask_user` tool is a built-in tool that is automatically added to every agent. It allows agents to pose questions to users with optional predefined choices during execution. + +For example, an agent might ask "Which types of Kubernetes resources should I check?" and present options like Pods, Deployments, and Services as selectable choices. + +Common use cases include the following. -Use cases: -- Clarifying ambiguous user requests -- Offering choices between implementation approaches -- Collecting configuration preferences -- Getting confirmation on proposed plans +- Clarifying ambiguous user requests. +- Offering choices between implementation approaches. +- Collecting configuration preferences. +- Getting confirmation on proposed plans. ### Question Types | Type | Configuration | UI Rendering | |------|--------------|--------------| -| Single-select | `choices: [...]`, `multiple: false` | Choice chips (select one) | -| Multi-select | `choices: [...]`, `multiple: true` | Choice chips (select many) | -| Free-text | `choices: []` | Text input field | +| Single-select | `choices: [...]`, `multiple: false` | Choice chips (select one). | +| Multi-select | `choices: [...]`, `multiple: true` | Choice chips (select many). | +| Free-text | `choices: []` | Text input field. | ### No Configuration Required @@ -110,21 +117,18 @@ The `ask_user` tool is added unconditionally to every agent as a built-in tool. ## Architecture Summary -``` -User --> UI --> A2A Message --> Executor --> ADK --> Tool - | - request_confirmation() - | - <-- input_required --> - | -User <-- UI <-- A2A Event <-- Executor <---- ADK <----+ - | - v (Approve/Reject/Answer) - | -User --> UI --> A2A Message --> Executor --> ADK --> Tool (resumes) -``` +Both tool approval and `ask_user` share the same underlying flow through the ADK `request_confirmation` mechanism. + +![HITL architecture diagram](/images/kagent-hitl.svg) + +### Request flow + +1. **User → UI → Executor → ADK → Tool.** The user sends a message. The UI forwards it as an A2A message to the executor, which invokes the ADK, which calls the tool. +2. **Tool → ADK → Executor → UI → User.** The tool calls `request_confirmation()`. The ADK emits an `input_required` event. The executor sends an A2A event to the UI, which displays approval controls or questions to the user. +3. **User → UI → Executor → ADK → Tool (resumes).** The user approves, rejects, or answers. The UI sends the response back through the same chain. The ADK resumes the tool with the result. + +### Design principles -Key design principles: -- **Deterministic replay** — Approved calls re-invoke via ADK preprocessor without additional LLM calls -- **Minimal custom logic** — The executor only handles the resume path -- **Unified mechanism** — Both tool approval and ask_user share the same `request_confirmation` infrastructure +- **Deterministic replay.** Approved calls re-invoke via ADK preprocessor without additional LLM calls. +- **Minimal custom logic.** The executor only handles the resume path. +- **Unified mechanism.** Both tool approval and `ask_user` share the same `request_confirmation` infrastructure. diff --git a/src/app/docs/kagent/concepts/multi-runtime/page.mdx b/src/app/docs/kagent/concepts/multi-runtime/page.mdx index 0fe44818..7d7ac546 100644 --- a/src/app/docs/kagent/concepts/multi-runtime/page.mdx +++ b/src/app/docs/kagent/concepts/multi-runtime/page.mdx @@ -12,7 +12,7 @@ export const metadata = { # Multi-Runtime Support (Go / Python ADK) -kagent supports two Agent Development Kit (ADK) runtimes for declarative agents. +You can choose between two **Agent Development Kit (ADK)** runtimes for your declarative agents. ## Overview @@ -35,10 +35,11 @@ apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: python-agent + namespace: kagent spec: type: Declarative declarative: - runtime: python + runtime: python # Default runtime modelConfig: default-model-config systemMessage: "You are a helpful agent." ``` @@ -50,10 +51,11 @@ apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: go-agent + namespace: kagent spec: type: Declarative declarative: - runtime: go + runtime: go # Faster startup, lower resource usage modelConfig: default-model-config systemMessage: "You are a fast-starting agent." ``` @@ -61,39 +63,40 @@ spec: ## When to Use Which **Choose Go when:** -- Fast startup matters (autoscaling, cold starts) -- Lower resource consumption is important -- You don't need Python-specific framework integrations +- Fast startup matters (autoscaling, cold starts). +- Lower resource consumption is important. +- You don't need Python-specific framework integrations. **Choose Python when:** -- You need Google ADK-native features -- You want to use CrewAI, LangGraph, or OpenAI framework integrations -- You need Python-based custom tools or skills +- You need Google ADK-native features. +- You want to use CrewAI, LangGraph, or OpenAI framework integrations. +- You need Python-based custom tools or skills. ## Go ADK Built-in Tools | Tool | Description | |------|-------------| -| `SkillsTool` | Discover and load skills from the skills directory | -| `BashTool` | Execute shell commands with timeout handling | -| `ReadFile` | Read file contents with line numbers and pagination | -| `WriteFile` | Write content to files (creates directories as needed) | -| `EditFile` | String replacement with ambiguity detection | +| `SkillsTool` | Discover and load skills from the skills directory. | +| `BashTool` | Execute shell commands with timeout handling. | +| `ReadFile` | Read file contents with line numbers and pagination. | +| `WriteFile` | Write content to files (creates directories as needed). | +| `EditFile` | String replacement with ambiguity detection. | ## BYO (Bring Your Own) Agents -For maximum flexibility, bring your own agent container: +For maximum flexibility, you can bring your own agent container. ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: custom-agent + namespace: kagent spec: type: BYO byo: - image: myregistry/my-custom-agent:v1.0 deployment: + image: myregistry/my-custom-agent:v1.0 replicas: 1 resources: requests: diff --git a/src/app/docs/kagent/concepts/prompt-templates/page.mdx b/src/app/docs/kagent/concepts/prompt-templates/page.mdx index af3a5abf..e51a4585 100644 --- a/src/app/docs/kagent/concepts/prompt-templates/page.mdx +++ b/src/app/docs/kagent/concepts/prompt-templates/page.mdx @@ -12,74 +12,84 @@ export const metadata = { # Prompt Templates -kagent supports Go `text/template` syntax in Agent system messages, enabling composition from reusable fragments stored in ConfigMaps. +You can use Go `text/template` syntax in Agent system messages to compose reusable fragments stored in ConfigMaps. ## Overview -Instead of duplicating safety guidelines and tool usage instructions in every agent, you can: -1. Store common prompt fragments in ConfigMaps -2. Reference them using `{{include "source/key"}}` syntax -3. Use agent context variables for dynamic interpolation +Instead of duplicating safety guidelines and tool usage instructions in every agent, you can take the following approach. -Template resolution happens during controller reconciliation — the final system message is fully expanded before reaching the agent runtime. +1. Store common prompt fragments in ConfigMaps. +2. Reference them using `{{include "source/key"}}` syntax. +3. Use agent context variables for dynamic interpolation. + +The controller resolves templates during reconciliation. The final system message is fully expanded before reaching the agent runtime. ## Built-in Prompt Templates -kagent ships a `kagent-builtin-prompts` ConfigMap with five reusable templates: +The `kagent-builtin-prompts` ConfigMap ships with five reusable templates. | Template Key | Description | |-------------|-------------| -| `skills-usage` | Instructions for discovering and using skills | -| `tool-usage-best-practices` | Best practices for tool invocation | -| `safety-guardrails` | Safety and operational guardrails | -| `kubernetes-context` | Kubernetes-specific operational context | -| `a2a-communication` | Agent-to-agent communication guidelines | +| `skills-usage` | Instructions for discovering and using skills. | +| `tool-usage-best-practices` | Best practices for tool invocation. | +| `safety-guardrails` | Safety and operational guardrails. | +| `kubernetes-context` | Kubernetes-specific operational context. | +| `a2a-communication` | Agent-to-agent communication guidelines. | ## Usage +Each data source in `promptTemplate.dataSources` references a ConfigMap by `name` and `kind`, with an optional `alias` for shorter include directives. + ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: k8s-agent + namespace: kagent spec: type: Declarative declarative: modelConfig: default-model-config promptTemplate: dataSources: - - configMapRef: - name: kagent-builtin-prompts - - configMapRef: - name: my-custom-prompts + - kind: ConfigMap + name: kagent-builtin-prompts + alias: builtin # Use "builtin/key" in include directives + - kind: ConfigMap + name: my-custom-prompts systemMessage: | You are a Kubernetes management agent named {{.AgentName}}. - {{include "kagent-builtin-prompts/safety-guardrails"}} - {{include "kagent-builtin-prompts/tool-usage-best-practices"}} + {{include "builtin/safety-guardrails"}} + {{include "builtin/tool-usage-best-practices"}} {{include "my-custom-prompts/k8s-specific-rules"}} Your tools: {{.ToolNames}} Your skills: {{.SkillNames}} ``` +When you set an `alias`, use `include("alias/key")`. Otherwise, use `include("name/key")`. + ### Available Template Variables | Variable | Description | |----------|-------------| -| `{{.AgentName}}` | Name of the Agent resource | -| `{{.AgentNamespace}}` | Namespace of the Agent resource | -| `{{.Description}}` | Agent description | -| `{{.ToolNames}}` | Comma-separated list of tool names | -| `{{.SkillNames}}` | Comma-separated list of skill names | +| `{{.AgentName}}` | Name of the Agent resource. | +| `{{.AgentNamespace}}` | Namespace of the Agent resource. | +| `{{.Description}}` | Agent description. | +| `{{.ToolNames}}` | Comma-separated list of tool names. | +| `{{.SkillNames}}` | Comma-separated list of skill names. | ### Creating Custom Prompt Templates +You can create your own prompt templates by adding keys to a ConfigMap. + ```yaml apiVersion: v1 kind: ConfigMap metadata: name: my-custom-prompts + namespace: kagent data: incident-response: | ## Incident Response Guidelines @@ -93,10 +103,10 @@ data: ## How It Works -1. The controller watches ConfigMaps referenced in `promptTemplate.dataSources` -2. During reconciliation, `{{include "configmap-name/key"}}` directives are resolved -3. Template variables are interpolated -4. The fully expanded system message is written to the ADK config -5. ConfigMap changes trigger automatic re-reconciliation +1. The controller watches ConfigMaps referenced in `promptTemplate.dataSources`. +2. During reconciliation, the controller resolves `{{include "alias/key"}}` directives. +3. The controller interpolates template variables. +4. The controller writes the fully expanded system message to the ADK config. +5. ConfigMap changes trigger automatic re-reconciliation. -> **Security Note:** Only ConfigMaps are supported as data sources — Secret references were intentionally excluded to avoid leaking sensitive data into prompts sent to LLM providers. +> **Security Note:** Only ConfigMaps are supported as data sources. Secret references were intentionally excluded to avoid leaking sensitive data into prompts sent to LLM providers. diff --git a/src/app/docs/kagent/concepts/tools-ecosystem/page.mdx b/src/app/docs/kagent/concepts/tools-ecosystem/page.mdx index 133b562d..bd4c1cc3 100644 --- a/src/app/docs/kagent/concepts/tools-ecosystem/page.mdx +++ b/src/app/docs/kagent/concepts/tools-ecosystem/page.mdx @@ -12,123 +12,186 @@ export const metadata = { # Tools Ecosystem -kagent provides a rich set of built-in tools through MCP (Model Context Protocol) servers, plus the ability to add custom tools. All tools are integrated via the kagent-tools package. +You can use a rich set of built-in tools through **Model Context Protocol (MCP)** servers, plus add your own custom tools. Two primary MCP servers serve the tools: `kagent-tool-server` (Kubernetes, Helm, Istio, Cilium, Argo) and `kagent-grafana-mcp` (Grafana, Prometheus, Loki, Incidents). -## Built-in Tool Categories +## kagent-tool-server Tools ### Kubernetes -Comprehensive cluster management tools: +The following tools provide comprehensive cluster management. | Tool | Description | |------|-------------| -| `kubectl_get` | Query resources (pods, deployments, services, etc.) | -| `kubectl_describe` | Detailed resource information | -| `kubectl_scale` | Scale deployments and statefulsets | -| `kubectl_patch` | Patch resources with strategic merge | -| `kubectl_label` | Add/remove labels | -| `kubectl_annotate` | Add/remove annotations | -| `kubectl_delete` | Delete resources | -| `kubectl_apply` | Apply YAML manifests | -| `kubectl_exec` | Execute commands in pods | -| `kubectl_logs` | Retrieve pod logs | -| `kubectl_events` | Get cluster events | -| `kubectl_connectivity_test` | Test service connectivity | +| `k8s_get_resources` | Query resources (pods, deployments, services, etc.). | +| `k8s_describe_resource` | Get detailed resource information. | +| `k8s_get_resource_yaml` | Get YAML representation of a resource. | +| `k8s_get_pod_logs` | Retrieve pod logs. | +| `k8s_get_events` | Get cluster events. | +| `k8s_get_available_api_resources` | List supported API resources. | +| `k8s_get_cluster_configuration` | Retrieve cluster configuration. | +| `k8s_check_service_connectivity` | Test service connectivity. | +| `k8s_execute_command` | Execute commands in pods. | +| `k8s_patch_resource` | Patch resources with strategic merge. | +| `k8s_label_resource` | Add labels to resources. | +| `k8s_remove_label` | Remove labels from resources. | +| `k8s_annotate_resource` | Add annotations to resources. | +| `k8s_remove_annotation` | Remove annotations from resources. | +| `k8s_delete_resource` | Delete resources. | +| `k8s_apply_manifest` | Apply YAML manifests. | +| `k8s_create_resource` | Create a resource from a local file. | +| `k8s_create_resource_from_url` | Create a resource from a URL. | +| `k8s_generate_resource` | Generate YAML for Istio, Gateway API, or Argo resources. | +| `k8s_rollout` | Manage rollouts (restart, status, history). | +| `k8s_scale` | Scale a resource (deployment, statefulset, etc.). | ### Helm | Tool | Description | |------|-------------| -| `helm_list` | List installed releases | -| `helm_install` | Install a chart | -| `helm_upgrade` | Upgrade a release | -| `helm_uninstall` | Remove a release | -| `helm_repo_add` | Add chart repository | -| `helm_repo_update` | Update chart repositories | +| `helm_list_releases` | List installed releases. | +| `helm_get_release` | Get details of a specific release. | +| `helm_upgrade` | Upgrade a release. | +| `helm_uninstall` | Remove a release. | +| `helm_repo_add` | Add a chart repository. | +| `helm_repo_update` | Update chart repositories. | ### Istio | Tool | Description | |------|-------------| -| `istio_proxy_status` | Check proxy synchronization status | -| `istio_proxy_config` | Inspect proxy configuration | -| `istio_install` | Install Istio | -| `istio_manifest_generate` | Generate installation manifests | -| `istio_analyze` | Analyze Istio configuration for issues | -| `istio_version` | Get Istio version info | -| `istio_remote_clusters` | Manage remote cluster configuration | -| `istio_waypoint` | Manage waypoint proxies | +| `istio_proxy_status` | Check proxy synchronization status. | +| `istio_proxy_config` | Inspect proxy configuration. | +| `istio_install_istio` | Install Istio. | +| `istio_generate_manifest` | Generate installation manifests. | +| `istio_analyze_cluster_configuration` | Analyze Istio configuration for issues. | +| `istio_version` | Get Istio version info. | +| `istio_remote_clusters` | Manage remote cluster configuration. | +| `istio_waypoint_status` | Get waypoint proxy status. | +| `istio_list_waypoints` | List waypoint proxies. | +| `istio_generate_waypoint` | Generate waypoint configuration. | +| `istio_apply_waypoint` | Apply waypoint configuration. | +| `istio_delete_waypoint` | Delete a waypoint proxy. | +| `istio_ztunnel_config` | Inspect ztunnel configuration. | ### Argo Rollouts | Tool | Description | |------|-------------| -| `argo_rollouts_verify` | Verify controller is running | -| `argo_rollouts_check_plugins` | Check installed plugins | -| `argo_rollouts_promote` | Promote a rollout | -| `argo_rollouts_pause` | Pause a rollout | -| `argo_rollouts_set_image` | Update rollout image | +| `argo_verify_argo_rollouts_controller_install` | Verify the Argo Rollouts controller is running. | +| `argo_rollouts_list` | List Argo Rollouts in a namespace. | +| `argo_promote_rollout` | Promote a paused rollout. | +| `argo_pause_rollout` | Pause a rollout. | +| `argo_set_rollout_image` | Set the image of a rollout. | +| `argo_check_plugin_logs` | Check Argo Rollouts plugin logs. | +| `argo_verify_kubectl_plugin_install` | Verify the kubectl Argo Rollouts plugin is installed. | +| `argo_verify_gateway_plugin` | Verify the Argo Rollouts gateway plugin. | ### Cilium +The following table shows a subset of Cilium tools. Cilium has 30+ tools available. + | Tool | Description | |------|-------------| -| `cilium_status` | Check Cilium status | -| `cilium_install` | Install Cilium | -| `cilium_upgrade` | Upgrade Cilium | -| `cilium_clustermesh` | Manage cluster mesh | -| `cilium_bgp_peers` | View BGP peers | -| `cilium_bgp_routes` | View BGP routes | +| `cilium_status_and_version` | Check Cilium status and version. | +| `cilium_install_cilium` | Install Cilium. | +| `cilium_upgrade_cilium` | Upgrade Cilium. | +| `cilium_toggle_cluster_mesh` | Enable or disable cluster mesh. | +| `cilium_show_cluster_mesh_status` | View cluster mesh status. | +| `cilium_list_bgp_peers` | View BGP peers. | +| `cilium_list_bgp_routes` | View BGP routes. | +| `cilium_get_endpoints_list` | List endpoints. | +| `cilium_get_endpoint_details` | Get endpoint details. | +| `cilium_validate_cilium_network_policies` | Validate network policies. | +| `cilium_toggle_hubble` | Enable or disable Hubble observability. | + +### Kubescape + +| Tool | Description | +|------|-------------| +| `kubescape_check_health` | Check Kubescape health status. | +| `kubescape_list_vulnerabilities` | List vulnerabilities. | +| `kubescape_get_vulnerability_details` | Get details of a specific vulnerability. | +| `kubescape_list_vulnerability_manifests` | List vulnerability manifests. | +| `kubescape_list_configuration_scans` | List configuration scans. | +| `kubescape_get_configuration_scan` | Get a specific configuration scan. | +| `kubescape_list_application_profiles` | List application profiles. | +| `kubescape_get_application_profile` | Get a specific application profile. | +| `kubescape_list_network_neighborhoods` | List network neighborhoods. | +| `kubescape_get_network_neighborhood` | Get a specific network neighborhood. | + +## kagent-grafana-mcp Tools + +A separate `kagent-grafana-mcp` MCP server (`RemoteMCPServer`) serves tools for Prometheus, Grafana, Loki, and incident management. ### Prometheus | Tool | Description | |------|-------------| -| `prometheus_query` | Execute instant PromQL queries | -| `prometheus_query_range` | Execute range PromQL queries | -| `prometheus_labels` | Discover available labels | -| `prometheus_targets` | List scrape targets and status | +| `query_prometheus` | Execute PromQL queries. | +| `list_prometheus_metric_names` | List available metric names. | +| `list_prometheus_metric_metadata` | Get metric metadata. | +| `list_prometheus_label_names` | List available label names. | +| `list_prometheus_label_values` | List values for a specific label. | ### Grafana | Tool | Description | |------|-------------| -| `grafana_orgs` | Manage organizations | -| `grafana_dashboards` | List/manage dashboards | -| `grafana_alerts` | View/manage alerts | -| `grafana_datasources` | Manage data sources | +| `search_dashboards` | Search dashboards. | +| `update_dashboard` | Update a dashboard. | +| `get_dashboard_by_uid` | Get a dashboard by UID. | +| `get_dashboard_panel_queries` | Get panel queries from a dashboard. | +| `list_datasources` | List data sources. | +| `get_datasource` | Get a data source by name or UID. | +| `alerting_manage_rules` | Manage alert rules (list, create, update, delete). | +| `alerting_manage_routing` | Manage alerting routing, notification policies, and contact points. | + +### Loki + +| Tool | Description | +|------|-------------| +| `query_loki_logs` | Query logs via Loki. | +| `query_loki_stats` | Query Loki statistics. | +| `list_loki_label_names` | List Loki label names. | +| `list_loki_label_values` | List Loki label values. | -### Utilities +### Incidents & On-Call | Tool | Description | |------|-------------| -| `datetime_format` | Format timestamps | -| `datetime_parse` | Parse date strings | -| `shell_execute` | Run shell commands | -| `docs_query` | Query product documentation | +| `list_incidents` | List incidents. | +| `get_incident` | Get incident details. | +| `create_incident` | Create a new incident. | +| `add_activity_to_incident` | Add activity to an incident. | +| `list_oncall_users` | List on-call users. | +| `get_current_oncall_users` | Get current on-call users. | +| `list_oncall_schedules` | List on-call schedules. | ## Agent Built-in Tools -These tools are automatically available to every agent (no configuration needed): +The following tools are automatically available to every agent without any configuration. | Tool | Description | |------|-------------| -| `ask_user` | Pose questions to users with optional choices | -| `SkillsTool` | Discover and load skills | -| `BashTool` | Execute shell commands (Go ADK) | -| `ReadFile` | Read files with pagination (Go ADK) | -| `WriteFile` | Write file content (Go ADK) | -| `EditFile` | Edit files via string replacement (Go ADK) | +| `ask_user` | Pose questions to users with optional choices. | +| `SkillsTool` | Discover and load skills (Go ADK). | +| `bash` | Execute shell commands (Python ADK). | +| `read_file` | Read file contents with pagination (Python ADK). | +| `write_file` | Write file content (Python ADK). | +| `edit_file` | Edit files via string replacement (Python ADK). | ## Configuring Tools on an Agent ### Single MCP Server +The following example shows how to configure an agent with a single MCP server. + ```yaml apiVersion: kagent.dev/v1alpha2 kind: Agent metadata: name: k8s-agent + namespace: kagent spec: type: Declarative declarative: @@ -137,68 +200,53 @@ spec: tools: - type: McpServer mcpServer: + apiGroup: kagent.dev name: kagent-tool-server kind: RemoteMCPServer toolNames: - - kubectl_get - - kubectl_describe - - kubectl_logs - - kubectl_events + - k8s_get_resources + - k8s_describe_resource + - k8s_get_pod_logs + - k8s_get_events ``` ### With Tool Approval +You can require user approval for sensitive tools by adding `requireApproval`. + ```yaml tools: - type: McpServer mcpServer: + apiGroup: kagent.dev name: kagent-tool-server kind: RemoteMCPServer toolNames: - - kubectl_get - - kubectl_describe - - kubectl_delete - - kubectl_apply - requireApproval: - - kubectl_delete - - kubectl_apply + - k8s_get_resources + - k8s_describe_resource + - k8s_delete_resource + - k8s_apply_manifest + requireApproval: # These tools pause for user approval + - k8s_delete_resource + - k8s_apply_manifest ``` ### Agent as Tool (A2A) -Use another agent as a tool via the A2A protocol: +You can use another agent as a tool via the A2A protocol. ```yaml tools: - type: Agent agent: name: specialist-agent - namespace: default ``` ## Community / Contrib MCP Servers -Additional MCP servers available in `contrib/tools/`: +You can find additional MCP servers in `contrib/tools/`. | Server | Description | |--------|-------------| -| **GitHub MCP Server** | GitHub Copilot MCP server with tools for issues, PRs, repos, actions, and more | -| **k8sgpt MCP Server** | K8sGPT integration for AI-powered Kubernetes diagnostics | -| **Grafana MCP** | Extended Grafana integration | - -## Read-Only Mode - -kagent-tools supports a read-only mode for safer operation: - -```yaml -# In Helm values -kagentTools: - readOnly: true # Disables all write/mutating operations -``` - -## Observability - -kagent-tools exposes Prometheus metrics for monitoring: -- Tool invocation counts -- Tool execution duration -- Error rates by tool +| **GitHub MCP Server** | GitHub Copilot MCP server with tools for issues, PRs, repos, actions, and more. | +| **k8sgpt MCP Server** | K8sGPT integration for AI-powered Kubernetes diagnostics. | diff --git a/src/app/docs/kagent/resources/release-notes/page.mdx b/src/app/docs/kagent/resources/release-notes/page.mdx index 85a70868..2171620a 100644 --- a/src/app/docs/kagent/resources/release-notes/page.mdx +++ b/src/app/docs/kagent/resources/release-notes/page.mdx @@ -18,6 +18,109 @@ The kagent documentation shows information only for the latest release. If you r For more details on the changes between versions, review the [kagent GitHub releases](https://github.com/kagent-dev/kagent/releases). +# v0.8 + +Review the main changes from kagent version 0.7 to v0.8, then continue reading for more detailed information. + +* Human-in-the-Loop (HITL) — tool approval gates and interactive `ask_user` tool. +* Agent Memory — vector-backed long-term memory for agents. +* Go ADK runtime — new Go-based agent runtime for faster startup and lower resource usage. +* Agents as MCP servers — expose A2A agents via MCP for cross-tool interoperability. +* Skills — markdown knowledge documents loaded from OCI images or Git repositories. +* Go workspace restructure — the Go codebase is split into `api`, `core`, and `adk` modules for composability. +* Prompt templates — reusable prompt fragments from ConfigMaps using Go template syntax. +* Context management — automatic event compaction for long conversations. +* AWS Bedrock support — new model provider for AWS Bedrock. + +## Human-in-the-Loop (HITL) + +You can now use two Human-in-the-Loop mechanisms that pause agent execution and wait for user input. + +**Tool Approval** — You can mark specific tools as requiring user confirmation before execution by using the `requireApproval` field in the Agent CR. When the agent tries to call an approval-required tool, the UI presents Approve/Reject buttons. Rejected tool calls include the rejection reason as context for the LLM. + +**Ask User** — A built-in `ask_user` tool is automatically added to every agent. Agents can pose questions to users with predefined choices (single-select, multi-select) or free-text input during execution. + +For more information, see the [Human-in-the-Loop](/docs/kagent/concepts/human-in-the-loop) concept guide. + +## Agent Memory + +Your agents can now automatically save and retrieve relevant context across conversations using vector similarity search. Memory is built on the Google ADK memory implementation and uses the same kagent database (PostgreSQL or SQLite/Turso). + +When you enable memory on an agent, it receives three additional tools: `save_memory`, `load_memory`, and `prefetch_memory`. The agent automatically extracts key information (user intent, key learnings, preferences) every 5th user message. + +You can configure memory in the Agent CR or through the UI when you create or edit an agent by selecting an embedding model and TTL. + +For more information, see the [Agent Memory](/docs/kagent/concepts/agent-memory) concept guide. + +## Go ADK Runtime + +You can now choose between two Agent Development Kit runtimes: **Python** (default) and **Go**. The Go ADK provides significantly faster startup (~2 seconds vs ~15 seconds for Python) and lower resource consumption. + +Select the runtime via the `runtime` field in the declarative agent spec. + +```yaml +spec: + type: Declarative + declarative: + runtime: go +``` + +The Go ADK includes built-in tools: `SkillsTool`, `BashTool`, `ReadFile`, `WriteFile`, and `EditFile`. + +For more information, see the [Multi-Runtime Support](/docs/kagent/concepts/multi-runtime) concept guide. + +## Agents as MCP Servers + +A2A agents are now exposed as MCP servers via the kagent controller HTTP server. This enables cross-tool interoperability — any MCP-compatible client can consume agents, not just the A2A protocol. + +## Skills + +Your agents can now load markdown-based knowledge documents (skills) that provide domain-specific instructions, best practices, and procedures. Skills load at agent startup and are discoverable through the built-in `SkillsTool`. + +You can load skills from two sources. + +- **OCI images.** Container images containing skill files. +- **Git repositories.** Clone skills directly from Git repos, with support for private repos via HTTPS token or SSH key authentication. + +For more information, see the [Git-Based Skills](/docs/kagent/concepts/git-based-skills) concept guide. + +## Go Workspace Restructure + +The Go code now uses a Go workspace with three modules: `api`, `core`, and `adk`. This makes the codebase more composable for you if you want to pull in parts of kagent (such as the API types or ADK) without importing all dependencies. + +| Module | Purpose | +|--------|---------| +| `go/api` | Shared types: CRDs, ADK config types, database models, HTTP client. | +| `go/core` | Infrastructure: controllers, HTTP server, CLI. | +| `go/adk` | Go Agent Development Kit runtime. | + +## Prompt Templates + +Agent system messages now support Go `text/template` syntax. You can store common prompt fragments (safety guardrails, tool usage best practices) in ConfigMaps and reference them with `{{include "alias/key"}}` syntax. + +The `kagent-builtin-prompts` ConfigMap ships with five reusable templates: `skills-usage`, `tool-usage-best-practices`, `safety-guardrails`, `kubernetes-context`, and `a2a-communication`. + +For more information, see the [Prompt Templates](/docs/kagent/concepts/prompt-templates) concept guide. + +## Context Management + +Long conversations can now be automatically compacted to stay within LLM context windows. You can configure the `context.compaction` field to enable periodic summarization of older events while preserving key information. + +For more information, see the [Context Management](/docs/kagent/concepts/context-management) concept guide. + +## AWS Bedrock Support + +You can now use AWS Bedrock as a model provider, allowing your agents to use Bedrock-hosted models. + +## Additional Changes + +- **API key passthrough** for ModelConfig. +- **Custom service account** override in agent CRDs. +- **Voice support** for agents. +- **UI dynamic provider model discovery** for easier model configuration. +- **CLI `--token` flag** for `kagent invoke` API key passthrough. +- **CVE fixes** across Go, Python, and container images. + # v0.7 Review the main changes from kagent version 0.6 to v0.7, then continue reading for more detailed information. @@ -84,7 +187,7 @@ Review the main changes from kagent version 0.5 to v0.6, then continue reading f * API string references to resources in other namespaces in the format `namespace/name` now fail. Instead, the APIs have a separate field for you to specify the namespace of the resource. * The Tools API moves or eliminates some APIs entirely in favor of new kmcp APIs. * The Agents APIs now require a top-level `type` field to support the new BYO agent functionality. -* The ModelConfig APIs rename the secret name field from `apiKeySecret` to `apiKeySecret`. +* The ModelConfig APIs rename the secret name field from `apiKeySecretRef` to `apiKeySecret`. * Memory APIs are not supported in ADK. ## Upgraded API version @@ -400,7 +503,7 @@ This change supports the new type for BYO agents.
-[v1alpha2 Example](https://github.com/kagent-dev/kagent/blob/eitanya/byo/helm/agents/k8s/templates/agent.yaml): Note that the entire agent configuration is now nested under the `inline` setting. +[v1alpha2 Example](https://github.com/kagent-dev/kagent/blob/eitanya/byo/helm/agents/k8s/templates/agent.yaml): Note that the entire agent configuration is now nested under the `declarative` setting. ```yaml apiVersion: kagent.dev/v1alpha2 @@ -421,7 +524,7 @@ This change supports the new type for BYO agents. **Key Changes:** * Added `type: Declarative` field to specify agent type - * Agent configuration now under `inline` section + * Agent configuration now under `declarative` section * Supports new BYO deployment model
@@ -453,7 +556,7 @@ spec: ## ModelConfig API -The secret name field is renamed from `apiKeySecret` to `apiKeySecret`. +The secret name field is renamed from `apiKeySecretRef` to `apiKeySecret`. ### ModelInfo removed diff --git a/src/config/navigation.json b/src/config/navigation.json index b72a0ebe..4cb9da58 100644 --- a/src/config/navigation.json +++ b/src/config/navigation.json @@ -87,22 +87,22 @@ { "title": "Tools Ecosystem", "href": "/docs/kagent/concepts/tools-ecosystem", - "description": "Comprehensive catalog of built-in tools for Kubernetes, Helm, Istio, Prometheus, Grafana, Cilium, and Argo Rollouts." + "description": "Explore the built-in MCP tools for Kubernetes, Helm, Istio, Prometheus, Grafana, Cilium, and Argo Rollouts." }, { "title": "Human-in-the-Loop", "href": "/docs/kagent/concepts/human-in-the-loop", - "description": "Configure tool approval gates and interactive user prompts for agent oversight." + "description": "Configure tool approval workflows and the Ask User interactive tool for human oversight of agent actions." }, { "title": "Agent Memory", "href": "/docs/kagent/concepts/agent-memory", - "description": "Enable vector-backed long-term memory for agents using pgvector or Turso." + "description": "Enable vector-backed long-term memory for agents to learn from past interactions." }, { "title": "Prompt Templates", "href": "/docs/kagent/concepts/prompt-templates", - "description": "Compose reusable prompt fragments from ConfigMaps using Go template syntax." + "description": "Use Go template syntax to compose reusable prompt fragments from ConfigMaps." }, { "title": "Multi-Runtime Support", @@ -117,7 +117,7 @@ { "title": "Context Management", "href": "/docs/kagent/concepts/context-management", - "description": "Automatically summarize older messages to stay within LLM context windows." + "description": "Automatically summarize older messages to stay within LLM context windows during long conversations." } ] }, @@ -289,7 +289,7 @@ "href": "/docs/kagent/resources/helm", "description": "kagent Helm chart configuration reference" }, -{ + { "title": "FAQs", "href": "/docs/kagent/resources/faq", "description": "Find answers to frequently asked questions about kagent."