Skip to content

Commit 5f9a6cf

Browse files
Merge pull request #422 from kagent-dev/v0.10.0-docs
[DNM] v0.10.0 docs
2 parents 1bc6cb3 + 6b861d0 commit 5f9a6cf

11 files changed

Lines changed: 1324 additions & 167 deletions

File tree

‎docs-site/content/kagent/concepts/agent-substrate.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 5
55
author: kagent.dev
66
---
77

8-
Agent Substrate is a Kubernetes-native runtime for running AI agents and other stateful workloads efficiently. Instead of dedicating one pod per agent — which wastes capacity while agents sit idle — Substrate decouples an agent's lifecycle from pod infrastructure. Idle agents are snapshotted to object storage and rehydrated on demand, so a small pool of pre-warmed workers can host far more agents than there are pods.
8+
Agent Substrate is a Kubernetes-native runtime for running AI agents and other stateful workloads efficiently. Instead of dedicating one pod per agent, which wastes capacity while agents sit idle, Substrate decouples an agent's lifecycle from pod infrastructure. Idle agents are snapshotted to object storage and rehydrated on demand, so a small pool of pre-warmed workers can host far more agents than there are pods.
99

1010
kagent can run workloads on Agent Substrate in two ways:
1111

@@ -14,10 +14,10 @@ kagent can run workloads on Agent Substrate in two ways:
1414

1515
## Why Agent Substrate
1616

17-
- **Fast startup** — Agents cold-start by restoring a compressed snapshot rather than booting a fresh pod, so they resume in a fraction of the time.
18-
- **Efficient resource usage** — A pool of pre-warmed workers multiplexes many actors across far fewer pods, persisting idle actors to object storage instead of holding a pod each.
19-
- **Secure execution** — Each workload runs inside a gVisor sandbox, isolating untrusted agent code from the host and from other actors.
20-
- **Declarative management** — WorkerPools and ActorTemplates are Kubernetes CRDs, so the runtime is configured and versioned with the same GitOps workflow as the rest of your platform.
17+
- **Fast startup**: Agents cold-start by restoring a compressed snapshot rather than booting a fresh pod, so they resume in a fraction of the time.
18+
- **Efficient resource usage**: A pool of pre-warmed workers multiplexes many actors across far fewer pods, persisting idle actors to object storage instead of holding a pod each.
19+
- **Secure execution**: Each workload runs inside a gVisor sandbox, isolating untrusted agent code from the host and from other actors.
20+
- **Declarative management**: WorkerPools and ActorTemplates are Kubernetes CRDs, so the runtime is configured and versioned with the same GitOps workflow as the rest of your platform.
2121

2222
## Core concepts
2323

@@ -31,7 +31,7 @@ kagent can run workloads on Agent Substrate in two ways:
3131

3232
## How it works
3333

34-
When an agent is invoked, Substrate restores its actor onto an available worker from the WorkerPool — rehydrating from a snapshot if the actor was idle. The agent runs inside a gVisor sandbox for the duration of the session. When the actor goes idle, its state is checkpointed back to object storage and the worker is freed to host another actor. This snapshot-and-restore cycle is what lets a single worker pool serve many more agents than a pod-per-agent model.
34+
When an agent is invoked, Substrate restores its actor onto an available worker from the WorkerPool, rehydrating from a snapshot if the actor was idle. The agent runs inside a gVisor sandbox for the duration of the session. When the actor goes idle, its state is checkpointed back to object storage and the worker is freed to host another actor. This snapshot-and-restore cycle is what lets a single worker pool serve many more agents than a pod-per-agent model.
3535

3636
## Architecture
3737

@@ -56,7 +56,9 @@ Agent Substrate is composed of a control plane, a data plane, and snapshot stora
5656

5757
### Declarative agents
5858

