ClickHouse/agentic-data-stack

Official ClickHouse Agentic Data Stack - self-host with ClickHouse, LibreChat, Langfuse, and ClickHouse MCP.

Shell

110

65 commits

updated Sep 24, 2026

See the code

README

Agentic Data Stack

The open-source stack for ClickHouse's suite of agentic analytic tools — your chat, your models, your data.
Powered by ClickHouse, LibreChat, and Langfuse.

Learn more at clickhouse.ai and the Agentic Data Stack blog.

One Click Deploy

Want to skip the setup and jump straight into adding agentic analytics into your workflow? Choose a Railway template below to spin up a preconfigured instance of the Agentic Data Stack in the cloud.

Langfuse OSS
Langfuse Cloud
Deploy on Railway Deploy on Railway (Langfuse Cloud)

More details available in the Deploy on Railway section.

Overview

This project runs a fully self-hosted agentic analytics environment with Docker Compose. It connects a chat UI (LibreChat) to your data (ClickHouse) via MCP, with full LLM observability (Langfuse) — all in a single docker compose up command.

What's included

ComponentPurposePort
LibreChatModern Chat UI with multi-model / provider support (OpenAI, Anthropic, Google)3080
Admin PanelBrowser-based configuration UI for LibreChat3081
ClickHouse MCPMCP server that gives agents access to ClickHouse8000
LangfuseLLM observability — traces, evals, prompt management3000
ClickHouseWorld's fastest analytical database8123
PostgreSQLTransactional database for Langfuse5432
MongoDBTransactional database for LibreChat27017
MinIOS3-compatible object storage9090
RedisCaching and queue6379
MeilisearchFull-text search for LibreChat7700
pgvectorVector database for RAG5433
RAG APIRetrieval-augmented generation service for LibreChat8001

Deploy on Railway

One-click deploy of two "Lite" variants of the stack:

  • Langfuse OSS — Deploys LibreChat, the Admin Panel, Langfuse v3, and a ClickHouse MCP server pre-configured against the public ClickHouse demo cluster.
  • Langfuse Cloud — Deploys LibreChat, the Admin Panel, and ClickHouse MCP, and is pre-configured to send traces to your existing Langfuse Cloud (or other remote Langfuse) project.

Both Railway templates skip Meilisearch, pgvector, and the RAG API for simplicity. The ClickHouse MCP server ships pointed at sql-clickhouse.clickhouse.com so you can chat with the public demo data immediately; the ClickHouse Cloud MCP is also wired up if you want to OAuth into your own Cloud account post-deploy. Prefer to self-host? See Quick Start below.

Quick Start

Prerequisites

  • Docker and Docker Compose v2+

1. Prepare the environment

./scripts/prepare-demo.sh

This is your fastest way to get started with the Agentic Data Stack. It generates a .env file with random credentials for all services, then presents an interactive menu to optionally configure API keys for OpenAI, Anthropic, and/or Google. Any providers you skip will remain as user_provided, letting users enter their own keys in the LibreChat UI.

The script then asks whether LibreChat should send its Langfuse traces to the local Langfuse container (the default) or to a remote Langfuse project. Choose the cloud option to point LibreChat at Langfuse Cloud (or any self-hosted Langfuse) by entering the base URL, public key, and secret key for that project. Choosing local restores the local endpoint and initialized project keys even if a previous run configured a remote project. If LibreChat is already running, the script recreates that service when its Compose configuration changed and verifies the effective runtime target, so new settings take effect immediately. You can change this later by editing LANGFUSE_BASE_URL, LANGFUSE_PUBLIC_KEY, and LANGFUSE_SECRET_KEY in .env, then running scripts/reconcile-demo-runtime.sh.

You can also generate credentials separately and customize the initial administrator account credentials:

USER_EMAIL="you@example.com" USER_PASSWORD="supersecret" USER_NAME="YourName" ./scripts/generate-env.sh

Learn more about configuring your LibreChat instance at https://librechat.ai/docs.

Note: To use LibreChat's file search / RAG features, the RAG API needs a real API key for embeddings — user_provided won't work because the RAG API calls the embeddings endpoint directly. If OPENAI_API_KEY is set to user_provided, set RAG_OPENAI_API_KEY to a valid OpenAI key (it overrides OPENAI_API_KEY for RAG only). You can also switch embedding providers via EMBEDDINGS_PROVIDER (openai, azure, huggingface, huggingfacetei, ollama). See the RAG API docs for details.

2. Start the stack

docker compose up -d

3. Access the services

