Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 13 min read Opinion easyNovice

Agent-Facing Analytics

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.

Related posts

  • 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.

  • Agentic analytics in Slack with ClickHouse, MCP, and PydanticAI

    ClickHouse mediumAdept

    A Slack bot built with PydanticAI and the Anthropic API answers natural-language analytics questions by querying ClickHouse through the mcp-clickhouse MCP server. The walkthrough covers Slack app setup in Socket Mode (scopes, events, tokens), launching the MCP server on demand via MCPServerStdio (simpler to manage, at some latency cost), configuring the Agent with a system prompt, and handling DMs and mentions with thread history passed as context. Logs show the LLM listing tools, databases and tables before issuing SQL against the public sql.clickhouse.com playground.

  • Building an agentic app with ClickHouse MCP and CopilotKit

    ClickHouse mediumAdept

    A natural-language analytics dashboard for UK property prices can be built by combining an LLM (Claude Sonnet 3.7), the ClickHouse MCP Server and CopilotKit in a Next.js app. The LLM turns a prompt into SQL, CopilotKit's MCP client runs it against ClickHouse over SSE, and the model then calls a `generateChart` action defined with `useCopilotAction` to render the result via ECharts. The walkthrough covers swapping in the Anthropic adapter, running the MCP server with fastmcp, and sharing chart state with `useCopilotReadable`. It recommends a read-only ClickHouse user with restricted databases, quotas and a limited settings profile so the model cannot reach data or run queries beyond what is intended.

  • 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.

  • AI Functions in ClickHouse: Upgrade your SQL to the AI age

    ClickHouse mediumAdept

    ClickHouse's beta AI Functions call LLM and embedding providers directly from SQL. They include aiClassify, aiExtract, aiGenerate, aiTranslate, aiFilter, aiRedact, aiEmbed and aiSimilarity, added across releases 26.4 to 26.8, and they make one HTTP request per row (batched for embeddings) and return native ClickHouse values. Setup on OSS uses named collections for credentials and works with any OpenAI-compatible endpoint, including local models via Ollama. Examples on the Hacker News dataset show classification, LLM predicates in WHERE, summarization, translation and an in-database RAG pipeline built on materialized-view embeddings and vector indexes. Per-query quotas on API calls and input/output tokens cap spend: call limits are exact, token limits can overshoot by one in-flight request per thread, a soft-stop mode returns partial results, and actual usage is visible in system.query_log ProfileEvents.

The quest for software engineering knowledge.

Look:
Layout: