Cliff Chandler.

Selected work

Deciding what the model gets to see

The company's user-facing AI assistant: the first thing you see on the site, and available to chat with on every page. It answers from the company's own data and cites where the answer came from, keeps track of what was settled earlier in a conversation, and takes actions in the product on the user's behalf. It handles tens of thousands of questions a month.

I did most of the early research and a large share of the build. The architecture and the product direction belonged to the team, and other engineers built substantial parts of it.

The first question was how to put the data in front of a model at all. It lives behind many internal APIs, several of which overlap. Some questions need more than one; some need calls in sequence, each supplying the parameters for the next. And a single endpoint, exposed with every option it has, makes a schema no model uses reliably.

There were other routes. A copy of the data in the warehouse lagged the source and didn't carry the rules for who can see what. A general-purpose query layer existed, but it was poorly documented and rarely used.

I proposed going the other way: each important endpoint as its own tool, cut down to the options that mattered, with a clear description, and the rules for choosing between tools written into the system message. I built the proof of concept that showed a model would pick the right tool and build a correct call, overlaps and dependencies included. The team went with it, and I built several of the harder tools.

I also proposed and built the main research loop, with one rule in it: the first pass gets only our own data. Outside tools, web search among them, open up only when that isn't enough, because we want the answer to cite our data.

Live in production since February 2025

Deciding what can publish without a person

Product wanted events pulled out of news articles — headcount changes, legal issues, awards, and many more — and published as structured data customers see. The first thing I worked on was the list itself. I went through the taxonomy with Product, questioned categories whose business value wasn't clear, and regrouped the events so each category made sense to a customer and shared enough structure underneath to be built as one. Product took several of the changes and explained its reasons for keeping the rest.

The pipeline I built extracts up to about forty event types in a single structured pass, each with its own fields. That is a lot of output to ask of one call, and there was doubt it would hold up. The evaluation showed it did.

Every result carries the model's confidence as a category, from very low to very high. Earlier designs had used a score out of 100; I argued for the categories and built them into the structured output.

Before a pipeline publishes anything on its own, reviewers grade hundreds of sampled results — whether each is correct, and whether its confidence matched. That grading sets the gate. Where a pipeline has earned it, high- and very-high-confidence results publish automatically and the rest go to a person, and the grading repeats on live data. The model never decides on its own what is true; people set how far to trust it, and keep checking.

The reviewing team owns the final prompt. I built them a notebook to experiment with the prompt and the field descriptions directly, and guided them on how to write it. The articles come from another team's service. The new event types needed new entities, relationships and access rules in a core data service another team owns, and I made those changes.

It went into production quickly and has stayed there for two years, including through a migration into a broader pipeline. It has published millions of data points to customers automatically.

The case for testing

We were adding components to the assistant's agent graphs, adding tools, and making the tools do more, and the assistant's behavior was moving under us while we did it. Nothing was catching that. I argued for regression tests: an inexpensive, controlled cost that wouldn't slow development. Pay that up front to catch regressions and keep them out, or pay far more later stumbling into them, with no consistent way to confirm a fix hadn't caused another.

I designed the suite and built it. It runs on every merge to main, making real LLM calls and having a judge model grade them against a golden set. Another developer later moved it onto a framework that brought a few conveniences.

The golden set includes a benchmark response or an expected, static guardrail response, and a list of expected tool calls. Much of the data is private, so an answer assembled without the expected tools is very unlikely to be right.

Different tools covered different parts of the database, and the boundaries between them weren't clean. Information could overlap, could look like it overlapped and not, or could take several tools to assemble. Grading the calls made the system prove it knew which one to reach for.

It also grades that only the expected tools were called — that the agent took its path without casting around for something it didn't need. Churn costs seconds and money. Web search is only a fallback because we want to cite our own data, so an agent that churns instead of finding the right tool can end up there unnecessarily, using expensive tokens. The two are measured separately: whether the answer is right, and whether it was reached without waste.

What they turned up was less regression than inconsistency. Against a target of 90% correct tool use, the score moved anywhere between about 75% and 95% from one run to the next — the same kind of question handled one way, then another. The judges weren't the problem: measured against the golden set, they graded consistently. The variance was in what they were grading.

I made two fixes, both aimed at the inconsistency. The first was an enhancement to a component early in the graph. The second was few-shot examples for the tools, which were hard to prompt: their schemas are generated per user, so what the agent is choosing between isn't the same from one user to the next, and examples written into a schema looked out of reach. But every user's schema shares a common baseline. I wrote static examples against that baseline, covering the hardest calls to construct, and put them inside the schemas themselves.

