ClickHouse
Columnar SQL database that agent tracing stacks are built on
What is ClickHouse?
A column-oriented engine for append-heavy, high-cardinality data, which is the shape agent telemetry takes: one row per model call, filtered later by model, cost or error. Langfuse moved its traces here from Postgres in December 2024 and ClickHouse acquired the project in January 2026, so a self-hosted observability stack increasingly means running this underneath. It is the wrong choice for anything transactional — updates and deletes rewrite whole column parts rather than edit rows — so treat it as where agent runs land, not as the database your application writes state to.
What can you do with ClickHouse?
- Store one row per model call — Columnar storage means a query filtering observations by model, cost or error status reads only those columns while multi-megabyte prompt and completion payloads stay on disk, and the engine is built for large batch inserts merged in the background rather than single-row writes — which is how a queued trace ingestion pipeline wants to write.
- Inherit the storage layer under Langfuse — Langfuse moved tracing data out of Postgres into ClickHouse in December 2024, and ClickHouse acquired Langfuse on 16 January 2026, saying the core stays MIT-licensed and self-hostable at production scale. ClickStack, its OpenTelemetry-native observability stack, runs on the same engine.
- Search embeddings without a second database — A
vector_similarityindex builds an HNSW graph overArray(Float32),Array(Float64)orArray(BFloat16)columns withL2Distance,cosineDistanceordotProduct, available from version 25.8. The index has to be loaded from disk into memory in full to serve a search, and building it slows inserts and merges. - Expect exact scans once you filter — Pre-filtering by metadata is, in the documentation's own words, an unsolved problem — ClickHouse falls back to exact nearest-neighbour search — and post-filtering can return fewer rows than the
LIMITasked for when candidates fail theWHEREclause. If narrow metadata filters over a large collection are your main access pattern, a dedicated vector store handles it better. - Let an agent query it over MCP — ClickHouse publishes
mcp-clickhousein a separate repository, exposinglist_databases,list_tablesandrun_queryplus a chDB tool for embedded queries. It runs read-only unlessCLICKHOUSE_ALLOW_WRITE_ACCESS=trueis set, withDROPandTRUNCATEbehind a second flag.
Star history
16 Aug to 30 Oct · +1.4k
Frequently asked questions
Is ClickHouse free for commercial use?
ClickHouse is released under the Apache-2.0 licence — OSI-approved open source, which permits commercial use.
How can ClickHouse be deployed?
ClickHouse is available as Self-hosted / Runs locally / Managed cloud.