Using CHouse UIAI agents

AI agents

Every AI feature and the chat run on an agent you can edit in AI Governance › Assistant: how features, agents, harnesses, skills and tools fit together.

In the app
AI Governance › Assistant/ai/assistant
AI Governance › Assistant in CHouse UI
AI Governance › Assistant

Every AI feature in CHouse UI runs on an agent you can see and change in AI Governance › Assistant: the chat, the SQL editor's Optimize and Debug, the Doctor scan, the diagnoses in Monitoring, and the DataOps and observability assistants. Nothing about an agent is hard-coded. CHouse ships built-in agents; you can edit them, add your own, rewire which agent a feature uses, and test a change before you save it.

How it fits together

PartWhat it isWhere it lives
FeatureA place in the product that calls the AI, such as Optimize query or Fleet Doctor scan. It decides who may call it, gathers the evidence, and checks the shape of the answerCode — listed in the AI feature catalog
BindingWhich agent a feature runs on. One agent per featureAI Governance › Assistant › Features
AgentA system prompt, a task template, a model, tools, skills, subagents, a harness and tuningAI Governance › Assistant › Agents — see Editing agents
SubagentAnother agent that a parent can hand a sub-task toThe parent's Subagents list
HarnessHow DeepAgents runs an agent: which built-in tools it sees, a prompt suffix, an optional general-purpose subagentAI Governance › Assistant › Harnesses — see Harnesses
SkillA SKILL.md with reference files that an agent reads when it needs it, or that is pinned into its promptAI Governance › Assistant › Skills — see Skills
ToolA read-only action an agent can call: query ClickHouse, read a node's system.* tables, read CHouse's own API as the userCode — listed in the AI tool catalog

The split is deliberate. What the product depends on — permissions, evidence, the output contract, what a tool does and as whom — stays in code, where it is reviewed and tested. What you tune — the wording, the model, which tools and skills an agent gets, how work is delegated — is data you manage in the UI.

What happens on a run

  1. The feature checks the user's permission (ai:optimize, doctor:run, …) and gathers its evidence.
  2. It looks up its bound agent. A missing, disabled or no-longer-fitting agent fails the run with an error that says what to fix; nothing falls back silently.
  3. The agent's prompt and task template are rendered with the feature's template variables, and pinned skills are appended.
  4. The agent tree is built: each agent with its own harness, its granted tools and its skills, and its subagents below it.
  5. The model runs, calling tools and delegating to subagents, within the agent's step budget and timeout.
  6. Structured features validate the answer against their JSON contract and finish the result in code (for example the before→after EXPLAIN estimate of Optimize).

Every tool call is recorded with the agent that made it, so the chat's activity panel and the test console show which agent did what.

Who can do what

PermissionAllowsDefault roles
ai_agents:viewOpen AI Governance › Assistant and read every agent, harness, skill, binding and its historySuper Admin, Admin
ai_agents:manageCreate, edit, delete, rebind, reset, restore — and run the test consoleSuper Admin, Admin

Using an AI feature keeps its own permission (ai:chat, ai:optimize, doctor:run, …); see the permission catalog. Agents can never do more than the person they run for: ClickHouse tools run on the user's connection with their data access rules, and CHouse tools call the API as that user.

The Assistant screen

The header shows four counters: the number of AI features, Agents (and how many you added), Customized built-ins (and how many have a CHouse update waiting), and Problems. Below it, six tabs:

TabWhat it shows
FeaturesEvery AI feature, grouped by where it appears, with the contexts its tools may use and its agent. Pick another agent to rebind it — see Rebinding a feature
AgentsA tree of routers and top-level agents with their subagents below. New agent, and Edit or View on each row
HarnessesThe built-in and custom harnesses
SkillsEvery skill with its files
ToolsThe read-only tool catalog: what each tool does, the context it needs, the permissions it needs and which agents use it
Test consoleRun any feature or chat agent as you, on your active connection

The Tools tabTools: the read-only catalog, with the context and permissions each tool needs

Problems

The registry is checked as a whole after every change. The Problems panel lists everything that would stop a feature from running: a feature with no agent, an agent that is disabled, a tool the feature's context can't serve, a template that uses a variable the feature doesn't provide, a skill reference that doesn't resolve, a subagent cycle. A save that would add a problem is rejected with the list; problems that already existed never block an unrelated edit.

Rebinding a feature

In Features, the agent menu offers only agents that fit the feature:

  • the Chat feature takes a chat agent (an agent with no task template); every other feature takes a feature agent (one with a task template)
  • every tool in the agent's whole tree must run in a context the feature provides — a fleet agent using query_node can't serve a SQL-editor feature that only has a ClickHouse session
  • the agent must be enabled

The server checks again on save, including the agent's templates against the feature's variables. To try a new agent on a feature without touching the live one, Duplicate the bound agent, change the copy, test it in the test console, then rebind. Every rebinding is versioned and audited — see Versions, upgrades & audit.

Models and limits

An agent can name its own model; empty means the default model from AI models. A model the user picks in the chat or the SQL editor wins over the agent's model, and a subagent without its own model uses its parent's.

The per-model runtime parameters set in AI models — recursion limit and run timeout — win over an agent's tuning. When a run stops with "The AI agent hit its step limit", raise the agent's step budget or recursion limit, or that model's parameter. See Settings.

In this section

Edit this page on GitHub ↗