The agent writes perfect SQL. It runs it. It renders a beautiful chart. And then it tells you the wrong answer with total confidence.

That’s the failure mode Yoni Michael, co-founder of TypeDev, opens with on the AI Engineer podcast. A pipeline’s row count spikes 40% overnight. The agent reports “more data came in.” What actually happened: an upstream column turned a one-to-one join into a one-to-many join, changing the grain of the data. The agent can read the numbers but cannot explain them.

“The model isn’t the bottleneck,” Michael argues. “The missing context to make these agents actually effective is the important part.”

TypeDev has spent a year and a half building what they call the trust layer for data agents. Their thesis is simple: agents will become core operators of data systems, and the thing stopping them isn’t capability — it’s context. The four facts that decide whether an answer is right are grain (what one row means), join safety, metric meaning, and dependencies. None of these are written down anywhere an agent can read.

Neither obvious fix works

Michael frames the problem with two tempting solutions that both fail.

Handing the agent the code? It re-derives context from scratch on every prompt, probabilistically, bounded by the context window, and rebuilt from zero each session. There’s no persistence.

Connecting a Snowflake or Databricks MCP so it can see rows and sample data? Now it sees the numbers but has no understanding of what each row means.

“The first situation is one can read the code, but doesn’t actually have memory to be able to persist the knowledge of the context,” Michael explains. “And the other sees the data but doesn’t actually associate the meaning behind it.”

So what’s the fix? A persistent, computable context model. Specifically, a graph.

Deterministic first, LLM last

Michael’s architectural principle is one he returns to repeatedly: “You wanna always be as deterministic as possible first, and then only use LLMs when you’re trying to resolve ambiguity or do things that models are actually really good at.”

For data systems, that means three layers. First, parse transformation logic down to ASTs to understand structure and dependencies. Second, compute grain and lineage directly from the SQL. Third, profile tables in the warehouse to verify join-key uniqueness against real data. Only then does the LLM come in — to name business entities, summarize model utility, and resolve whatever ambiguity remains.

Brandon Callender, TypeDev’s other co-founder, scales this same recipe down for a workshop on a codebase. He builds what he calls a “context graph” over a sample of the Quadrant codebase, using TreeSitter for syntax, Rust doc JSON for resolution, and Neo4j for storage. The ladder has three rungs:

RungWhat it producesMechanismDeterminism0Syntactic structure — every type, trait, functionTreeSitter (language-agnostic AST)Fully deterministic1Resolution — canonical identity and location for each symbolRust doc JSON (compiler-derived)Fully deterministic2Meaning — what each symbol is for, in one sentenceLLM summarizationProbabilistic, auditable

He picked Rust on purpose. Rung one comes free because the compiler already resolves symbols. He calls this “cheating” on purpose, because the lesson is that you can build a well-engineered version of something on an easier instance of the problem before scaling it up.

The payoff of resolution is immediate in the demo. Search for posting_list at rung zero and you get an exported symbol with no way to trace it back to its definition. At rung one, the system reports the canonical location and the exact file and line. That’s what lets the graph link re-exports back to their origin crate, and what lets the agent tell two identically named posting_list symbols apart.

A graph beats a flat index because agents can traverse it

Michael’s argument for storing context as a graph rather than a pile of markdown is about access pattern. The agent pulls exactly the subgraph it needs in one traversal, avoiding prompt stuffing and scaling past 500 models because nothing re-reads the whole project.

He notes the irony: graph databases have had a resurgence in the AI era because models turn out to be very good at writing Cypher and traversing typed nodes and edges — which suits data assets because they are inherently dependency-based.

Callender demonstrates this on code. He builds a full-text search index over all extracted symbols and shows it reproduces the grep problem: searching posting_list returns the re-export and the struct, but not the linkage between them. The agent can infer the relationship, “but you don’t want it to have to make that logical leap every single time because it’s gonna be that one time where it gets it wrong.”

Once the symbols are loaded into Neo4j, Callender builds a blast_radius tool: pass in a qualified name, and it walks the graph to find everything that depends on it. Running it against two different posting_list symbols returns two different sets of dependents — proof that canonical resolution produces a more definitive answer than reading files and guessing.

He wires up a Pydantic agent with a system prompt and Cypher-backed tools. It answers “what breaks if I change posting list” by calling search a couple of times, then blast radius twice. Then he shows a generic tool that executes arbitrary Cypher. With a schema in the system prompt, an agent can write its own queries from natural language — “I wanna see every struct that implements a trait along with the trait that it implements” — and generate the Cypher itself.

“If you can express the idea that you want to do, then it’s pretty easy to write Cypher,” Callender says. “And that’s a sign that you have created the right schema for the job.”

The agent will grep anyway — tool adoption is the real work

Here’s where the episode gets genuinely counterintuitive. Callender built the graph tool, gave it to the agent alongside grep, and watched the agent run grep anyway. It globbed, read files, occasionally poked the graph, got confused, and went back to wading through text.

