The Data Context Layer for Agents

Yoni Michael, Typedef, Brandon Callender, Typedef1:46:21 · Oct 2026 · 3,615 views
Thumbnail for The Data Context Layer for Agents Watch on YouTube
TL;DR
  1. 1

    Agents working on data systems need persistent context about grain, joins, metric definitions, and dependencies.

  2. 2

    A context graph can extract deterministic structure from code, verify relationships against data, and let agents query only the relevant subgraph.

  3. 3

    Better tools are insufficient when an agent still chooses grep, so evaluations must measure tool adoption and repeated consistency.

Summary

Yoni Michael argues that agents fail on data work because they do not know what rows mean, whether joins are safe, how metrics are defined, or which assets depend on one another. SQL can compile and return plausible results while producing the wrong diagnosis or silently changing a metric. Typedef's proposed data context layer computes structure from transformation code, profiles warehouse data, stores evidence in a graph, and exposes that context before an agent changes anything. Brandon Callender then builds a smaller code context graph over selected Qdrant Rust crates. Tree-sitter extracts syntax, Rustdoc resolves symbol identities, and Neo4j stores relationships such as references and dependencies. The workshop shows why this graph can distinguish two types with the same name. It also shows the harder problem: agents often ignore graph tools and use grep. Tool names, output formats, prompts, trace inspection, and repeated eval runs therefore matter as much as graph quality.

Key ideas
01:46

Data agents need a persistent reasoning layer

Yoni Michael says the model is not the main bottleneck for agents working on data. The missing piece is context that lets an agent understand a system end to end before it reads or writes anything. He names impact analysis, join recommendations, and safe transformation changes as routine data-team tasks. An agent may write valid SQL while changing a metric's meaning or failing to see what downstream systems will break. That makes read access difficult to trust, especially when metrics feed board decks or pipelines that fail quietly. The proposed data context layer gives the agent a persistent model instead of making it reconstruct the system from scratch for every prompt.

05:05

Table grain determines whether a correct query gives a correct answer

Grain means what each row represents. Michael gives the example of a table whose grain changes from customer by month to customer by week. Downstream sums can become wrong even though the SQL compiles and runs. In one incident pattern, a row count rises because an upstream one-to-one join became one-to-many. An agent can query the data, inspect sample rows, and read the SQL, yet still report that more source data arrived because the intended meaning of one row is not stored in the data itself. Michael says the agent needs computable facts about grain, join safety, metric meaning, and dependencies.

10:20

Join safety requires evidence from both code and data

The same join syntax can preserve rows, perform a dimension lookup, or replicate every row, depending on the underlying data. A between clause can be a safe lookup or can expand the grain through a date spine. Michael recommends deriving structure from SQL, then checking assumptions against profiled tables. For example, the system can test whether a join key is actually unique instead of asking the agent to guess about cardinality. The resulting recommendation can identify a safe join path and flag paths that fan out or silently drop rows. The agent receives evidence about the relationship rather than a conclusion detached from the data.

14:16

A context graph makes dependencies queryable before an agent acts

Typedef stores the extracted facts in a graph that is refreshed on commits. Michael says a graph fits the dependency-heavy nature of data assets because an agent can retrieve the exact subgraph needed in one traversal. For a proposed grain change, the agent can walk downstream dependencies and check whether a monthly measure would be repeated across weekly rows, potentially inflating a dashboard metric. The graph covers the data lifecycle from source systems through transformation models and BI dashboards. This lets the agent estimate the blast radius before it writes SQL or waits for a production incident.

12:42

Deterministic extraction should come before model-generated meaning

Michael recommends parsing transformation logic and computing grain and lineage directly from implementation code. Warehouse profiling can verify join assumptions. An LLM is reserved for ambiguous or human-facing work such as naming assets, summarizing model utility, and resolving classifications. Brandon applies the same pattern to code: Tree-sitter supplies syntax, Rustdoc resolves canonical symbols, and an LLM can later summarize what a symbol does. Brandon warns against asking one large question about an entire codebase. Smaller semantic operations are easier to audit, and a wrong summary can be corrected in the stored graph.

29:06

A code graph separates identical names by canonical identity

Brandon demonstrates two Rust types both named PostingList. Text search finds both definitions and several lookalike names, but it cannot tell which one a question refers to or which methods use each type. The workshop extracts symbols and relationships from selected Qdrant crates, resolves re-exports back to canonical locations, and loads nodes and edges into Neo4j. A blast-radius tool can then answer which symbols depend on one specific PostingList. Changing the two same-named types produces different dependency sets. The graph removes a repeated inference step that would otherwise depend on search order and the agent's guesses.

57:33

Agents may ignore better tools unless the interface matches their habits

Brandon reports that an agent given graph tools alongside grep often uses grep anyway. The model has strong learned habits around search, file reads, and familiar output. He suggests naming a graph tool search, accepting the kind of multi-keyword queries the model already produces, and returning results in a grep-like format. The first call must also produce useful results because an empty or confusing response can send the agent back to its old tools. The lesson is uncomfortable: building a capable graph is only part of the work. Tool design and prompting must account for the agent's existing reflexes.

01:02:07

Evaluations must measure consistency and actual tool use

The workshop compares a graph-equipped agent with a control agent using filesystem search. Brandon recommends deterministic scoring whenever the answer can be checked against a gold set, since judge models add variance and cost. A single correct run does not show that an agent will repeat the answer. Pass-at-k asks whether one of several runs was correct, while the stricter measure asks whether all runs were correct. Trace inspection can reveal broken paths or misleading scoreboard results. Evaluations should also count whether the agent used the intended graph tools. A tool that is reached only some of the time gives only some of its intended benefit.

"The model isn't the bottleneck. The model's going to continue to grow in capabilities. But the missing context to make these agents actually effective is the important part in this."Yoni Michael01:46
Who should watch
  • You are building agents that query or modify warehouse models and need them to understand grain, lineage, joins, or metric definitions.
  • Your coding agent repeatedly searches files even though you have built a richer index or graph, and you need a practical way to measure tool adoption.
  • You want to evaluate agent changes across repeated runs instead of relying on one favorable answer or a single aggregate score.