-
Notifications
You must be signed in to change notification settings - Fork 2
docs: port ClickHouse Agents docs from clickhouse-docs #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mintlify
wants to merge
1
commit into
main
Choose a base branch
from
mintlify/ea9e18cc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
products/cloud/features/ai-ml/agents/builder/code-interpreter.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| sidebarTitle: 'Code interpreter' | ||
| slug: /cloud/features/ai-ml/agents/builder/code-interpreter | ||
| title: 'Code interpreter' | ||
| description: 'Sandboxed code execution in ClickHouse Agents' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'code interpreter', 'sandbox', 'python'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
| import { Image } from "/snippets/components/Image.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| The code interpreter lets an agent execute code in a managed sandbox. Use it for computation, data transformation, format conversion, plotting, and anything else better done in code than in natural language. | ||
|
|
||
| ## Enable the code interpreter {#enable-it} | ||
|
|
||
| In the Agent Builder, enable **Run Code** in the **Capabilities** section, then save. The agent decides when to run code based on the user's request and the agent's instructions. | ||
|
|
||
| <Image img="/images/cloud/agent-builder/run-code/run-code.png" alt="Run Code section of the Capabilities panel with the Run Code checkbox enabled and an Upload to Code Environment button" size="sm"/> | ||
|
|
||
| ## Supported languages {#supported-languages} | ||
|
|
||
| The sandbox is a Unix environment with two general-purpose runtimes and a few shell utilities: | ||
|
|
||
| - **Python 3** - the default for data tasks. | ||
| - **Node.js (JavaScript)** - when an agent prefers JS for the job. | ||
| - **Bash** and **sh** - shell scripting for chaining commands and quick I/O. | ||
| - **AWK** and **sed** - line-oriented text processing. | ||
| - **bc** - arbitrary-precision math. | ||
|
|
||
| Agents reach for Python first for anything involving data parsing, transformation, or computation. | ||
|
|
||
| <Tip> | ||
| Reserve the shell tools for tasks that genuinely benefit from a one-liner. | ||
| </Tip> | ||
|
|
||
| ## Files {#files} | ||
|
|
||
| Users can upload files into a conversation; the code interpreter has access to them in the sandbox working directory. Code can also write output files (CSVs, plots, archives) which appear in the conversation as downloadable attachments. | ||
|
|
||
| ## Sandbox isolation {#sandbox-isolation} | ||
|
|
||
| Each execution runs in an ephemeral sandbox with no network access and no persistent storage. Sessions don't share state — variables and files from one run don't carry into the next unless the agent explicitly re-loads them. | ||
|
|
||
| Plan-specific resource limits (memory, files per run, monthly request quotas) apply. Errors and stderr are surfaced in the conversation alongside stdout. | ||
|
|
||
| ## When to use it {#when-to-use-it} | ||
|
|
||
| Reach for the code interpreter when the answer requires deterministic computation that a language model can't produce reliably by reasoning alone. | ||
| Typical cases include: | ||
|
|
||
| - Parsing a CSV or JSON file the user uploaded. | ||
| - Computing summary statistics or running a quick simulation. | ||
| - Converting between formats (Parquet, JSON, CSV). | ||
| - Generating a plot from query results. | ||
|
|
||
| <Tip> | ||
| Avoid it for tasks the model can already answer from context. | ||
| Code execution adds latency and consumes quota. | ||
| </Tip> |
34 changes: 34 additions & 0 deletions
34
products/cloud/features/ai-ml/agents/builder/image-generation.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| sidebarTitle: 'Image generation' | ||
| slug: /cloud/features/ai-ml/agents/builder/image-generation | ||
| title: 'Image generation' | ||
| description: 'Generate and edit images inside ClickHouse Agents' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'image generation', 'DALL-E', 'Flux', 'Stable Diffusion'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
| import { Image } from "/snippets/components/Image.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| Image generation lets an agent produce new images from a text prompt or edit images the user has uploaded. The agent picks between generation and editing based on what was asked and the available context. | ||
|
|
||
| ## Enable image generation {#enable-it} | ||
|
|
||
| Image generation is added through the **Add Tools** modal in the Agent Builder (not the Capabilities section). Click **Add Tools** at the bottom of the Agent Builder panel, then add one of the image-model tools — for example **OpenAI Image Tools**, **DALL-E-3**, or **Stable Diffusion**. The agent picks the appropriate one based on the request, or you can restrict it in instructions. | ||
|
|
||
| <Image img="/images/cloud/agent-builder/tools-modal.png" alt="Agent Tools modal showing image-model integrations including OpenAI Image Tools, DALL-E-3, and Stable Diffusion alongside other third-party tools" size="md"/> | ||
|
|
||
| ## Generation {#generation} | ||
|
|
||
| When the user asks for an image, the agent calls the generation tool with a prompt and returns the resulting image inline. The agent retains a reference to the image in its context so it can describe or reuse it within the same conversation. | ||
|
|
||
| ## Editing {#editing} | ||
|
|
||
| If the user uploads an image and asks for a modification — change a color, add an object, extend a composition — the agent invokes the editing variant of the tool. The output replaces the relevant region or extends the source as requested. | ||
|
|
||
| ## Notes {#notes} | ||
|
|
||
| - Generated images aren't fed into separate vision analysis automatically. If you need the agent to *interpret* an image, use [vision](/products/cloud/features/ai-ml/agents/builder/vision) with a user-uploaded image. | ||
| - Provider content policies apply. Prompts that violate the provider's policy return an error rather than an image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| sidebarTitle: 'Overview' | ||
| slug: /cloud/features/ai-ml/agents/builder | ||
| title: 'Agent Builder' | ||
| description: 'Create and configure ClickHouse Agents in the Agent Builder' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'agent builder', 'tools', 'instructions'] | ||
| doc_type: 'landing-page' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
| import { Image } from "/snippets/components/Image.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| The Agent Builder is where you create and configure agents. | ||
|
|
||
| <Tip> | ||
| New to ClickHouse Agents? Start with the [Quickstart](/products/cloud/features/ai-ml/agents/quickstart). The pages below cover each part of the builder in detail. | ||
| </Tip> | ||
|
|
||
| This section covers each part of the Agent Builder and contains the following pages: | ||
|
|
||
| | Page | Description | | ||
| |------|-------------| | ||
| | [Model parameters](/products/cloud/features/ai-ml/agents/builder/model-parameters) | Pick a model and tune generation parameters. | | ||
| | [Code interpreter](/products/cloud/features/ai-ml/agents/builder/code-interpreter) | Sandboxed code execution. | | ||
| | [Web search](/products/cloud/features/ai-ml/agents/builder/web-search) | Public-web lookups. | | ||
| | [Image generation](/products/cloud/features/ai-ml/agents/builder/image-generation) | Generate images from text. | | ||
| | [Vision](/products/cloud/features/ai-ml/agents/builder/vision) | Accept image inputs. | | ||
| | [MCP servers](/products/cloud/features/ai-ml/agents/builder/mcp-servers) | Attach third-party MCP servers to an agent. | | ||
| | [Skills](/products/cloud/features/ai-ml/agents/builder/skills) | Reusable instruction packs. | | ||
| | [Subagents](/products/cloud/features/ai-ml/agents/builder/subagents) | Delegate work to child agents. | | ||
38 changes: 38 additions & 0 deletions
38
products/cloud/features/ai-ml/agents/builder/mcp-servers.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| sidebarTitle: 'MCP servers' | ||
| slug: /cloud/features/ai-ml/agents/builder/mcp-servers | ||
| title: 'MCP servers' | ||
| description: 'Attaching third-party MCP servers to a ClickHouse Agent' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'MCP', 'Model Context Protocol'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| Model Context Protocol (MCP) is the open standard for exposing tools and data sources to an AI model. Attaching an MCP server to a ClickHouse Agent gives the agent access to whatever capabilities that server exposes — issue trackers, observability backends, internal APIs, third-party SaaS, or anything else with an MCP endpoint. | ||
|
|
||
| ## Attach an MCP server {#attach-an-mcp-server} | ||
|
|
||
| In the Agent Builder, open the **MCP servers** section and click **Add server**. Enter the server's URL and authentication settings, then pick which of the server's tools you want this specific agent to use. Save the agent. | ||
|
|
||
| You can attach multiple servers to one agent. Each tool the agent calls is logged in the conversation so users can see what the agent did. | ||
|
|
||
| ## Transport {#transport} | ||
|
|
||
| ClickHouse Agents speaks Streamable HTTP — the production-grade MCP transport. The server you attach must be reachable over HTTP(S) from ClickHouse Cloud. | ||
|
|
||
| ## Authentication {#authentication} | ||
|
|
||
| MCP servers can require credentials. ClickHouse Agents supports: | ||
|
|
||
| - **Bearer tokens** and other static headers - fixed values you provide when configuring the server. | ||
| - **OAuth 2.0** - interactive flow. The first time you (or any user with access) calls a tool on the server, the browser opens a sign-in window; tokens are managed and refreshed automatically. | ||
| - **Per-user credentials** - variables in the server config substituted from the calling user's profile, so each user authenticates with their own identity rather than a shared service account. | ||
|
|
||
| User-provided credentials are stored encrypted and scoped to the user who entered them. One user's credentials are never visible to another user's agent runs. | ||
|
|
||
| ## Limits {#limits} | ||
|
|
||
| A single agent run can reference at most 50 distinct MCP server targets and at most 100 expanded tool configurations per request. Agents that need more should be decomposed using [subagents](/products/cloud/features/ai-ml/agents/builder/subagents). |
56 changes: 56 additions & 0 deletions
56
products/cloud/features/ai-ml/agents/builder/model-parameters.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| sidebarTitle: 'Model parameters' | ||
| slug: /cloud/features/ai-ml/agents/builder/model-parameters | ||
| title: 'Model parameters' | ||
| description: 'Configure model selection and generation parameters for ClickHouse Agents' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'model parameters', 'temperature', 'top-p', 'top-k', 'thinking', 'prompt caching'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| Model parameters control which model an agent uses and how that model generates responses. | ||
| From the **Agent Builder** tab, click **Select a model** under the **Model** heading. | ||
| This will open the **Model Parameters** window. | ||
|
|
||
| ## Provider and model {#provider-and-model} | ||
|
|
||
| - **Provider** - select the upstream LLM provider. | ||
| - **Model** - select the specific model from that provider. Different models have different strengths: large reasoning models for planning-heavy tasks, faster small models for routine queries. | ||
|
|
||
| Both **Provider** and **Model** are required. The rest of the panel adapts based on what the selected model supports. | ||
|
|
||
| ## Context and output limits {#context-and-output-limits} | ||
|
|
||
| - **Max Context Tokens** - caps total context the agent sends to the model. Leave as **System** to use the model's default. Lower it to reduce cost; raise it for agents that need to reason over large inputs. | ||
| - **Max Output Tokens** - caps the size of the agent's response. **System** uses the model's default. Set lower if responses are too long, higher if they're being cut off. | ||
| - **File Token Limit** - caps how many tokens a single uploaded file contributes to context. Useful when users attach large files and you don't want them to crowd out the rest of the conversation. | ||
|
|
||
| ## Sampling {#sampling} | ||
|
|
||
| - **Temperature** - randomness. Higher values (0.7–1.0) = more random, while lower values (0.0–0.3) = more focused and deterministic. We recommend altering this or Top P but not both. | ||
| - **Top P** - nucleus sampling. Changes how the model selects tokens for output. | ||
| - **Top K** - restricts sampling to the top K most likely tokens at each step. Supported by some providers; controls determinism along a different axis than temperature. | ||
|
|
||
| If you're not tuning for a specific behavior, leave the sliders near their defaults as small changes rarely move the needle and large ones can degrade output quality. | ||
|
|
||
| ## Reasoning controls {#reasoning-controls} | ||
|
|
||
| Available on models that expose extended reasoning. The exact set varies by provider. | ||
|
|
||
| - **Thinking** - this toggles the model's extended reasoning mode. When on, the model produces internal thinking tokens before its final answer; this usually improves accuracy on hard tasks at the cost of latency and tokens. | ||
| - **Thinking Budget** - sets a token budget for the thinking phase. The model stops thinking and answers once it has spent this many tokens. | ||
| - **Effort** - high-level reasoning effort dial (**Auto**, low, medium, high). Used by reasoning models that don't expose a thinking-token budget directly. | ||
| - **Thought Visibility** - this controls whether the model's thinking is shown to the user inline, hidden behind a collapsed view, or omitted entirely. | ||
|
|
||
| ## Conversation behavior {#conversation-behavior} | ||
|
|
||
| - **Resend Files** - when on, files attached in earlier turns are re-sent on every subsequent turn so the model doesn't lose track of them. Turn off to save tokens if the conversation is short or the model is summarizing files as it goes. | ||
| - **Use Prompt Caching** - when supported by the provider, caches reusable parts of the prompt to reduce cost and latency on conversations where instructions and tool descriptions repeat across turns. | ||
| - **Web Search** - toggles provider-native web search on supported models. This is distinct from the [Web search tool](/products/cloud/features/ai-ml/agents/builder/web-search), which runs as one of the agent's tools rather than as a provider capability. | ||
|
|
||
| ## Reset {#reset} | ||
|
|
||
| **Reset Model Parameters** at the bottom of the panel restores every field to system defaults. Use it when you've experimented enough to want a clean starting point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| sidebarTitle: 'Skills' | ||
| slug: /cloud/features/ai-ml/agents/builder/skills | ||
| title: 'Skills' | ||
| description: 'Reusable instruction packs for ClickHouse Agents' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'skills', 'SKILL.md'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| A skill is a reusable instruction pack an agent can apply on demand. Use skills for procedures that recur across agents — a brand-style guide, a code-review checklist, a runbook for a specific workflow — instead of duplicating the instructions into each agent's system prompt. | ||
|
|
||
| ## Anatomy of a skill {#anatomy-of-a-skill} | ||
|
|
||
| A skill is a Markdown file with a small frontmatter header: | ||
|
|
||
| ```markdown | ||
| --- | ||
| name: revenue-report | ||
| description: Generates the weekly revenue report using our standard segments | ||
| always-apply: false | ||
| user-invocable: true | ||
| --- | ||
|
|
||
| When asked to generate a revenue report: | ||
| 1. Filter to the requested period. | ||
| 2. Apply the standard MRR formula: | ||
| SUM(CASE | ||
| WHEN billing_cycle = 'monthly' THEN amount | ||
| WHEN billing_cycle = 'yearly' THEN amount / 12 | ||
| ELSE 0 | ||
| END) | ||
| 3. Break down by segment: Enterprise, Mid-Market, SMB. | ||
| 4. Render the result as a Markdown table. | ||
| ``` | ||
|
|
||
| The frontmatter knobs that matter most: | ||
|
|
||
| - **`name`** - kebab-case identifier. | ||
| - **`description`** - short summary used by the model to decide when this skill is relevant. Treat this as the most important field. Write it specifically; vague descriptions lead to wrong-skill invocations. | ||
| - **`always-apply`** - when `true`, the skill is primed into every turn instead of being selected. Use sparingly; always-apply skills consume context on every message. | ||
| - **`user-invocable`** - when `true` (the default), the skill appears in the `$` popover for manual selection. | ||
|
|
||
| You can bundle supporting files alongside the skill — reference docs, sample queries, small scripts — by uploading a `.zip` containing the `SKILL.md` and its assets. | ||
|
|
||
| ## Use a skill {#use-a-skill} | ||
|
|
||
| Three ways an agent reaches for a skill in a conversation: | ||
|
|
||
| - **User invocation** - press `$` in the composer and pick the skill from the popover. The skill's content is primed for the next turn. | ||
| - **Model auto-selection** - based on the skill's `description`, the agent decides on its own when to apply it. | ||
| - **Always-apply** - primed on every turn for skills configured that way. | ||
|
|
||
| ## Manage skills {#manage-skills} | ||
|
|
||
| The Skills panel in the Cloud console lets you create skills inline, upload `.md` or `.zip` files, and manage which skills are active for your user. Owned skills default to active; deactivate one to remove it from the popover and the model's catalog without deleting it. | ||
|
|
||
| Skills can be shared with other users (see [sharing and access](/products/cloud/features/ai-ml/agents/sharing-and-access)). | ||
|
|
||
| ## Skills vs. instructions {#skills-vs-instructions} | ||
|
|
||
| - **Agent instructions** define what the agent is and how it behaves overall. Always on for that agent. | ||
| - **Skills** are situational — applied when relevant, scoped to specific workflows. | ||
|
|
||
| Reach for a skill when the same set of step-by-step instructions keeps showing up across multiple agents, or when you want it triggered only for specific user requests rather than every turn. |
46 changes: 46 additions & 0 deletions
46
products/cloud/features/ai-ml/agents/builder/subagents.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| sidebarTitle: 'Subagents' | ||
| slug: /cloud/features/ai-ml/agents/builder/subagents | ||
| title: 'Subagents' | ||
| description: 'Delegating work to child agents in ClickHouse Agents' | ||
| keywords: ['AI', 'ClickHouse Cloud', 'agents', 'subagents', 'delegation'] | ||
| doc_type: 'reference' | ||
| --- | ||
|
|
||
| import BetaBadge from "/snippets/components/BetaBadge/BetaBadge.jsx"; | ||
|
|
||
| <BetaBadge/> | ||
|
|
||
| A subagent is a child agent that a parent agent invokes to handle a self-contained subtask. The child runs with its own context window and its own attached tools, then returns a compact result to the parent. The parent never sees the child's intermediate steps — only the final answer. | ||
|
|
||
| Use subagents to keep a parent agent focused. Long research passes, tool-heavy exploration, and specialized review steps work better when their token-heavy intermediate state stays out of the parent's context. | ||
|
|
||
| ## Enable subagents {#enable-subagents} | ||
|
|
||
| In the Agent Builder, open **Advanced settings** and toggle **Subagents**. Two more controls appear: | ||
|
|
||
| - **Allow self-spawn** - when on, the agent can spawn copies of itself for parallel work. Useful for fan-out patterns (one parent, several identical workers). | ||
| - **Additional subagents** - pick specific other agents this parent is allowed to delegate to. The parent decides at runtime which subagent (if any) to call based on the task. | ||
|
|
||
| Save. When the agent runs, it has a new tool available for invoking subagents. | ||
|
|
||
| ## When a subagent helps {#when-a-subagent-helps} | ||
|
|
||
| - **Research subtasks** - the parent decomposes a complex question, hands a slice to a subagent specialized for that slice, and synthesizes the responses. | ||
| - **Tool-heavy passes** - code interpreter sessions, multi-step web search loops, or anything that would consume the parent's context with intermediate tool output. | ||
| - **Specialized review** - one agent generates, another reviews, the reviewer's full reasoning stays in its own context window. | ||
|
|
||
| Avoid subagents for trivial calls. The handoff adds latency and tokens. | ||
|
|
||
| ## Subagents vs. agent chain {#subagents-vs-agent-chain} | ||
|
|
||
| Subagents are a runtime delegation mechanism — the parent decides on the fly. An agent chain is a pre-defined graph of agents that run in a fixed order. Reach for subagents when the routing is dynamic; reach for a chain when the routing is fixed. | ||
|
|
||
| ## Limits {#limits} | ||
|
|
||
| - Max **10** subagents listed per parent. | ||
| - Max depth of **5** hops from the root agent. | ||
| - Max **50** unique subagent targets loaded for a single run. | ||
| - Max **100** expanded subagent configurations per request. | ||
|
|
||
| Subagents you reference must be visible to the user running the parent. References that resolve to an inaccessible or deleted agent are skipped silently — design your parents to handle a missing child gracefully. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
Imageimport in builder overview pageLow Severity
The
{ Image }component is imported from/snippets/components/Image.jsxbut is never used anywhere in the page — the file only contains a<BetaBadge/>, a<Tip>, and a Markdown table. The other builder pages that don't use images (e.g.mcp-servers.mdx,model-parameters.mdx,skills.mdx,subagents.mdx) correctly omit this import.Reviewed by Cursor Bugbot for commit a1c21dc. Configure here.