The score held above 90% from run to run, and tests we had marked as expected to fail started passing and moved into the set that must pass. The suite is a required gate on production releases, and still is two years later.

The proof of concept that worked, and the design it disproved

The proof of concept I built evaluated over 600,000 real data points, and what it caught wasn't a model problem. A service and the people reviewing its output were normalizing differently, so reviewers were hand-editing records that were already correct — just formatted in a way they were instructed to correct.

The first fix went to a field the POC showed had been edited 22,000 times in two months, in ways that could be automated. Several other normalization processes changed after it. That reviewing time now goes to the subjective outputs that are hard to program instead of to formatting.

The same proof of concept was a test of my own design, and it didn't all survive. I had argued for a fully abstract middle layer, but when I gathered the team's real use cases to build against, every one of them was coupled to the data being evaluated: a generic layer would have solved theoretical use cases and carried none of the real, identified work. So I cut the layer I'd argued for.

The failure that never surfaced

I joined a team building maps for autonomous vehicles and was tasked with onboarding to a monolith that was known to have issues and in dire need of throughput improvements, with no set plans to identify or address either.

Building the map for a one-mile stretch of road took hours. At that rate a city was out of reach, and a country was not a conversation worth having.

The work ran on a private supercomputing cluster of NVIDIA nodes, and I quickly found GPU memory failures every time the monolith ran — roughly half of its attempts to allocate GPU memory over-allocated and crashed.

The crashes were recoverable, which is why nobody had chased them. The job would lose that GPU, go find another, and carry on; nothing ever surfaced as a failure. It only cost time, on every run — and it made the time itself unpredictable, since how long a build took depended on how many GPUs it lost along the way.

There were also mistakes underneath that — PyTorch layers that should have been frozen and dropout left active during inference. Those were errors rather than decisions, so I fixed them.

Restructuring was a different matter, so I proposed it before touching anything: bring in Dask and turn the whole thing into a DAG so independent stages could run in parallel. I got the go-ahead and did it. The memory had to come first, though: running more stages at once against the old allocation behaviour means more over-allocation, more crashes, and very little actually running in parallel.

The crash rate went to zero, and the build came out roughly six times faster — from that, and from independent stages finally running at the same time instead of one after another.

Taking out an abstraction that wasn't earning its keep

Our LLM systems were built on LangChain and provider-agnostic abstractions. By the time I argued against them, we had used OpenAI for about two years. Switching providers would have meant re-prompting regardless, because different providers' models need prompting differently, and the framework's support for new models and features trailed OpenAI's own.

I designed a small library to replace it, and built it: one wrapper over OpenAI's live and batch APIs that handles what every call needs — structured output, tool calls, retries, cost — and trims a prompt automatically when it runs over the limit. New API features are usable without waiting for a framework to catch up.

It became the way our team calls the model. The assistant, the asynchronous AI service and the evaluation work all import it, and at least one other team uses it. LangChain came out of each of them.

I applied the same test when Amazon Bedrock arrived and I was asked to look into it. I scoped the comparison myself and ran it on our real workloads for cost and quality. It wasn't clearly better, and it would have brought its own prompting differences and more code to maintain, so I recommended staying where we were for the time being.

The migration that would have shipped quietly broken

A new feature needed a class of data we didn't hold, to be shown to customers on the site. An earlier approach through search results hadn't produced anything useful. I was handed the proposal and a crawling service to try to extract it. What I decided was how to judge it: the relevance of what came back, the cost, and the runtime.

How deep to crawl was the main question. Testing showed that ten to fifteen pages of a site usually turned up most of what there was to find, and that ten pages cost little more time or money than one. That set the crawl. The POC cleared all three bars, I shipped the pipeline, and it has since completed over 11 million requests.

Later the team identified a different, cheaper crawling service. A spike was done, and I inherited the implementation. I found the spike had missed two things:

  • The old service crawled recursively from a starting page and we depended on that. The new one didn't have that capability, so I implemented it by hand.
  • The new service dropped each crawl into its own S3 bucket. But those crawls are deliberately complementary to avoid storage redundancy — finding the data means scanning several previous crawls, not only the most recent one.

Either gap would have let the pipeline run without failing and produce visibly worse data. Nothing would have alarmed anyone; quality would just have been bad. I built the bridges to close both before we used the service for anything real, then made it fast enough to be viable, with necessary multiprocessing on the compute-bound paths.

Then I produced something no one had asked for: a concrete quality comparison between the two services on our actual use cases, before switching.