chDB as the Agent's Local Data Engine
Embedding chDB, the in-process ClickHouse engine, inside an agent keeps hot data local, so tool-call latency is bounded by CPU instead of network round trips, jitter and retries. Agent memory is modeled as an append-only MergeTree table with version and soft-delete columns, which supports semantic recall via cosineDistance, full history and point-in-time queries, plus an optional ReplacingMergeTree materialized view for current state. chDB also acts as a federation hub that joins S3, Postgres, remote ClickHouse and Pandas in one query. The central argument is that over N sequential calls failures compound as (1−p)^N, and each failed call triggers full-context retries and detours, so localizing data cuts token spend as well as latency; the piece closes by pairing chDB with AWS Lambda MicroVMs.
Related posts
- chDB Durable Layer for agent memory
ClickHouse mediumAdept
chDB Durable Layer wraps the embedded chDB (ClickHouse) OLAP engine so a local MergeTree working copy can be published to object storage you own (S3, GCS, Azure) and recovered on another host. Writes stay local until an explicit flush(), checkpoint() folds the statement WAL into a new base snapshot, and a head.json record updated with conditional writes provides a single-writer lease with fencing. It targets agent memory, keeping recall as an in-process query (local was 58x faster than remote in their benchmark) while making state survive ephemeral sandboxes and CI. Recommended practices include append-only versioned memory tables, ZSTD-compressed cold evidence with blobs stored outside the table, flushing at task boundaries, and moving to a server database when multiple writers are needed.
- Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents
ClickHouse mediumAdept
A coding agent using the clickhousectl CLI stood up three ClickHouse Cloud services in us-east-1, eu-west-1 and ap-northeast-1, each ingesting OpenTelemetry logs, traces and metrics locally, with a federated global view in Europe for the ClickStack UI. The global view combines remoteSecure() table pointers to the remote regions with a Merge engine table over local and remote tables, so data stays resident in its region and is fetched only at query time. The agent scripted provisioning by parsing JSON output with jq and polling service status, then added SQL-based and native ClickStack alerts. The broader argument is that a scriptable CLI with clean JSON output suits agent-driven infrastructure better than a web console.
- 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.
- How Fountain rebuilt its data plane on ClickHouse Cloud to power Cue, the Frontline Superintelligence
ClickHouse mediumAdept
Fountain replaced a multi-vendor batch pipeline (third-party replication to S3/Iceberg, then BigQuery) with ClickPipes CDC streaming Postgres and MongoDB directly into ClickHouse Cloud, cutting analytics freshness from three hours to under two minutes, with most queries sub-second, at about 66% lower cost. MongoDB documents land in ClickHouse's native JSON type, which enables schema-on-read dot-notation access, and over 2,000 incremental materialized views built with dbt replace any orchestrator. Moving a lagInFrame plus ASOF JOIN window computation into insert-time materialized views cut per-query memory by 80% on an 838M-row table, and 60-98% across other query shapes. Tenant isolation for the Cue LLM agent is enforced through empty service users, versioned RBAC roles, session variables set by the MCP backend, and row policies, so the design fails closed and resists prompt injection.
- 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.