59-
Run a (Go) declarative agent on Agent Substrate by creating a `SandboxAgent` resource. It carries the same spec as a regular `Agent`, but the kagent controller runs it as a sandboxed workload on the runtime instead of a plain Deployment.
59+
Run a declarative agent on Agent Substrate by creating a `SandboxAgent` resource. It carries the same spec as a regular `Agent`, but the kagent controller runs it as a sandboxed workload on the runtime instead of a plain Deployment. All three declarative runtimes are supported: **Go** (default), **Python**, and **BYO**.
60+
61+
Session history for Go and Python declarative sandbox agents is persisted to a local SQLite database backed by the agent's `durableDir` volume, so conversation state survives pod restarts and Deployment rollouts. Session metadata is mirrored to PostgreSQL to support session-listing APIs. BYO agents do not get local session storage automatically; set the `kagent.dev/local-session-storage` annotation on the `SandboxAgent` if your BYO agent implements its own local store.
6062

6163
### AgentHarness
6264

‎docs-site/content/kagent/concepts/agents.md‎

Lines changed: 124 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Each agent consists of the following components:
1515

1616
## Agent Instructions
1717

18-
Agent instructions tell the agent what its role is, how to interact with the user, what actions it can take, how to behave and respond to user queries, and how to interact with other agents. Here's an example of simple agent instructions:
18+
Agent instructions tell the agent what its role is, how to interact with the user, what actions it can take, how to behave and respond to user queries, and how to interact with other agents. The following example shows simple agent instructions:
1919

2020
```yaml
2121
You're a Kubernetes agent that can help users manage their Kubernetes resources.
@@ -24,7 +24,7 @@ Your responses should be clear and concise; you should provide helpful informati
2424

2525
Instructions are an important part of the agent's behavior. They define the agent's role and capabilities and help the agent understand its environment and the tasks it can perform.
2626

27-
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.
27+
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. To help you write good instructions, see the [system prompt tutorial](/docs/kagent/getting-started/system-prompts).
2828

2929
### Prompt templates
3030

@@ -86,13 +86,13 @@ Tools are functions that the agent can use to interact with its environment. For
8686

8787
Tools definitions and their descriptions are made available to the agent and are sent to the LLMs together with the instructions. Based on the user query, the agent can use the tools to interact with the environment and generate responses.
8888

89-
For example, we could add the **list_resources** tool to agent that would allow it to list resources in the Kubernetes cluster. The agent will determine based on the user input if it makes sense to invoke any of the available tools.
89+
For example, add the **list_resources** tool to your agent to allow it to list resources in the Kubernetes cluster. The agent determines, based on user input, whether to invoke any available tools.
9090

91-
If the user asks "List all pods in the cluster", the agent can use the **list_resources** tool to list all pods in the cluster. Note that depending on how the instructions/tools are written and configure, the agent might list all the namespaces first then list all the pods in each namespace. Alternatively, if the **list_resources** tool allows listing resources across namespaces, the agent will pick that option.
91+
If the user asks "List all pods in the cluster", the agent can use the **list_resources** tool to list all pods in the cluster. Depending on how the instructions and tools are configured, the agent might list all namespaces first, then list all pods in each namespace. Alternatively, if the **list_resources** tool allows listing resources across namespaces, the agent picks that option.
9292

93-
Some tools support additional configuration that can be set in when adding the tool to the agent. For example, any Grafana or Prometheus tools will require an API endpoint URL to be set.
93+
Some tools support additional configuration that you set when adding the tool to the agent. For example, any Grafana or Prometheus tools will require an API endpoint URL to be set.
9494

95-
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.
95+
kagent comes with a set of built-in tools that you can use to interact with your environment. kagent also supports [MCP (Model Context 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.
9696

9797
## Human-in-the-Loop
9898

@@ -149,7 +149,7 @@ Skills can refer to two broad types:
149149

150150
### A2A skills metadata
151151

152-
Actions-to-actions (A2A) skills are metadata—structured descriptions of capabilities, not executable code. Think of A2A skills as a machine-readable catalog entry about what a tool can do.
152+
Actions-to-actions (A2A) skills are metadata: structured descriptions of capabilities, not executable code. Think of A2A skills as a machine-readable catalog entry about what a tool can do.
153153

154154
A2A skills metadata describes:
155155

@@ -214,6 +214,35 @@ skills:
214214
215215
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`.
216216

