<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tilo Hirsch on Medium]]></title>
        <description><![CDATA[Stories by Tilo Hirsch on Medium]]></description>
        <link>https://medium.com/@tilohirsch?source=rss-cfaf997a5ac0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*o-4Ik5w9Xe0ME5ZP.</url>
            <title>Stories by Tilo Hirsch on Medium</title>
            <link>https://medium.com/@tilohirsch?source=rss-cfaf997a5ac0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:50:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tilohirsch/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Our “Talk to Data” Architecture Stopped Being Linear]]></title>
            <link>https://medium.com/@tilohirsch/why-our-talk-to-data-architecture-stopped-being-linear-70f16fed84be?source=rss-cfaf997a5ac0------2</link>
            <guid isPermaLink="false">https://medium.com/p/70f16fed84be</guid>
            <category><![CDATA[llm-wiki]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[text-to-sql]]></category>
            <dc:creator><![CDATA[Tilo Hirsch]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 23:34:38 GMT</pubDate>
            <atom:updated>2026-06-08T23:31:17.543Z</atom:updated>
            <content:encoded><![CDATA[<p>From prompt chains to LLMWiki: how an internal tool is reducing the distance between curiosity and understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DRzKBClb7Ocaa8lcgoJbqg.png" /></figure><blockquote>“What was the retention in Germany for users who received a message in their first 24 hours?”</blockquote><p>That used to mean opening BigQuery, remembering table structures, debugging joins, and writing complex SQL. Now we just ask the question in plain English. Our internal AI system writes the query, validates it, and returns the answer in seconds.</p><p>Read the full story below.</p><p>QuickMetrics is an internal analytics tool we built from scratch at Hornet to let teams ask business questions in natural language and get grounded answers from our warehouse. It is not a commercial product or a generic dashboard layer. It grew out of our own data, our own operational questions, and the rough edges inside both.</p><p>The first hard problem was not getting an LLM to write SQL. It was that a simple business question rarely points to a simple data surface.</p><p>Take a question like:</p><blockquote>“Why did subscription conversions drop in Germany last week?”</blockquote><p>That sounds like one question. Inside the warehouse it may touch subscription receipts, product catalogs, profile geography, event logs, experiments, app versions, payment platforms, cancellation states, and several subtly different definitions of “conversion.”</p><p>This is the reality most “chat with your data” demos avoid. Valuable company data already exists in the warehouse, but turning curiosity into understanding still involves too much friction:</p><ul><li>dashboards only answer predefined questions</li><li>analysts become bottlenecks</li><li>exploratory questions often die before they are asked</li><li>business terms hide years of data-model history</li></ul><p>We wanted to reduce the time between curiosity and understanding.</p><p>QuickMetrics sits on top of BigQuery and is used across product, operations, engineering, and marketing teams. The visible UI layer is relatively lightweight. Most of the complexity lives underneath:</p><ul><li>semantic retrieval</li><li>query validation</li><li>warehouse metadata</li><li>LLM tool use</li><li>runtime guardrails</li><li>and increasingly, dynamic reasoning instead of static prompt pipelines</li></ul><p>One term matters for the rest of the article: LLMWiki.</p><p>In our use of the term, inspired by Andrej Karpathy’s LLMWiki idea, it means a maintained semantic knowledge layer the model can navigate with tools. It is not just a folder of documents retrieved into a prompt. The goal is for operational knowledge to compound over time instead of being rediscovered from scratch for every question.</p><p>That distinction eventually became central to QuickMetrics.</p><h3><strong>The SQL Problem Was Actually a Semantic Problem</strong></h3><p>Our first versions of QuickMetrics were essentially prompt wrappers around the warehouse.</p><p>The architecture looked clean:</p><pre>Question -&gt; Prompt -&gt; SQL -&gt; Result</pre><p>The first demos were impressive because the system could turn ordinary language into plausible SQL. But real company data quickly exposed the weakness in that framing.</p><p>The model generated queries against tables that technically existed but semantically meant something different from what users intended. Frontend systems and backend systems described the same business events differently. Similar metrics were calculated in slightly incompatible ways across teams. Entire sections of the warehouse only made sense if you already knew the historical context behind them.</p><p>At first we treated these as isolated reliability problems.</p><p>Better prompts would fix it.</p><p>More examples would fix it.</p><p>More schema context would fix it.</p><p>Instead, the model kept exposing inconsistencies we had stopped noticing ourselves.</p><p>The SQL generation problem slowly transformed into a semantic modeling problem.</p><p>We realized we were not teaching the model SQL.</p><p>We were teaching the organization to describe itself coherently.</p><p>That changed the architecture completely. Instead of exposing raw warehouse structure directly to the model, we started building semantic systems around the warehouse itself:</p><ul><li>curated semantic tables</li><li>normalized metric definitions</li><li>discoverable business dimensions</li><li>ontology-like mappings between concepts</li><li>query example retrieval</li><li>metadata registries optimized for retrieval</li><li>semantic grouping structures for related operational concepts</li></ul><p>The important lesson was simple:</p><blockquote>We kept trying to fix the model. The real fix was always in the warehouse.</blockquote><p>We stopped treating the LLM as the source of truth and started treating the warehouse model as the source of truth.</p><p>The model could reason, summarize, explore, and generate SQL. But the warehouse model, semantic docs, event catalogs, metric definitions, and actual BigQuery results had to own reality.</p><p>Over time, ExampleBank, our store of successful historical questions, SQL patterns, and result interpretations, became particularly important. Instead of relying purely on giant prompts, the system could retrieve structurally similar examples dynamically during execution.</p><p>That taught us another lesson:</p><blockquote>One good prompt never survived contact with the next question. What lasted was the institutional memory we built around it.</blockquote><p>LLMs did not magically eliminate ambiguity inside the organization.</p><p>They amplified it.</p><h3><strong>The Pipeline Phase</strong></h3><p>Once semantic structure improved, we assumed the orchestration layer would stabilize.</p><p>It did the opposite.</p><p>Our first serious architecture was a multi-stage pipeline.</p><pre>User Question<br>|<br>v<br>Question Rewriter<br>|<br>v<br>Question Mapping Classifier<br>|<br>v<br>Normalizer + Linter<br>|<br>v<br>Semantic Table Selection<br>|<br>v<br>SQL Generation<br>|<br>v<br>SQL Validation / Fixing<br>|<br>v<br>BigQuery Execution<br>|<br>v<br>Result Interpretation<br>|<br>v<br>Visualization Suggestion</pre><p>This was a real improvement over the naive version.</p><p>Each stage had a job. The rewriter cleaned up ambiguous phrasing. The mapping classifier tried to understand the analytical intent. The normalizer and linter turned messy model output into something the system could inspect. Table selection narrowed the warehouse. SQL validation caught syntax and safety problems. Execution grounded the answer in BigQuery. Interpretation and charting made the result usable.</p><p>For a while, this was the right move. It turned one fragile prompt into a series of inspectable decisions.</p><p>But it was still a line.</p><p>And analytics questions do not really move in a line.</p><p>Some questions needed normalization before retrieval worked properly. Others generated valid SQL against semantically incorrect tables. Some required retries with different context. Some required schema exploration before SQL generation could even begin. Chart generation occasionally exposed problems in the query itself.</p><p>Every failure created another recovery path:</p><ul><li>SQL validators</li><li>query fixers</li><li>normalization layers</li><li>retrieval stages</li><li>linting</li><li>dry-run execution checks</li><li>BigQuery scan estimation</li><li>ExampleBank lookups</li><li>fallback prompts</li><li>retry logic</li></ul><p>At first, this felt like ordinary hardening.</p><p>Then one day we looked at the orchestration layer and realized the clean pipeline from our original diagrams no longer existed.</p><p>We thought we were stabilizing a pipeline.</p><p>We had accidentally built a graph execution engine.</p><p>That is not just an implementation detail. It is the architectural insight.</p><p>A pipeline is right when the next step is known in advance. A graph is right when the next step depends on what the previous step discovers. Analytics questions are like that. A table search can reveal that the obvious table is the wrong grain. An event lookup can reveal that product intent and emitted reality disagree. A BigQuery dry run can reveal that a query is syntactically valid but too expensive. A zero-row result can mean “nothing happened,” or it can mean the wrong event source, wrong date grain, wrong join, or missing whitelist coverage.</p><p>In a pipeline, those are exceptions.</p><p>In QuickMetrics, they became normal movement.</p><p>The right mental model was no longer a conveyor belt. It was a map of possible investigative moves:</p><ul><li>search documentation</li><li>inspect semantic metadata</li><li>compare candidate tables</li><li>retrieve metric definitions</li><li>look up event reality</li><li>inspect physical schema</li><li>run diagnostic SQL probes</li><li>revise based on validation</li><li>preserve constraints from the original question</li><li>stop only when the evidence is strong enough</li></ul><p>The graph structure emerged from production behavior, but it was not accidental in retrospect. It matched the shape of the work.</p><p>Analytics reasoning is non-linear because evidence changes the next question.</p><h3><strong>The Current System Is Not a Pipeline</strong></h3><p>The current LLMWiki configuration is where this became explicit.</p><p>It is tempting to draw it like this:</p><pre>Question <br>-&gt; agent <br>-&gt; tools <br>-&gt; scratchpad <br>-&gt; semantic context <br>-&gt; SQL probes <br>-&gt; validation <br>-&gt; final answer</pre><p>That drawing is misleading because it still looks like a schedule.</p><p>The current system behaves more like an analyst at a desk with a notebook open. The user asks a question. The agent writes down what it knows. Then it decides what to inspect next. It might search the wiki. It might read table documentation. It might inspect live semantic metadata. It might look up an event. It might check a metric definition. It might inspect BigQuery schema. It might run a tiny diagnostic query. It might reject a tempting table because the docs say it is the wrong grain. It might revise the SQL after a dry run. It might loop several times before it is ready to answer.</p><p>A more honest picture looks like this:</p><pre>             documentation search<br>                      |<br>                      v<br>   event lookup → Scratchpad ← metric definitions<br>                      ^<br>                      |<br>semantic tables &lt;-&gt; Agent &lt;-&gt; BigQuery schema<br>                      |<br>                      v<br>            dry runs / SQL probes<br>                      |<br>                      v<br>       validation guards / final answer</pre><p>This diagram is not an execution order. It is a map of possible moves. The agent can move between these surfaces as evidence changes: a semantic-table lookup can send it to schema inspection, a dry run can send it back to documentation, and a suspicious result can force another SQL probe before the final answer is allowed.</p><p>The scratchpad is the center of the system.</p><p>It is not hidden chain-of-thought. It is an explicit, auditable investigation state. It records:</p><ul><li>known facts</li><li>candidate tables</li><li>selected tables</li><li>rejected tables</li><li>event mappings</li><li>date constraints</li><li>required constraints</li><li>validation errors</li><li>open questions</li><li>next steps</li></ul><p>That small object changed the architecture more than it may sound.</p><p>Earlier versions tried to carry the entire investigation inside prompt text. The model had to remember what it had already checked, why a table was rejected, which constraints came from the user’s question, which event source was canonical, and whether the SQL had actually run.</p><p>Now QuickMetrics keeps a compact state outside the model. Each tool call can update that state. The next model call receives the scratchpad plus recent tool results. The agent does not need to rediscover the whole path every time.</p><p>This is the difference between conversation and investigation.</p><p>In conversation, the model responds.</p><p>In investigation, the system accumulates evidence.</p><h3><strong>What The Agent Can Actually Do</strong></h3><p>The current LLMWiki configuration gives the model a set of function tools. They are deliberately practical:</p><ul><li><em>search_wiki</em></li><li><em>read_doc</em></li><li><em>search_repo</em></li><li><em>search_files</em></li><li><em>analyze_docs</em></li><li><em>search_semantic_tables</em></li><li><em>get_semantic_table</em></li><li><em>search_metric_definitions</em></li><li><em>get_metric_definition</em></li><li><em>search_events</em></li><li><em>get_event</em></li><li><em>get_bq_schema</em></li><li><em>dry_run_sql</em></li><li><em>run_sql</em></li></ul><p>And then three terminal actions:</p><ul><li><em>submit_final_answer</em></li><li><em>ask_clarification</em></li><li><em>report_error</em></li></ul><p>This changed the role of the LLM.</p><p>The model is no longer asked to memorize the warehouse.</p><p>It is asked to navigate evidence.</p><p>For example, if a user asks about an event, the agent can search observed events, curated event definitions, and raw Firebase event metadata. If it finds a candidate event, the scratchpad can record the source system, queryable table, whitelist status, foundation status, and warnings. If the SQL returns zero rows, that does not immediately become “the event never happened.” It becomes an investigation signal.</p><p>If a user asks a city-level question, the system can reject SQL that falls back to raw profile location text when canonical geo-cluster reporting is required.</p><p>If the user explicitly asks for “max subscribers at the end of April,” the scratchpad records that the SQL must preserve both the max subscription-tier filter and the snapshot date. If the model drops either constraint, the final answer is rejected and the agent has to revise the query.</p><p>That is the part that feels very different from prompt chaining.</p><p>The LLM is not simply generating a final artifact.</p><p>It is operating inside a runtime that can say:</p><ul><li>you have not checked the right source yet</li><li>this table is the wrong grain</li><li>this SQL is too expensive</li><li>this event metadata has a caveat</li><li>this final answer skipped a required constraint</li><li>this result is empty in a way that needs diagnosis</li></ul><p>Function calling moved orchestration logic from prompts into runtime behavior.</p><p>LLMWiki changed what counted as context. Instead of stuffing gigantic static context windows with schema descriptions, the model can move through a maintained semantic knowledge layer. It can read the docs it needs, inspect live metadata, compare candidates, and write down what it learned.</p><p>Reasoning became movement through semantic space instead of progression through fixed stages.</p><h3><strong>Some Architectures Are Temporary</strong></h3><p>A large amount of AI engineering consists of building temporary compensations around current model weaknesses.</p><p>Earlier generations of models required extremely rigid orchestration:</p><ul><li>defensive prompting</li><li>giant schema dumps</li><li>formatting recovery</li><li>explicit retries</li><li>carefully choreographed execution stages</li></ul><p>At times, our prompts resembled compressed operating manuals more than instructions. Entire schema sections were stuffed into context windows in the hope that the model would notice the right details at the right moment.</p><p>And for a while, this complexity felt necessary.</p><p>Then frontier models improved.</p><p>In our own stack, the LLMWiki approach only became dependable with the newer frontier model class. For example, our current WikiToolAgent path uses OpenAI GPT-5.4 because the architecture depends less on one-shot generation and more on sustained tool-based investigation: search, inspect, remember, run, validate, and revise.</p><p>Suddenly:</p><ul><li>tool usage became dramatically better</li><li>reasoning became more stable</li><li>iterative exploration became viable</li><li>contextual traversal became reliable enough to trust</li></ul><p>Approaches inspired by Karpathy’s LLMWiki had previously felt unstable for us. The model could retrieve documents, but it could not reliably move through them, compare their authority, update its state, inspect schema, run probes, and come back with a grounded answer.</p><p>Then the balance shifted.</p><p>Architectures that previously felt fragile became practical. Older orchestration layers started feeling strangely obsolete.</p><p>Today, a modified version of the LLMWiki idea sits at the core of QuickMetrics: not as a static pile of documents, but as a maintained semantic knowledge layer the agent can navigate while it investigates a question.</p><p>One of the easiest traps in AI engineering is building permanent infrastructure around weaknesses frontier models are rapidly eliminating.</p><blockquote>Some of what we built will outlast the models we built it for. Some of it was just scaffolding around weaknesses that no longer exist.</blockquote><p>The boundary between model capability, orchestration logic, retrieval systems, runtime behavior, and semantic infrastructure keeps moving.</p><p>And the architecture keeps moving with it.</p><h3><strong>The AI System Became Part of the Data Platform</strong></h3><p>At first, we treated the AI system as something layered on top of the warehouse.</p><p>Eventually that separation stopped making sense.</p><p>Our data pipelines run on Mage, and over time the LLMWiki definitions became part of the same repository as the transformation logic itself.</p><p>That created a surprisingly important property. A developer modifying a pipeline could simultaneously update:</p><ul><li>transformations</li><li>semantic definitions</li><li>discoverability</li><li>retrieval metadata</li><li>reasoning context</li></ul><p>inside the same pull request.</p><p>There was no separate onboarding process anymore.</p><p>The reasoning layer evolved alongside the operational system itself.</p><p>This ended up solving an entire class of problems almost accidentally. In many AI analytics systems, semantic drift accumulates constantly:</p><ul><li>prompts become outdated</li><li>documentation lags behind pipelines</li><li>retrieval systems slowly lose alignment with operational reality</li><li>semantic assumptions silently diverge from warehouse behavior</li></ul><p>We originally assumed the AI layer and the data platform were separate systems.</p><p>Over time, we realized that separation itself was creating unnecessary fragility.</p><p>The closer the reasoning system is to the operational system it reasons about, the less semantic drift accumulates over time.</p><h3><strong>QuickMetrics Revealed Questions People Never Asked Before</strong></h3><p>One of the most unexpected transitions had nothing to do with SQL generation at all.</p><p>As usage increased across teams, we started noticing a completely different phenomenon.</p><p>People were asking questions they normally would not ask publicly.</p><p>Not executive dashboard questions. Not polished analytics requests. Tentative questions. Half-formed questions. Curiosity questions.</p><p>Questions like:</p><blockquote>“Did onboarding timing accidentally affect retention?”</blockquote><blockquote>“Why are smaller markets behaving differently this week?”</blockquote><blockquote>“Did we unintentionally change cancellation behavior after the last release?”</blockquote><p>Before QuickMetrics, many of these questions probably would have remained internal thoughts or informal suspicions. Turning curiosity into analysis usually required enough confidence to ask someone else for help:</p><ul><li>analysts</li><li>product teams</li><li>data teams</li><li>managers</li></ul><p>Conversational systems change that dynamic completely.</p><p>The social cost of curiosity drops close to zero.</p><p>And once that friction disappears, entirely new categories of organizational questions begin surfacing.</p><p>We originally thought we were building an analytics interface.</p><p>Instead, QuickMetrics started becoming something closer to an organizational curiosity interface.</p><p>Suspicions became cheap enough to test before they hardened into assumptions.</p><p>The real business problem was never merely query generation.</p><p>It was organizational latency around understanding.</p><h3><strong>Closing Thoughts</strong></h3><p>The most surprising part of QuickMetrics was not that people could ask analytics questions in natural language.</p><p>It was how many new questions appeared once the friction of asking approached zero.</p><p>Every time we thought we understood what we were building, the system moved. The SQL problem turned out to be a semantic problem. The semantic problem turned out to be an orchestration problem. The orchestration problem turned out to be a reasoning problem. And somewhere underneath all of it was an organizational problem we had not even thought to name.</p><p>At first, that kept feeling like a failure of foresight. Looking back, it was actually the point. The boundary between models, orchestration, semantics, operational systems, and human reasoning is not a fixed line to be crossed once. It moves continuously, and the only honest architecture is one that moves with it.</p><p>We set out to reduce the time between curiosity and understanding. We ended up learning that when that distance shrinks, the organization does not just get faster answers; it starts asking different questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70f16fed84be" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>