Skip to main content
The easiest way to run agentic analytics on ClickHouse is ClickHouse Agents in ClickHouse Cloud: fully managed, with no infrastructure to run. Users ask questions in plain language, and an AI agent answers by querying the database directly. To self-host, the Agentic Data Stack is a composable open-source stack. You run it yourself, connect your own models, and keep your chat and data in your own environment. It’s built from ClickHouse, the ClickHouse MCP server, LibreChat, and Langfuse.

What is agentic analytics?

In agentic analytics, the model grounds its answers by running queries against your data. Given a question, the agent inspects the available databases and tables, decides which queries to run, executes them against ClickHouse, and builds an answer from the results. It can refine a query, run a follow-up, or chain several steps together. When a query fails or returns something unexpected, it adjusts and tries again instead of stopping.

What you can do

  • Ask questions in natural language and get answers drawn from your own data.
  • Build agents with no code: give an agent instructions and tools, then reuse it.
  • Share agents and conversations as read-only links, so others can trace the queries behind an answer.
  • Generate interactive charts and visualizations from query results inside a conversation.
  • Evaluate and improve answers: score responses in Langfuse with human review or an LLM judge, then refine your prompts and agents.

How the stack fits together

A user asks a question in LibreChat. The model plans a response and, through the MCP server, calls tools to explore and query ClickHouse. Results flow back, and the agent composes an answer. Langfuse, built on OpenTelemetry, records each run from prompt to tool call to response, lets you score outputs automatically or with human review, and tracks quality, cost, and latency. The ClickHouse MCP server is built on the Model Context Protocol, an open standard, so it works with any MCP-compatible client or agent framework, not only LibreChat. See the MCP guides for clients and agent libraries.

Components

ComponentRoleLearn more
ClickHouseThe analytical engine the agent queriesGet started with ClickHouse
ClickHouse MCP serverThe open standard that exposes ClickHouse to the agent as toolsMCP server
LibreChatThe chat and agent front-end users interact withLibreChat
LangfuseObservability for every prompt, tool call, and responseLangfuse

Get started

There are two ways to run agentic analytics on ClickHouse:
  • Managed (ClickHouse Cloud): the fastest path, with no setup. ClickHouse Agents provides hosted chat and agents over your data. The individual pieces are also available managed: the Remote MCP server and Langfuse Cloud.
  • Self-hosted (open source): run the full stack yourself with Docker Compose, connecting your own models and keeping your data in your environment.
To try the stack against public datasets without installing anything, use AgentHouse, the hosted demo. Other open-source AI capabilities on ClickHouse:
Last modified on June 12, 2026