Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a90b4d3
docs: add comprehensive concept, CRD reference, and enterprise docume…
ProfessorSeb Mar 9, 2026
12a2e87
docs: remove CRD reference and enterprise pages, keep only core concepts
ProfessorSeb Mar 9, 2026
db22725
first pass at updating blocking issues as follows: Blocking issues (9):
artberger Mar 11, 2026
0a1b595
memory topic updates based on demo
artberger Mar 11, 2026
3b2afc6
HITL topic updates based on demo
artberger Mar 11, 2026
09988ef
add v0.8 release notes
artberger Mar 11, 2026
c5108e8
apply style guide: second-person voice, active voice, periods on list…
artberger Mar 11, 2026
1221627
replace ASCII art diagram with structured prose in HITL architecture …
artberger Mar 11, 2026
7c26eb8
add diagram for hitl
artberger Mar 11, 2026
9862ae4
navigation
artberger Mar 11, 2026
0a650f0
revise based on testing
artberger Mar 11, 2026
407b67a
Merge pull request #324 from kagent-dev/adb-review
EItanya Mar 12, 2026
ee962bb
Merge branch 'main' into add-comprehensive-docs
artberger Mar 12, 2026
5ffa2ff
de-dupe
artberger Mar 12, 2026
afe25ba
Merge branch 'main' into add-comprehensive-docs
artberger Mar 12, 2026
145b852
add links to blogs
artberger Mar 12, 2026
4adcb23
doc updates
artberger Mar 12, 2026
65fd69e
docs: add missing subpage cards to all section landing pages
artberger Mar 12, 2026
2ee3e13
local preview
artberger Mar 12, 2026
8879c65
fix some cards
artberger Mar 12, 2026
05a89d7
rm unused images
artberger Mar 12, 2026
d9176b7
Remove SQLite
artberger Mar 13, 2026
265c6bc
more details on bundled Postgres
artberger Mar 13, 2026
3e9cd97
link
artberger Mar 13, 2026
6c4bceb
emphasize external postgres for prod
artberger Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 129 additions & 108 deletions public/sitemap.xml

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions src/app/docs/kagent/concepts/agent-memory/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: "Agent Memory"
pageOrder: 5
description: "Enable vector-backed long-term memory for agents to learn from past interactions."
---

export const metadata = {
title: "Agent Memory",
description: "Enable vector-backed long-term memory for agents to learn from past interactions.",
author: "kagent.dev"
};

# Agent Memory

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

Agent memory provides the following capabilities.

- **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), 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:
modelConfig: default-model-config # References the embedding provider
```

### Custom TTL

To change the default memory retention period, set the `ttlDays` field.

```yaml
memory:
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 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 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 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. |

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.

```
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).
- Memories include timestamps and source session references.
176 changes: 176 additions & 0 deletions src/app/docs/kagent/concepts/agents/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,60 @@ Instructions are an important part of the agent's behavior. They define the agen

Writing good instructions is an art and a science. It requires a good understanding of the task at hand, the tools available, and the user's needs. In order to make it easier to write good instructions, we've created a [system prompt tutorial](/docs/kagent/getting-started/system-prompts) that can help you get started.

### Prompt templates

You can use Go `text/template` syntax in system messages to compose reusable fragments stored in ConfigMaps. Instead of duplicating safety guidelines and tool usage instructions across every agent, store them once and reference them with `{{include "alias/key"}}` syntax. The controller resolves templates during reconciliation, so the final system message is fully expanded before reaching the agent runtime.

```yaml
apiVersion: kagent.dev/v1alpha2
kind: Agent
metadata:
name: k8s-agent
namespace: kagent
spec:
type: Declarative
declarative:
modelConfig: default-model-config
promptTemplate:
dataSources:
- kind: ConfigMap
name: kagent-builtin-prompts
alias: builtin
- kind: ConfigMap
name: my-custom-prompts
systemMessage: |
You are a Kubernetes management agent named {{.AgentName}}.

{{include "builtin/safety-guardrails"}}
{{include "builtin/tool-usage-best-practices"}}
{{include "my-custom-prompts/k8s-specific-rules"}}

Your tools: {{.ToolNames}}
Your skills: {{.SkillNames}}
```

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. |

The following template variables are available in system messages.

| 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. |

> **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.

## Tools

Tools are functions that the agent can use to interact with its environment. For example, a Kubernetes agent might have tools to list pods, get pod logs, and describe services.
Expand All @@ -48,6 +102,39 @@ Some tools support additional configuration that can be set in when adding the t

Kagent comes with a set of built-in tools that you can use to interact with your environment. Kagent also supports the [MCP (Model Configuration Protocol)](https://modelcontextprotocol.io/introduction) tools. Using MCP, you can bring any external tool into kagent and make it available for your agents to run.

## Human-in-the-Loop

Kagent supports Human-in-the-Loop (HITL) to keep humans in control of agent actions. You can require user approval before an agent executes sensitive tools, and agents can ask users questions when they need clarification.

For a hands-on tutorial that walks through setting up HITL with tool approval and the `ask_user` tool, see the [Human-in-the-Loop example](/docs/kagent/examples/human-in-the-loop).

### Tool approval

Add `requireApproval` to your agent's tool specification to gate destructive operations. Tools listed in `requireApproval` pause execution and present Approve/Reject buttons in the UI. Tools not listed run immediately.

```yaml
tools:
- type: McpServer
mcpServer:
name: kagent-tool-server
kind: RemoteMCPServer
apiGroup: kagent.dev
toolNames:
- k8s_get_resources # runs immediately
- k8s_describe_resource # runs immediately
- k8s_delete_resource # pauses for approval
- k8s_apply_manifest # pauses for approval
requireApproval:
- k8s_delete_resource
- k8s_apply_manifest
```

When you reject a tool call, you can provide a reason. This reason is passed back to the LLM as context, so the agent can adjust its approach.

### Ask User

Every agent automatically has the built-in `ask_user` tool. It allows agents to pause and ask users questions with optional predefined choices — useful for clarifying ambiguous requests or collecting configuration preferences. No configuration is required.

## Skills

Skills are descriptions or even executable implementations of the capabilities that an agent has to act more autonomously. They make the LLM's responses more than just reactions to prompts by orienting them toward goals.
Expand Down Expand Up @@ -108,6 +195,33 @@ Container-based skills are actual, callable capabilities—not just descriptions

Kagent's skills are similar to [Claude's Agent Skills](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview), but with a key advantage: any agent can use skills, regardless of the LLM provider. You're not limited to Anthropic Claude. You can use skills with OpenAI, Google Vertex AI, Azure OpenAI, Ollama, and any other LLM provider that kagent supports.

### Git-based skills

You can also load skills directly from Git repositories, as an alternative to OCI images.

```yaml
skills:
gitRefs:
- url: https://github.com/myorg/agent-skills.git
ref: main
- url: https://github.com/myorg/monorepo.git
ref: main
path: skills/kubernetes # Use a subdirectory
```

For private repositories, configure authentication via HTTPS token or SSH key.

```yaml
skills:
gitAuthSecretRef:
name: git-credentials # Secret containing a `token` key
gitRefs:
- url: https://github.com/myorg/private-skills.git
ref: main
```

A single `gitAuthSecretRef` applies to all Git repositories in the agent. You can combine Git and OCI skills in the same agent by specifying both `refs` and `gitRefs`.

### Best practices for skills

Containerize and store your skills in a specialized registry so that you can reuse them across agents. You can use the [agentregistry project](https://github.com/agentregistry-dev/agentregistry) to build and push skills to a registry.
Expand All @@ -122,6 +236,68 @@ When creating skills for your agents, consider the following best practices. Age

To learn more about using skills in your agents, see the [Skills example guide](/docs/kagent/examples/skills).

## Runtime

You can choose between two Agent Development Kit (ADK) runtimes for declarative agents: **Python** (default) and **Go**.

| Feature | Python ADK | Go ADK |
|---------|-----------|--------|
| Startup time | ~15 seconds | ~2 seconds |
| Ecosystem | Google ADK, LangGraph, CrewAI integrations | Native Go implementation |
| Resource usage | Higher (Python runtime) | Lower (compiled binary) |
| Default | Yes | No |
| Memory support | Yes | Yes |
| MCP support | Yes | Yes |
| HITL support | Yes | Yes |

Select the runtime via the `runtime` field in the declarative agent spec.

```yaml
spec:
type: Declarative
declarative:
runtime: go # or "python" (default)
modelConfig: default-model-config
systemMessage: "You are a helpful agent."
```

**Choose Go when** fast startup matters (autoscaling, cold starts), lower resource consumption is important, or you don't need Python-specific framework integrations.

**Choose Python when** you need Google ADK-native features, CrewAI/LangGraph/OpenAI framework integrations, or Python-based custom tools.

For more benchmarks and details, see the [Go vs Python runtime blog post](/blog/go-vs-python-runtime).

## Memory

Your agents can save and retrieve relevant context across conversations using vector similarity search. When you enable memory on an agent, it receives three additional tools (`save_memory`, `load_memory`, `prefetch_memory`) and automatically extracts key information every 5th user message.

For configuration details, supported storage backends, API endpoints, and limitations, see the [Agent Memory](/docs/kagent/concepts/agent-memory) concept guide.

## Context Management

Long conversations can exceed LLM context windows. You can enable **event compaction** to automatically summarize older messages while preserving key information.

```yaml
spec:
type: Declarative
declarative:
modelConfig: default-model-config
systemMessage: "You are a helpful agent for extended sessions."
context:
compaction:
compactionInterval: 5 # Compact every 5 user invocations
```

| 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 that triggers compaction. |
| `summarizer` | — | Optional LLM-based summarizer configuration. |

By default, compacted events are dropped. To preserve a summary, configure the `summarizer` field with a `modelConfig` reference. Enable compaction for agents that handle long-running conversations, call many tools with large outputs, or need to support extended interactions.

## Agents as Tools

Kagent also supports using agents as tools. Any agent you create can be referenced and used by other agents you have. An example use case would be to have a PromQL agent that knows how to create PromQL queries from natural language. Then you'd create a second agent that would use the PromQL agent whenever it needs to create a PromQL query.
Expand Down
9 changes: 6 additions & 3 deletions src/app/docs/kagent/concepts/architecture/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ In the future, we envision more features for the controller, such as:

## App/Engine

The kagent engine is the core component of kagent. It is a Python application that is responsible for running the agent's conversation loop. It is built on top of the [ADK](https://google.github.io/adk-docs/) framework.
The kagent engine is the core component of kagent. It runs the agent's conversation loop and supports two runtimes:

The ADK team did a wonderful job of creating a flexible, powerful, and most importantly extensible framework for building AI agents. We take full advantage of this by using the framework by adding our own `Agents`, and `Tools`.
- **Python ADK** (default) — Built on top of the [Google ADK](https://google.github.io/adk-docs/) framework. Supports Google ADK-native features and integrations with CrewAI, LangGraph, and OpenAI frameworks.
- **Go ADK** — A native Go implementation that provides faster startup (~2 seconds vs ~15 seconds) and lower resource consumption. Select it by setting `runtime: go` in the agent spec.

Please see the following links for more information on the ADK framework:
Both runtimes support MCP tools, HITL, and agent memory. For more details, see the [Agents](/docs/kagent/concepts/agents#runtime) concept guide.

For more information on the Google ADK framework:

- [Agents](https://google.github.io/adk-docs/agents/)
- [Tools](https://google.github.io/adk-docs/tools/)
Expand Down
7 changes: 7 additions & 0 deletions src/app/docs/kagent/concepts/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@ import QuickLink from '@/components/quick-link';
<QuickLink title="Architecture" description="Learn about the architecture of kagent." href="/docs/kagent/concepts/architecture" />
<QuickLink title="Agents" description="Learn about AI agents." href="/docs/kagent/concepts/agents" />
<QuickLink title="Tools" description="Learn about tools and MCP." href="/docs/kagent/concepts/tools" />
<QuickLink title="Tools Ecosystem" description="Comprehensive catalog of built-in tools for Kubernetes, Helm, Istio, Prometheus, Grafana, Cilium, and Argo Rollouts." href="/docs/kagent/resources/tools-ecosystem" />
<QuickLink title="Human-in-the-Loop" description="Configure tool approval gates and interactive user prompts for agent oversight." href="/docs/kagent/concepts/human-in-the-loop" />
<QuickLink title="Agent Memory" description="Enable vector-backed long-term memory for agents using pgvector or Turso." href="/docs/kagent/concepts/agent-memory" />
<QuickLink title="Prompt Templates" description="Compose reusable prompt fragments from ConfigMaps using Go template syntax." href="/docs/kagent/concepts/prompt-templates" />
<QuickLink title="Multi-Runtime Support" description="Choose between Go and Python ADK runtimes for your agents." href="/docs/kagent/concepts/multi-runtime" />
<QuickLink title="Git-Based Skills" description="Load markdown knowledge documents from Git repositories to guide agent behavior." href="/docs/kagent/concepts/git-based-skills" />
<QuickLink title="Context Management" description="Automatically manage conversation history to stay within LLM context windows." href="/docs/kagent/concepts/context-management" />
</div>
</div>
2 changes: 1 addition & 1 deletion src/app/docs/kagent/concepts/tools/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Kagent comes with a set of built-in tools that you can use to interact with your

## Built-in Tools

You can check out the full list of built-in tools [here](/tools).
You can check out the full list of built-in tools [here](/tools), or see the [Tools Ecosystem](/docs/kagent/resources/tools-ecosystem) reference for a detailed catalog of tools organized by MCP server.

The built-in tools are meant as a good starting point for any agents running in kubernetes, however we don't envision them covering all possible use-cases, so we support multiple tool extension points to allow you to bring in your own tools.

Expand Down
Loading