An admin user is created automatically on first startup using the credentials from your .env file.

Architecture

Architecture

LibreChat connects to ClickHouse through the MCP server, allowing AI agents to query and analyze your data. All LLM interactions are traced in Langfuse for observability, evaluation, and prompt management. The Admin Panel provides a browser-based UI for LibreChat configuration without editing librechat.yaml by hand.

Scripts

ScriptDescription
scripts/prepare-demo.shGenerate .env and interactively configure API keys
scripts/generate-env.shGenerate .env with random credentials
scripts/reconcile-demo-runtime.shApply .env changes to a running LibreChat container and verify its Langfuse target
scripts/reset-all.shStop all containers and wipe all data/volumes
scripts/create-librechat-user.shManually create a LibreChat admin user
scripts/init-librechat-user.shAuto-init user on container startup (used internally)

Configuration

  • LibreChat — librechat.yaml configures endpoints, MCP servers, and agent capabilities. The Admin Panel (http://localhost:3081) offers a browser-based alternative for most of these settings.
  • Environment — .env holds all credentials and service configuration (see .env.example for reference).
  • Admin Panel authentication — Local HTTP uses password login with SSO disabled and non-Secure session cookies. Set ADMIN_SSO_ENABLED=true after configuring LibreChat OpenID, and set ADMIN_SESSION_COOKIE_SECURE=true whenever the Admin Panel is served over HTTPS.
  • Docker — docker-compose.yml includes the four compose files:
    • langfuse-compose.yml — Langfuse, ClickHouse, PostgreSQL, Redis, MinIO
    • clickhouse-mcp-compose.yml — ClickHouse MCP server
    • librechat-compose.yml — LibreChat, MongoDB, Meilisearch, pgvector, RAG API
    • admin-panel-compose.yml — LibreChat Admin Panel

Reset Everything

To tear down all containers and delete all data:

./scripts/reset-all.sh

Then set up again and start fresh:

./scripts/prepare-demo.sh
docker compose up -d

Significant stargazers

Alasdair Brown

50 followers · starred Feb 2026

Dylan Frankland

164 followers · starred May 2026

Shaun Struwig

25 followers · starred Mar 2026

Clemo

44 followers · starred Feb 2026

ClickHouse/agentic-data-stack

Official ClickHouse Agentic Data Stack - self-host with ClickHouse, LibreChat, Langfuse, and ClickHouse MCP.

Shell

110

65 commits

updated Sep 24, 2026

See the code

README

Agentic Data Stack

The open-source stack for ClickHouse's suite of agentic analytic tools — your chat, your models, your data.
Powered by ClickHouse, LibreChat, and Langfuse.

Learn more at clickhouse.ai and the Agentic Data Stack blog.

One Click Deploy

Want to skip the setup and jump straight into adding agentic analytics into your workflow? Choose a Railway template below to spin up a preconfigured instance of the Agentic Data Stack in the cloud.

Langfuse OSS
Langfuse Cloud
Deploy on Railway Deploy on Railway (Langfuse Cloud)

More details available in the Deploy on Railway section.

Overview

This project runs a fully self-hosted agentic analytics environment with Docker Compose. It connects a chat UI (LibreChat) to your data (ClickHouse) via MCP, with full LLM observability (Langfuse) — all in a single docker compose up command.

What's included

ComponentPurposePort
LibreChatModern Chat UI with multi-model / provider support (OpenAI, Anthropic, Google)3080
Admin PanelBrowser-based configuration UI for LibreChat3081
ClickHouse MCPMCP server that gives agents access to ClickHouse8000
LangfuseLLM observability — traces, evals, prompt management3000
ClickHouseWorld's fastest analytical database8123
PostgreSQLTransactional database for Langfuse5432
MongoDBTransactional database for LibreChat27017
MinIOS3-compatible object storage9090
RedisCaching and queue6379
MeilisearchFull-text search for LibreChat7700
pgvectorVector database for RAG5433
RAG APIRetrieval-augmented generation service for LibreChat8001

Deploy on Railway

One-click deploy of two "Lite" variants of the stack:

  • Langfuse OSS — Deploys LibreChat, the Admin Panel, Langfuse v3, and a ClickHouse MCP server pre-configured against the public ClickHouse demo cluster.
  • Langfuse Cloud — Deploys LibreChat, the Admin Panel, and ClickHouse MCP, and is pre-configured to send traces to your existing Langfuse Cloud (or other remote Langfuse) project.

Both Railway templates skip Meilisearch, pgvector, and the RAG API for simplicity. The ClickHouse MCP server ships pointed at sql-clickhouse.clickhouse.com so you can chat with the public demo data immediately; the ClickHouse Cloud MCP is also wired up if you want to OAuth into your own Cloud account post-deploy. Prefer to self-host? See Quick Start below.

Quick Start

Prerequisites

  • Docker and Docker Compose v2+

1. Prepare the environment

./scripts/prepare-demo.sh

This is your fastest way to get started with the Agentic Data Stack. It generates a .env file with random credentials for all services, then presents an interactive menu to optionally configure API keys for OpenAI, Anthropic, and/or Google. Any providers you skip will remain as user_provided, letting users enter their own keys in the LibreChat UI.

The script then asks whether LibreChat should send its Langfuse traces to the local Langfuse container (the default) or to a remote Langfuse project. Choose the cloud option to point LibreChat at Langfuse Cloud (or any self-hosted Langfuse) by entering the base URL, public key, and secret key for that project. Choosing local restores the local endpoint and initialized project keys even if a previous run configured a remote project. If LibreChat is already running, the script recreates that service when its Compose configuration changed and verifies the effective runtime target, so new settings take effect immediately. You can change this later by editing LANGFUSE_BASE_URL, LANGFUSE_PUBLIC_KEY, and LANGFUSE_SECRET_KEY in .env, then running scripts/reconcile-demo-runtime.sh.

You can also generate credentials separately and customize the initial administrator account credentials:

USER_EMAIL="you@example.com" USER_PASSWORD="supersecret" USER_NAME="YourName" ./scripts/generate-env.sh

Learn more about configuring your LibreChat instance at https://librechat.ai/docs.

Note: To use LibreChat's file search / RAG features, the RAG API needs a real API key for embeddings — user_provided won't work because the RAG API calls the embeddings endpoint directly. If OPENAI_API_KEY is set to user_provided, set RAG_OPENAI_API_KEY to a valid OpenAI key (it overrides OPENAI_API_KEY for RAG only). You can also switch embedding providers via EMBEDDINGS_PROVIDER (openai, azure, huggingface, huggingfacetei, ollama). See the RAG API docs for details.

2. Start the stack

docker compose up -d

3. Access the services

An admin user is created automatically on first startup using the credentials from your .env file.

Architecture

Architecture

LibreChat connects to ClickHouse through the MCP server, allowing AI agents to query and analyze your data. All LLM interactions are traced in Langfuse for observability, evaluation, and prompt management. The Admin Panel provides a browser-based UI for LibreChat configuration without editing librechat.yaml by hand.

Scripts

ScriptDescription
scripts/prepare-demo.shGenerate .env and interactively configure API keys
scripts/generate-env.shGenerate .env with random credentials
scripts/reconcile-demo-runtime.shApply .env changes to a running LibreChat container and verify its Langfuse target
scripts/reset-all.shStop all containers and wipe all data/volumes
scripts/create-librechat-user.shManually create a LibreChat admin user
scripts/init-librechat-user.shAuto-init user on container startup (used internally)

Configuration

  • LibreChat — librechat.yaml configures endpoints, MCP servers, and agent capabilities. The Admin Panel (http://localhost:3081) offers a browser-based alternative for most of these settings.
  • Environment — .env holds all credentials and service configuration (see .env.example for reference).
  • Admin Panel authentication — Local HTTP uses password login with SSO disabled and non-Secure session cookies. Set ADMIN_SSO_ENABLED=true after configuring LibreChat OpenID, and set ADMIN_SESSION_COOKIE_SECURE=true whenever the Admin Panel is served over HTTPS.
  • Docker — docker-compose.yml includes the four compose files:
    • langfuse-compose.yml — Langfuse, ClickHouse, PostgreSQL, Redis, MinIO
    • clickhouse-mcp-compose.yml — ClickHouse MCP server
    • librechat-compose.yml — LibreChat, MongoDB, Meilisearch, pgvector, RAG API
    • admin-panel-compose.yml — LibreChat Admin Panel

Reset Everything

To tear down all containers and delete all data:

./scripts/reset-all.sh

Then set up again and start fresh:

./scripts/prepare-demo.sh
docker compose up -d

Significant stargazers

Alasdair Brown

50 followers · starred Feb 2026

Dylan Frankland

164 followers · starred May 2026

Shaun Struwig

25 followers · starred Mar 2026

Clemo

44 followers · starred Feb 2026

Languages

Shell

45.0%

TypeScript

42.7%

JavaScript

12.3%