{"slug": "why-clickhouse-and-agents-are-a-great-combo", "title": "Why Clickhouse and Agents are a Great Combo", "summary": "A developer at the company exe built a tool called exe-finops that combines ClickHouse with AI agents to generate financial reports and investigate billing issues, reducing the need for manual data reconstruction. The tool ingests webhook events from Stripe and other billing providers into ClickHouse, then uses natural language prompts to produce reports on revenue, usage overages, and token pass-throughs, and can also answer custom questions by writing SQL queries. In a recent case, exe-finops helped resolve a dispute by tracing a shared payment method between two customer accounts, identifying that one customer had accidentally used another's payment method due to having two browser tabs open.", "body_md": "At exe, we collect a lot of telemetry about how our system performs. We use Grafana, Prometheus, and we have all sorts of graphs and alerts. This is great, but it doesn’t say much about what’s happening on the financial side of the business—the churn rate, ARR. Those are things that don’t typically concern engineers.\n\nThe obvious answer to this is Stripe Sigma. It’s a solid tool. We used it when I was at 1Password. It’s also expensive and incomplete. Sigma can only see what happens inside Stripe, whereas we bill through the app stores and cloud marketplaces too. Also, a lot of our telemetry is built on ClickHouse.\n\nVidrik, who runs accounting, needed three types of reports. Monthly revenue broken down by plan, usage overages, and token pass-throughs (customers buy tokens, we pay the LLM provider).\n\nTo solve this, I built a tool called exe-finops. You type a prompt and get a report. The way it works is pretty straightforward.\n\nStripe lets you configure webhooks and specify which events you want to receive. For our main service, we subscribe to a specific set, because those are the ones it needs to react to. Separately, we run a “firehose”: an endpoint that’s subscribed to everything Stripe will send us, whether or not any part of the product currently reacts to it. We do the same with our other billing providers. The receiver doesn’t do much with this except write the event into ClickHouse.\n\nExe-finops is built on top of that. It pulls the events out of ClickHouse and puts them into its own SQLite database. Provider webhooks have a lot of information, but if the report needs more (for example, the full customer object) it goes back to Stripe’s API and gets it.\n\nHistorically, getting to this point required a real pipeline. Someone built the ETL, Databricks was involved, and Snowflake. There’s all this stuff, in other words, that needed to be built. Exe-finops doesn’t do any of that. It has the events and a reporting layer on top. All three of the reports Vidrik wanted are now prompts.\n\nExe-finops also supports custom reports, which is useful when you have a question you want answered, like monthly growth, or which days are busiest for billing transactions (I looked a few days ago and it’s Wednesdays and Sundays, no idea why).\n\nI built exe-finops for these reports, but the firehose is also pretty useful. The part of billing that eats the most time is reconstructing what happened from a provider’s dashboard.\n\nHere’s a recent example: two accounts were created by two separate but related customers. They shared a payment method. Customer A told us the sharing wasn’t authorized. Customer B had no idea what customer A was talking about. Both wanted answers immediately due to a legal dispute between the parties. Previously, I would have had to go spelunking through Stripe to find the connection. Instead, I gave the agent two Stripe customer IDs and the claim (“someone says a payment method was shared between these accounts on accident”). It read through the webhook events in ClickHouse and figured it out. Sure enough, exe-finops tracked down the issue: Customer B accidentally subscribed with Customer A’s payment method. Exe-finops pointed out that Customer B had two tabs open in their browser and was the likely culprit. I sent the customers what we saw in our data and both were satisfied (and amazed at the level of detail I provided). No surprise that agents write the SQL against ClickHouse much better than me.\n\nFundamentally, this has made my job easier. When a support question comes in or I need to see what our financial data is doing, I don’t need to fumble around in the Stripe UI or CLI to try and reconstruct it.", "url": "https://wpnews.pro/news/why-clickhouse-and-agents-are-a-great-combo", "canonical_source": "https://blog.exe.dev/meet-exe-finops-the-custom-tool-i-built-for-our-billing-data", "published_at": "2026-09-02 15:00:00+00:00", "updated_at": "2026-09-02 15:22:48.451317+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "artificial-intelligence"], "entities": ["exe", "ClickHouse", "Stripe", "exe-finops", "Grafana", "Prometheus", "Vidrik"], "alternates": {"html": "https://wpnews.pro/news/why-clickhouse-and-agents-are-a-great-combo", "markdown": "https://wpnews.pro/news/why-clickhouse-and-agents-are-a-great-combo.md", "text": "https://wpnews.pro/news/why-clickhouse-and-agents-are-a-great-combo.txt", "jsonld": "https://wpnews.pro/news/why-clickhouse-and-agents-are-a-great-combo.jsonld"}}