---
title: "How to set up ClickHouse for agentic analytics"
description: "Preparing a ClickHouse Cloud warehouse for AI agents comes down to classic warehousing discipline: isolate workloads on separate compute services over shared storage, expose only curated marts, and enforce guardrails through roles and resource limits."
url: "https://swe.quest/articles/how-to-set-up-clickhouse-for-agentic-analytics-27a1e03046d721dc"
canonical: "https://clickhouse.com/blog/how-to-set-up-clickhouse-for-agentic-analytics"
source: "ClickHouse"
published: "2026-02-23"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["analytics","ai-agents","identity-auth","data-pipelines","multi-tenancy"]
---

# How to set up ClickHouse for agentic analytics

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-02-23, 8 min read, How-to. Original: [https://clickhouse.com/blog/how-to-set-up-clickhouse-for-agentic-analytics](https://clickhouse.com/blog/how-to-set-up-clickhouse-for-agentic-analytics)

## Summary

Preparing a ClickHouse Cloud warehouse for AI agents comes down to classic warehousing discipline: isolate workloads on separate compute services over shared storage, expose only curated marts, and enforce guardrails through roles and resource limits. The suggested setup uses four services (read/write ingestion, transformation and development, plus a read-only LLM service) and raw/staging/marts databases. An LLM role restricted to SELECT on marts is capped with settings such as readonly, max\_execution\_time, max\_memory\_usage, max\_rows\_to\_read and max\_threads. Incremental materialized views handle staging and refreshable materialized views produce consistent marts before the agent connects via MCP using read-only credentials.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)

## Prerequisites

- data warehousing concepts
- SQL role-based access control ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- materialized views

## Keywords

ClickHouse, ClickHouse Cloud, ClickPipes, MCP, dbt, materialized views

## Related posts

- [How Suprema Gaming made its data platform agent-ready with ClickHouse Cloud](https://swe.quest/articles/how-suprema-gaming-made-its-data-platform-agent-ready-with-clickhouse-cloud-456ba316ef057ccc.md): ClickHouse · 2026-08-25 · Medium · 11 min read · Analytics & OLAP, Data pipelines, AI agents, Games
  Suprema Gaming moved its analytics warehouse from Snowflake to ClickHouse Cloud so that AI agents could query fresh, governed data directly.
- [Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents](https://swe.quest/articles/agentic-infrastructure-with-clickhousectl-a-distributed-clickstack-across-three-d01a61602ef37a05.md): ClickHouse · 2026-07-22 · Medium · 7 min read · Observability, AI agents, Analytics & OLAP, Developer tools, Cloud platforms
  A coding agent using the clickhousectl CLI stood up three ClickHouse Cloud services in us-east-1, eu-west-1 and ap-northeast-1, each ingesting OpenTelemetry logs, traces and metrics locally, with a federated global view in Europe for the ClickStack UI.
- [Agentic coding with ClickHouse. One person, one data stack, one full-stack application](https://swe.quest/articles/agentic-coding-with-clickhouse-one-person-one-data-stack-one-full-stack-ca4c2d9fd47cef68.md): ClickHouse · 2026-04-14 · Easy · 13 min read · AI for coding, Analytics & OLAP, Observability, AI agents
  A ClickHouse Solutions Architect with no frontend or backend background built ClickShop, a full-stack retail analytics demo, in a couple of days using Cursor.
- [How Fetch built its flexible agentic analytics tool on ClickHouse Cloud](https://swe.quest/articles/how-fetch-built-its-flexible-agentic-analytics-tool-on-clickhouse-cloud-284f56cdf33d7d26.md): ClickHouse · 2026-07-28 · Easy · 6 min read · Analytics & OLAP, AI agents, Data pipelines, LLMs
  Fetch built FAST, a conversational BI agent that lets non-technical sales teams query receipt purchase data in plain language, on ClickHouse Cloud ingesting 150 billion rows (6.5 TB compressed) a day.
- [Agent-Facing Analytics](https://swe.quest/articles/agent-facing-analytics-abbe75281484a032.md): ClickHouse · 2025-02-13 · Easy · 13 min read · AI agents, Analytics & OLAP, Databases, LLMs
  AI agents are emerging as a new user persona for real-time analytics databases, generating high volumes of concurrent, iterative exploratory SQL queries on behalf of users.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
