What's the most technically interesting thing you've built, and why?
The AI chat I built into CapREG at Capia. The brief was literally "build a chatbot", and I turned it into a workspace-scoped analytics agent.
Why it's the most interesting:
- The agent loop is mine. An async streaming loop with tool-calling, SSE in the TanStack AI chunk format, talking to a self-hosted OpenAI-compatible model. Tool execution runs in a worker thread because the ClickHouse client is synchronous.
- The context is engineered per request. The system prompt is built from the user's actual workspace: tenant, access group, municipality codes, NACE codes, snapshot date, which years of history exist. It teaches the model what the data means and, just as important, what it doesn't.
- The safety design is the fun part. The agent writes SQL, so the SQL gets validated before running: single statement, SELECT/WITH only, no DDL/DML, a table allow-list, reserved CTEs that can't be shadowed, comments and string literals stripped before scanning, clamped LIMITs. And the query gets wrapped in the same workspace-scoped CTEs the UI uses, so it physically cannot read outside the user's workspace. ClickHouse errors get rewritten too, so the model never sees the fully expanded query and hostnames.
- The output isn't just text. It runs Vega-Lite charts that the frontend themes, with tool-call UI, reasoning display, and conversation persistence.
The iteration loop is what made it good: I refined the prompt, context, and tools over and over against real data until the outputs were consistently right. Agentic code over a 20-million-row register dataset, where a hallucinated municipality code means wrong answers about real companies, is unforgiving in a way frontend work rarely is.
Close second would be the PDF export in the Smartdocs project at DNB, where I abandoned HTML-to-PDF rasterization and rebuilt with react-pdf to keep the citation links alive. But the agent wins.
All conversations are public. Do not share personal information. Privacy