The Data Agent Stack - Part 4: Meaning Lives in Code

· Source: The Agent Stack · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics, Software Development & Engineering · Depth: Advanced, long

Summary

Data agents often fail to provide accurate answers despite correct SQL due to a lack of understanding of data's true meaning, which extends beyond mere schema definitions. While schemas describe data shape and query history shows usage patterns, neither fully captures critical context like data grain, exclusions, freshness, or business rules. The article argues that pipeline code is the highest-authority source for this "hidden contract," revealing executable behavior such as deduplication rules, update cadences, and implemented business logic. It proposes building a comprehensive "table context card" that integrates schema metadata, trusted query usage, owner annotations, semantic definitions, lineage, orchestration state, and pipeline-derived facts. This approach, exemplified by systems like OpenAI's in-house data agent and Spotify's data assistant, ensures agents reason over governed, reliable context rather than anonymous or potentially misleading information.

Key takeaway

For Data Engineers or AI Engineers building data agents, relying solely on table schemas or query history will lead to inaccurate results. You must integrate pipeline code as a high-authority source to capture the true meaning, grain, and freshness of your data. Implement a robust "table context card" system that extracts and refreshes code-derived facts, ensuring your agent reasons over governed, validated context. This approach prevents common failure modes like grain mismatches or stale logic, making your data agent reliable and trustworthy.

Key insights

Data agents require code-derived context to understand true data meaning, beyond schemas and query history, for reliable answers.

Principles

Method

Build a "table context card" by extracting and refreshing table-centered facts from pipeline code, integrating schema, query history, annotations, lineage, and orchestration state.

In practice

Topics

Best for: AI Engineer, Data Engineer, Data Scientist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by The Agent Stack.