How LangChain grew self-serve analytics questions 40x by giving its AI agent layered context

Last edited on Oct 27, 2026
Emily Hawkins, head of analytics engineering at LangChain, and Logan Cochran, analytics engineer at LangChain, walked through how their team built a layered context system to keep an AI analytics agent accurate as the business kept changing underneath it. Their starting premise: an agent is only as smart as the context it's given, and a language model has no built-in understanding of a company's data, business rules, or internal vocabulary.
The first layer of context is the dbt project itself. LangChain syncs table and column descriptions from dbt into BigQuery, so Hex and any other internal agent reading from BigQuery inherits the same descriptions. That required a shift in how the team writes documentation: a vague description like "the status of the account" used to be fine when only expert humans read it, but an agent reading the same field now needs something closer to "the current lifecycle status of the account in Salesforce, where active means an active paid contract, churned means a paid contract that has ended, and prospect means the account isn't a customer yet."
Their Hex agent also has direct access to the dbt repo and DAG, so it can reason about upstream and downstream dependencies and the SQL logic behind a given model, not just column names.
On top of that, LangChain layers three more pieces inside Hex.
Workspace guides are markdown files that explain business concepts an agent needs to interpret a question correctly, things like how the team measures ARR or its internal product vocabulary; the team writes these guides in its dbt repo and imports them into Hex through a GitHub Action, so they stay version-controlled and available to any other agent that wants them. A semantic layer defines metrics and join relationships in code for the team's most important models, so a question about a revenue metric resolves the same way no matter how many times it's asked. And endorsements mark which mart models and dashboards are trusted sources of truth: LangChain is deliberately selective about what gets endorsed, since an endorsement that isn't a strong signal stops meaning anything, and any change to an endorsed dashboard requires a data team review before it publishes.
That combination let the team change how it thinks about its own role. Rather than trying to answer every question that comes in, the data team now focuses on owning the context that lets other departments self-serve directly, a shift the team illustrated with a before-and-after view of departments routing questions through the data team versus querying the agent directly. They were candid that this works even while the business changes faster than documentation can keep up: a pricing model change can cascade across multiple domains, and a business domain doesn't need airtight metric definitions before an agent can start being useful.
The team treats context as something to document continuously as it changes, not a project with an end date.
LangChain says this system increased the number of questions asked through self-serve analytics by 40x, driven by continuing to document context as it changes, educating users on how to work with the agent, and measuring impact to iterate on what context is missing. Next on their roadmap: adding evals, and using Hex's CLI to enrich context further.
Watch every keynote and breakout from dbt Summit 2026 on demand. Watch dbt Summit 2026 on demand →
Get started in dbt
Join the analytics engineers building data infrastructure that actually scales.
Install dbt Wizard CLI
Get started with an agent purpose-built for analytics engineering. It knows which tool to call, which context to pull, and checks its own work before surfacing anything to you.


