Maxa builds high-context business data products for analytics and delivers them as a Snowflake Native App or a managed Snowflake instance. It has about 50 people, was Snowflake's Start-Up of the Year in 2023, won a Data Driver award in 2024, and is a Snowflake Ventures portfolio company.
The next step on Maxa's roadmap was agents that work directly on its customers' ERP data. Agents don't query the way analysts do. They ask the same question several ways, check their own results and try again, so the database sees far more queries than a person reading reports would ever send. This post covers how the first of those workloads moved to ClickHouse, and what turned up along the way.
Why the warehouse got expensive
Snowflake bills compute by the second and was designed around people reading reports. When software queries it continuously, it gets too slow and too expensive at the same time.
Over 90 days on the warehouse serving one customer's data mart, fewer than one credit in five was spent executing queries. More than 80% went to overhead, most of it the warehouse running between queries. Snowflake bills a 60-second minimum every time a warehouse resumes.
The queries themselves were fast. The cost came from the gaps between them, and an agent that queries all day keeps the warehouse awake all day. On a warehouse billed by the second, agent workloads would eat into Maxa's margins, and more so as customer demand grew.
Pounding the database 100 times a second doesn't work. It literally doesn't work from a technical standpoint and certainly from a cost standpoint.
Alexis Steinman, co-CEO, Maxa
The stack we proposed
Maxa wanted a stack built for the workload it was heading toward. Bonneville proposed ClickHouse's Agentic Data Stack: ClickHouse for the data, LibreChat as the chat interface and agent builder, and Langfuse for traces, evals and cost, all connected by ClickHouse's MCP server.
An agent's question takes one path through it. LibreChat calls the MCP server, which gives the agent three tools (list_databases, list_tables and run_query), and the query runs on ClickHouse. Langfuse traces each query, and every LibreChat query is stored in ClickHouse as well.
The proposal covered more than the first analytic workload, and ClickHouse is now Maxa's preferred environment for AI development.
Moving 72 tables and checking every value
A four-person Bonneville team owned delivery end to end. Maxa granted access and reviewed the work.
Of the 72 tables, 17 were event tables whose business fields sat inside JSON. The team profiled those fields and extracted them into typed columns before loading.
Row counts and totals can match even when values have moved between rows, so the team compared every field on both sides. That came to 1,551,504,149 values, with zero differences.
Sort keys were chosen by timing candidate orderings against the questions Maxa's users ask. On the invoice mart, the winning key reads 5.5 times fewer rows than the obvious alternative, and a one-month question now reads between 0.1% and 7% of a table.
For the production pipeline, Bonneville follows the path ClickHouse documents. Snowflake exports to S3 as Parquet, and the s3 table function loads the files into ClickHouse. Parquet keeps types and precision, and the staged files give Maxa a copy to fall back on and a clean starting point for incremental loads.
What the source data was hiding
Two problems turned up in the data itself, and both came from Maxa's source systems.
In 8 of the 17 event tables, the event timestamp was the load time, so any time-based analysis on those tables had been reading the wrong date. The real date was still in the JSON. The team recovered it, and it now drives the sort order.
The operating companies also don't all report in one currency. A join on date alone would have added dirhams to dollars, so every join now carries the company too.
A lift-and-shift would have carried both problems into ClickHouse unchanged. Maxa now has a written list of every condition the team found in its source data.
The analyst on production data
A working agent was running on production data two days after scoping. By day four, Maxa had its customer's ERP data on ClickHouse Cloud and a LibreChat analyst answering questions against it.
Running on Sonnet 5, the analyst answered 51 of 51 test questions correctly with an admin role and 50 of 51 with a user role, taking about 9 seconds per answer. It refused every write.
Speed was measured on the same data with caching off. All 8 benchmark queries ran faster on ClickHouse, the best of them 14.3 times faster.
| Measure | Snowflake | ClickHouse |
|---|---|---|
| 8 benchmark queries | 2.1 s on a Medium warehouse | 0.63 s, 3.3x faster |
| One work order's full status history | 129 ms | 9 ms |
| Storage | 1.6 GB | 1.05 GB (1.49 GB before tuning) |
What comes next
At handoff, Maxa received both databases, a playbook and runbook, the accuracy harness, and the list of source-data conditions.
This first workload was a single customer's managed instance. It is now the target architecture for moving 10 more of Maxa's customer instances to ClickHouse's Agentic Data Stack.
Read the Maxa case study, or see how we run migrations and put agents on ClickHouse.