217+
### S3-based skills
218+
219+
You can load skills directly from S3 — either a folder prefix (a path ending with `/` that contains a `SKILL.md` and sibling files) or a single `.zip` archive. Credentials use the AWS SDK default credential chain, which you supply as environment variables on the skills init container.
220+
221+
```yaml
222+
skills:
223+
s3Refs:
224+
- uri: s3://kagent-skills-bucket/team-a/kebab-maker # folder prefix
225+
name: kebab-maker
226+
- uri: s3://kagent-skills-bucket/bundles/ops.zip # zip archive
227+
region: us-east-1
228+
initContainer:
229+
env:
230+
- name: AWS_ACCESS_KEY_ID
231+
valueFrom:
232+
secretKeyRef:
233+
name: aws-creds
234+
key: AWS_ACCESS_KEY_ID
235+
- name: AWS_SECRET_ACCESS_KEY
236+
valueFrom:
237+
secretKeyRef:
238+
name: aws-creds
239+
key: AWS_SECRET_ACCESS_KEY
240+
- name: AWS_REGION
241+
value: us-west-2
242+
```
243+
244+
You can combine S3 skills with OCI and Git skills in the same agent by specifying `refs`, `gitRefs`, and `s3Refs` together. For the full field reference, see [S3SkillRef](/docs/kagent/resources/api-ref/#s3skillref).
245+
217246
### Best practices for skills
218247

219248
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.
@@ -230,35 +259,75 @@ To learn more about using skills in your agents, see the [Skills example guide](
230259

231260
## Runtime
232261

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

235-
| Feature | Python ADK | Go ADK |
236-
|---------|-----------|--------|
237-
| Startup time | ~15 seconds | ~2 seconds |
238-
| Ecosystem | Google ADK, LangGraph, CrewAI integrations | Native Go implementation |
239-
| Resource usage | Higher (Python runtime) | Lower (compiled binary) |
264+
| Feature | Go ADK | Python ADK |
265+
|---------|--------|-----------|
266+
| Startup time | ~2 seconds | ~15 seconds |
267+
| Ecosystem | Native Go implementation | Google ADK, LangGraph, CrewAI integrations |
268+
| Resource usage | Lower (compiled binary) | Higher (Python runtime) |
240269
| Default | Yes | No |
241270
| Memory support | Yes | Yes |
242271
| MCP support | Yes | Yes |
243272
| HITL support | Yes | Yes |
273+
| File upload in chat | Yes | No |
244274

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

247277
```yaml
248278
spec:
249279
type: Declarative
250280
declarative:
251-
runtime: go # or "python" (default)
281+
runtime: go # or "python"
252282
modelConfig: default-model-config
253283
systemMessage: "You are a helpful agent."
254284
```
255285

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

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

260290
For more benchmarks and details, see the [Go vs Python runtime blog post](https://kagent.dev/blog/go-vs-python-runtime).
261291

292+
## Deployment configuration
293+
294+
Control how the agent's Kubernetes Deployment is configured in the `spec.declarative.deployment` stanza.
295+
296+
### Environment variables
297+
298+
Use `env` to set individual environment variables, or `envFrom` to bulk-inject all keys from a ConfigMap or Secret.
299+
300+
```yaml
301+
spec:
302+
declarative:
303+
deployment:
304+
env:
305+
- name: LOG_LEVEL
306+
value: debug
307+
envFrom:
308+
- configMapRef:
309+
name: my-agent-config
310+
- secretRef:
311+
name: my-agent-secrets
312+
```
313+
314+
### Deployment annotations
315+
316+
Use `deploymentAnnotations` to add annotations to the Deployment object itself. This field is distinct from the `annotations` field, which targets pod template metadata only.
317+
318+
```yaml
319+
spec:
320+
declarative:
321+
deployment:
322+
deploymentAnnotations:
323+
argocd.argoproj.io/sync-wave: "5"
324+
notifications.argoproj.io/subscribe.on-degraded.slack: my-channel
325+
annotations:
326+
prometheus.io/scrape: "true" # pod template only
327+
```
328+
329+
`deploymentAnnotations` is useful for GitOps tooling such as Argo CD sync waves and Flux annotations, which key off Deployment-level metadata rather than pod metadata.
330+
262331
## Memory
263332

264333
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.
@@ -292,15 +361,37 @@ Compaction removes older conversation events to free up space in the context win
292361

293362
## Sandboxed Agents
294363

295-
You can run a declarative agent in an isolated sandbox by creating a `SandboxAgent` resource instead of a regular `Agent`. A `SandboxAgent` runs on [Agent Substrate](/docs/kagent/concepts/agent-substrate): the kagent controller runs it as a gVisor-sandboxed actor instead of a Deployment, snapshotting it to object storage when idle and rehydrating it on demand. The spec mirrors the `Agent` spec, with a few constraints: sandboxed agents always use the Go ADK runtime, and `spec.skills` and `BYO` agents are not supported. Configure substrate placement with the optional `spec.substrate` field (for example, `workerPoolRef`).
364+
You can run a declarative agent in an isolated sandbox by creating a `SandboxAgent` resource instead of a regular `Agent`. A `SandboxAgent` runs on [Agent Substrate](/docs/kagent/concepts/agent-substrate): the kagent controller runs it as a gVisor-sandboxed actor instead of a Deployment, snapshotting it to object storage when idle and rehydrating it on demand. The spec mirrors the `Agent` spec. All three runtimes are supported: **Go** (default), **Python**, and **BYO**. For Go and Python agents, session history is persisted to a local SQLite database in the agent's `durableDir` volume, so conversation state survives pod restarts and Deployment rollouts. BYO agents do not get local session storage automatically. Configure substrate placement with the optional `spec.substrate` field (for example, `workerPoolRef`).
296365

297366
For setup steps, see the [Agent Substrate example](/docs/kagent/examples/agent-substrate).
298367

368+
## A2A AgentCard metadata
369+
370+
When another agent or client discovers your agent over the [A2A protocol](https://google.github.io/A2A/specification/#5-agent-discovery-using-an-agent-card), it reads a machine-readable AgentCard from your agent's `/.well-known/agent.json` endpoint. You can enrich that card with optional metadata fields on the `Agent` spec.
371+
372+
```yaml
373+
spec:
374+
iconUrl: https://example.com/icons/my-agent.png
375+
documentationUrl: https://docs.example.com/my-agent/
376+
version: "1.0.0"
377+
provider:
378+
organization: My Organization
379+
url: https://example.com
380+
```
381+
382+
| Field | Description |
383+
|-------|-------------|
384+
| `iconUrl` | URL to an icon image representing the agent. Must be a valid URI. |
385+
| `documentationUrl` | URL to human-readable documentation for the agent. Must be a valid URI. |
386+
| `version` | Version string for the agent, such as `"1.0.0"`. |
387+
| `provider.organization` | Name of the organization responsible for the agent. |
388+
| `provider.url` | URL to the agent provider's website or documentation. Must be a valid URI. |
389+
299390
## Agents as Tools
300391

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

303-
Here's how you could reference an existing agent (`promql-agent`) as a tool:
394+
The following example shows how to reference an existing agent (`promql-agent`) as a tool:
304395

305396
```yaml
306397
...
@@ -326,6 +417,22 @@ Here's how you could reference an existing agent (`promql-agent`) as a tool:
326417
namespace: other-namespace
327418
```
328419

420+
### Per-call session isolation
421+
422+
By default, all calls to the same sub-agent share a single session, which preserves stateful continuity across calls. When a coordinator agent calls the same sub-agent in parallel, shared sessions can cause calls to interfere with each other.
423+
424+
Set `isolateSessions: true` on the Agent-type tool to give each call its own fresh session, enabling safe parallel fan-out.
425+
426+
```yaml
427+
spec:
428+
declarative:
429+
tools:
430+
- type: Agent
431+
agent:
432+
name: worker-agent
433+
isolateSessions: true
434+
```
435+
329436
### MCP server endpoint
330437

331438
A2A-enabled agents are automatically exposed as an MCP server on the kagent controller. The MCP endpoint is available at `/mcp` on the same port as the A2A endpoint (default 8083).

0 commit comments

Comments
 (0)