His explanation is post-training. Models have been trained in countless circumstances where the answer is to grep and read. A better tool does not override that reflex. The fix is not to fight the prior but to lean into it.

“So the agent is going to grep anyway,” Callender says. “When you keep trying to out-engine your grep, you’re just gonna have a kind of frustrating time. If you can design with the grain as much as possible, will help the agents lean into what they want to do anyway.”

The tactics: Name the tool search, not graph_query. Return results in ripgrep’s shape — same structure and response format the model has been trained to handle. Make the first call pay off every time. If the agent calls search, gets nothing, and concludes the tool is broken, it will not come back.

“An elegant tool that gets reached for a third of the time is just a third of a tool,” Callender says. “And every capability win that you can get from better tools is gated by this number.”

He’s blunt about where the work lives: “You can build that notebook. You can build your amazing graph context in an afternoon. The hard part is actually making the agent use it.”

Evals measure determinism, not best-case accuracy

Callender ran an overnight evaluation: 30 questions, five retries, comparing a graph agent against a control agent with file-system probing tools, both on the same model. Gold answers were mined from the graph but cross-referenced back to source code so the gold was not contaminated by the graph’s own output.

The results are the episode’s most quotable data point:

MetricWhat it measuresOutcomepass@k (k=1)Single-shot correctnessRoughly a tie; grep slightly ahead on some control questionspass^k (5 runs)Correct on every runGraph agent about 2x more consistentToken efficiencyAverage tokens per runGraph approach used ~3.1x fewer tokensTool adoptionShare of traces using the intended tool34% with a naive prompt, 72% after prompt changes

The goal was never to beat grep on correctness, because grep is very good at what it does. The goal is determinism — getting it right every time across 5, 10, 20 runs, not once. Callender notes the graph agent deliberately does not sample private variables, only public crate surfaces, which is why grep wins some control questions.

On eval design, he’s prescriptive. Score deterministically wherever possible; LLM-as-judge is overused. Mine real task candidates from the corpus. Unit-test the scorer itself first. Run evals many times and report pass@k and pass^k. And deliberately include cases the agent is bad at: “If your agent’s passing your eval 100%, your eval’s too easy. Your agent should be close to failing your evals.”

He also warns that agents cheat. In a bug-fix eval where the agent checks out a branch, it will happily use Git to diff against main and find how the bug was introduced — and will spot a branch named as a test and exploit it. Harnesses must be hardened against this.

Read your traces — the scoreboard lies

Callender devotes a section to a failure he hit personally. He built an eval harness, got results that were directionally correct — graph beat grep — and then looked deeper. The tool was returning file paths, but sometimes the wrong path, so the agent would follow a bad path and read the wrong files. The scoreboard looked fine; the architecture underneath was broken.

“The fix is never just to make the number higher or nicer,” he says. “It’s to build a harder eval. Read the traces, find the artifact, harden the harness, and then rerun. Never trust your own scoreboard.”

He mentions having had to redo entire talks after rerunning evals changed the conclusions. His advice is to go into whatever system receives traces and actually read them, because a directionally correct score can bury a much larger underlying problem.

Where the approach pays off

Callender is candid about scope. Asked whether it’s worth building a code graph from scratch, he says no for most people: “I don’t think you should be building this, to be clear. This is a worked example for educational purposes.” There are already companies doing code-layer graph analysis. It’s worth building for learning how to construct agents, tooling, and context graphs — not as a product for an individual.

The graph earns its keep most in larger codebases and less well-structured languages. In Rust, “I wanna see what implements this trait” is a simple search. In Python, where grepping client lands you in “a land of 50,000 clients,” the graph is far more valuable. The structure of the graph and tools does not need to change across languages — only the ingestion layer.

On scaling, he argues incremental indexing must be a first-class design concern from day one. You do not want to re-query the warehouse 500 times or recompile all the SQL; you want to update only what changed. “You have to deal with the problem of re-syncing the information long before you have to deal with the actual scaling problem of how to store it.”

On the semantic layer, he argues the LLM finally makes a translation layer possible between business users and data engineers. A business analyst reporting a broken revenue dashboard could have the system trace back three layers, identify the owning team, find the change that landed last week, and file a ticket with the root cause already captured. He’s explicit that TypeDev is not a data catalog replacement: the catalog supplies table and column metadata and profiling information that gets pulled into the graph, and the two coexist.

The unresolved tension the episode leaves is the one Callender names himself: he did all the work, built the graph, ran the evals, and got a tie. The instinct to keep optimizing can become sunk cost. The alternative — designing with the grain of what the model already wants to do — is less satisfying to build and, on his evidence, more likely to actually get used.

For the 30-year-old tech worker watching this space, the lesson is practical. Don’t bet on the tool that feels most elegant in a demo. Bet on the one the agent will actually reach for when no one is watching. The future of the AI agent market belongs to whoever solves adoption — not whoever builds the smartest graph.