How to set up ClickHouse for agentic analytics
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.
Related posts
- How Suprema Gaming made its data platform agent-ready with ClickHouse Cloud
ClickHouse mediumAdept
Suprema Gaming moved its analytics warehouse from Snowflake to ClickHouse Cloud so that AI agents could query fresh, governed data directly. Ingestion now uses ClickPipes CDC and Debezium/Kafka in place of S3/Snowpipe batches, and dbt deployed via GitHub Actions defines layered transformations with no external orchestrator. Data freshness went from four hours to a p95 lag of about one minute, mart reads got 27x faster, and warehouse spend fell roughly 62%. Metrics were validated to the cent through an agent-assisted loop that captures each rule as a dbt test, and a fleet of 10 specialized agents with version-controlled skills, traced in Langfuse, serves business users.
- Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents
ClickHouse mediumAdept
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. The global view combines remoteSecure() table pointers to the remote regions with a Merge engine table over local and remote tables, so data stays resident in its region and is fetched only at query time. The agent scripted provisioning by parsing JSON output with jq and polling service status, then added SQL-based and native ClickStack alerts. The broader argument is that a scriptable CLI with clean JSON output suits agent-driven infrastructure better than a web console.
- Agentic coding with ClickHouse. One person, one data stack, one full-stack application
ClickHouse easyNovice
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. The stack uses Next.js on Vercel with per-persona workspaces, PostgreSQL for transactions synced to ClickHouse via ClickPipes CDC, and a Bronze/Silver/Gold medallion layout built on materialized views. On top sit 18 LibreChat agents, plus two observability layers: Langfuse for LLM tracing and cost, and ClickStack over OpenTelemetry for infrastructure. Open source components, Cursor skills and MCP database connectors reduce AI guesswork, though iteration, review and token costs remain significant.
- How Fetch built its flexible agentic analytics tool on ClickHouse Cloud
ClickHouse easyNovice
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. Ad hoc queries such as same-receipt basket intersections scan hundreds of millions of rows in under a second, and median agent response time is 1.9 seconds across about 500 daily queries. The team picked ClickHouse for its ad hoc query speed, compute isolation between concurrent queries and simple scaling. A nightly pipeline copies data from Snowflake to S3, loads it via ClickPipes into a new versioned wide table, then repoints a view at it. That keeps LLM-generated queries stable and makes rollback trivial, at the cost of skipping incremental loads.
- Agent-Facing Analytics
ClickHouse easyNovice
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. Real-time OLAP systems suit these workloads because of fresh data, fast aggregations, high concurrency and consolidated domain data, but could adapt further through templated query endpoints, LLM-oriented SQL extensions for data discovery, LLMs.txt documentation, server-side agent memory and caching, and short-lived task-scoped access tokens. The ClickHouse MCP server demonstrates the idea today, exposing tools to list databases, list tables and run SELECT queries for models like Claude.