The open-source stack for ClickHouse's suite of agentic analytic tools — your chat, your models, your data.
Powered by ClickHouse Cloud, LibreChat, and Langfuse Cloud.
Learn more at clickhouse.ai
This project runs an agentic analytics environment with Docker Compose. It connects a chat UI (LibreChat) to your data (ClickHouse Cloud) via MCP, with full LLM observability via Langfuse Cloud — all in a single docker compose up command.
ClickHouse and Langfuse are both managed cloud services, so nothing beyond Docker is required to run locally.
| Component | Purpose | Hosted |
|---|---|---|
| LibreChat | Modern Chat UI with multi-model / provider support (OpenAI, Anthropic, Google) | Local (3081) |
| ClickHouse MCP | MCP server that gives agents access to ClickHouse | ClickHouse Cloud |
| Langfuse | LLM observability — traces, evals, prompt management | Langfuse Cloud |
| Langfuse Enricher | Patches AgentRun traces with human-readable agent names from LibreChat | Local (sidecar) |
| MongoDB | Transactional database for LibreChat | Local (27017) |
| Meilisearch | Full-text search for LibreChat | Local (7700) |
| pgvector | Vector database for RAG | Local (5433) |
| RAG API | Retrieval-augmented generation service for LibreChat | Local (8022) |
- Docker and Docker Compose v2+
- A ClickHouse Cloud account — get your MCP auth token from the ClickHouse Cloud console
- A Langfuse Cloud account — get your public and secret API keys from Project Settings → API Keys
./scripts/prepare-demo.shThis generates a .env file with random credentials for all local services, then presents an interactive menu to configure your API keys (OpenAI, Anthropic, Google). Any providers you skip will remain as user_provided, letting users enter their own keys in the LibreChat UI.
You will also need to set the following cloud service credentials in your .env:
# ClickHouse Cloud MCP
CLICKHOUSE_MCP_AUTH_TOKEN=<your token from ClickHouse Cloud>
# Langfuse Cloud (US region — adjust LANGFUSE_BASE_URL for EU)
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_BASE_URL=https://us.cloud.langfuse.comYou can also generate credentials separately and customize the initial administrator account:
USER_EMAIL="[email protected]" USER_PASSWORD="supersecret" USER_NAME="YourName" ./scripts/generate-env.shNote: To use LibreChat's file search / RAG features, the RAG API needs a real API key for embeddings —
user_providedwon't work because the RAG API calls the embeddings endpoint directly. IfOPENAI_API_KEYis set touser_provided, setRAG_OPENAI_API_KEYto a valid OpenAI key (it overridesOPENAI_API_KEYfor RAG only). You can also switch embedding providers viaEMBEDDINGS_PROVIDER(openai,azure,huggingface,huggingfacetei,ollama). See the RAG API docs for details.
docker compose up -d- LibreChat — http://localhost:3081
- Langfuse — https://us.cloud.langfuse.com
An admin user is created automatically on first startup using the credentials from your .env file.
LibreChat connects to ClickHouse Cloud through the managed MCP endpoint, allowing AI agents to query and analyze your data. All LLM interactions are traced in Langfuse Cloud for observability, evaluation, and prompt management. A local enricher sidecar automatically tags each trace with the agent's display name.
Traces are sent automatically to Langfuse Cloud from LibreChat. The langfuse-enricher sidecar runs alongside the stack and enriches every AgentRun trace with:
- Tag —
agent:<AgentName>(e.g.agent:Varejão) - Metadata field —
agent_name: <AgentName>
This makes it easy to filter traces by agent in the Langfuse UI. The enricher polls every 60 seconds and backfills the last 7 days on startup.
| Script | Description |
|---|---|
scripts/prepare-demo.sh |
Generate .env and interactively configure API keys |
scripts/generate-env.sh |
Generate .env with random credentials |
scripts/reset-all.sh |
Stop all containers and wipe all local data/volumes |
scripts/create-librechat-user.sh |
Manually create a LibreChat admin user |
scripts/init-librechat-user.sh |
Auto-init user on container startup (used internally) |
- LibreChat —
librechat.yamlconfigures endpoints, MCP servers, and agent capabilities - Environment —
.envholds all credentials and service configuration (see.env.examplefor reference) - Docker —
docker-compose.ymlincludeslibrechat-compose.yml, which defines all local services including the Langfuse enricher sidecar
To tear down all containers and delete all local data:
./scripts/reset-all.shThen set up again and start fresh:
./scripts/prepare-demo.sh
docker compose up -d- clickhouse.ai — Project homepage
- Documentation — Full setup guide for adding ClickHouse MCP to LibreChat
- ClickHouse MCP — MCP server for ClickHouse
- LibreChat — Chat UI
- Langfuse — LLM observability