Context
A knowledge factory for your data
The system that keeps what agents know about your data current, and how far we have built it.
On this page
The asking
- Your people and customersask through their agents
- Contextthe agent reads it first
- Sourcesthen it queries them, read-only
The data work
- Activity recordBonnard keeps every call, for your data team only
- Your data teamreads it with their own AI
- Updatea fix to the context
- dbt projecta fix to the data: pull request, merge, build. In development
Agents fail at company work when they don’t know how the company runs. So you need a system that collects that knowledge and keeps it current for them. People have been working on this for a while. LangChain recently gave it a good name: a knowledge factory.
Our vision for Bonnard is similar, and the path is evolving fast. This post shows what it looks like for data and how far along we are.
Three kinds of knowledge
LangChain’s post names three kinds of knowledge an agent needs:
- SkillsHow to do the work the way your company does it.
- Domain knowledgeHow the business works: products, customers, policies.
- Data access guidanceWhich source to use, what lives where and how to query it.
On data, the post makes a point we would underline. If your warehouse is the source of truth, don’t keep a second copy of the data for agents. Keep instructions on what lives where and how to query it.
All three apply to data work. We started with the third.
Data access guidance comes first
Data is the ground truth, and getting it right is the hygiene work. In Bonnard that work is called context, and it is three things:
- Data access guidance. Tables, keys and joins: what each table and column holds, and how they connect.
- Domain knowledge. Metrics and terms: a calculation with instructions on when to use it, and what a word means in your data.
- Skills. Verified questions: a real question with the SQL that answers it. In development.
It is kept per data source, and agents read it through one MCP before they write SQL. The MCP runs that SQL on your database, read-only.
It pays off early. In our own agent testing, authored descriptions on an opaque schema took an agent’s first-try table-finding from roughly one in four to near-perfect.
Your agents already hold a lot of the context. Bonnard gives you and your agent the tools to update it straight from where you work. A system that keeps improving is what comes next.
The system that keeps improving
Context goes stale. Tables change, a metric gets a new rule, and people ask questions nobody wrote a definition for. The fix is a loop that runs on real use: agents use your data, the gaps are found, your data team answers into the context, and a check confirms the change helped.
- ObserveAgents use your data
- DiagnoseBonnard finds what’s wrong
- ImproveYour data team answers, into the context
- VerifyEvals check it helped
It starts with an event log. The activity record tracks every call an AI client makes through Bonnard: on your data sources and on the context itself. Each call is one row: who called, which tool, why, the SQL and how it ended.
activity.calls09:14:02Sam Patel chatgptexplore_schemaok09:14:09Sam Patel chatgptsql_queryundefined_column09:14:21Sam Patel chatgptsql_queryok- source_name
- sales
- intent
- Summing net revenue by region so the finance team can review the month.
- sql
- SELECT region, sum(total) - sum(refund_total) AS net_revenue FROM orders WHERE status = 'paid' GROUP BY region
- rows_returned
- 4
- found_nothing
- false
09:31:47Jordan Lee claudeexplore_schemafound nothing09:32:10Jordan Lee claudesql_queryok
Every gap shows up there as rows. A query that failed, a search that found nothing, a metric three agents calculated three ways. Your data team reads the record with their own AI, and the fix goes into the context every agent reads next.
Parts of the loop still need a person to start them. Here is where each step stands.
| Step | Today | In development |
|---|---|---|
| Record | Bonnard keeps every call, with its intent, its SQL and how it ended. | A tool for agents to flag what was missing or wrong. |
| Gaps | Your data team’s own AI reads the record and finds them. | A ranked list of gaps, ready when they open it. |
| Update | Their AI drafts the change to the context. A person publishes it, and any version can be rolled back. | Verified questions that run before a publish goes through. |
| Data fix | A gap in the data is reported to your data team. | A pull request on your dbt project. |
How we are getting there
A person publishes
The curator stops at a draft. A definition is ground truth for every agent that reads it, so a person who knows the business reads the change first. A flag from an agent is treated the same way. It can point a person at a problem, and it never writes to the context on its own.
Rules find the gaps, the model drafts
A failed query, a search that matched nothing and a session that took nine calls are all countable. You don’t need a model to find them, and a rule gives the same list every time. The model does the part that needs judgement: working out what the agent was trying to do, and drafting the fix.
Your own assistant curates first
The curating is done by your data team’s own AI client, such as Claude or ChatGPT, with their permissions, on the subscription they already pay for. A curator that runs in the background comes once the gaps outrun what a person can review.
One loop, end to end
Here is one change going round the loop.
- 01Eight people askTheir agents write three calculations of net revenue.
- 02Activity recordEach call is kept with its SQL.
- 03The data leadTheir AI checks the data and asks about refunds.
- 04ContextOne metric. Agents stop deriving their own.
Someone in finance asks their agent for net revenue by region. The agent searches the schema, finds the orders table, writes SQL and gets a number. Over a month, eight people ask a version of that question, and their agents write three different calculations. Each call is in the activity record with its SQL.
Last 30 days- Inconsistent definitionsQuestion
net revenue3 definitions, 8 people - Searches that found nothingData gap
"gift cards"6 people - Struggling work4 sessions, 9 calls eachContext gap
- ErrorsContext gap
undefined_column14 calls - Stale or misleading dataContext gap
orders_oldstopped in May
The data lead asks their own Claude what to fix on that data source. It reads the record, groups the three calculations and checks each one against the data. Then it asks the one thing the data cannot settle: do refunds come out of net revenue.
The lead answers. The assistant drafts a metric with its calculation and an instruction for agents. The lead reads the draft and publishes it. The next agent that is asked for net revenue gets the metric and stops deriving its own.
Skills and domain knowledge
The same loop will keep these current.
- Domain knowledge. Metrics and terms are the first of it: a calculation or a word, with what it means in your data.
- Skills. Verified questions are the first of them. They also catch what the activity record cannot: a query that ran and returned the wrong number. They are in development.
What comes next
Improvements to your dbt project
Some gaps are not context gaps. If people keep asking for a column that no model has, a better description does not help. The fix belongs in your dbt project.
We are building that in two parts:
- Import. Bonnard reads your dbt project, so the context starts from the models and descriptions you already have. It arrives one of two ways: you connect dbt Cloud, or you add a step to your CI/CD that sends the project on each change.
- Pull requests. When the activity record shows a gap in the modelling, the curator drafts the change and raises it as a pull request on GitHub. Your team reviews it there, like any other change.
- 01BuildYour dbt project builds the tables in your sources, as it does today.
- 02ReadBonnard reads your sources, read-only.
- 03ImportThe project’s descriptions and metrics go into the context. In development.
- 04GapsYour data team finds what is missing in the activity record.
- 05Pull requestA fix to the data goes back to the project on GitHub, and your team merges it. In development.
Suggestions without asking
Today the data lead has to ask their assistant what to fix. We want the loop to run on a schedule and leave a list of suggestions, each with the calls behind it, for a person to accept or reject.
Automated insights
The same setup can do more than fix context. An agent that runs on a schedule, with a prompt you wrote and the context it already has, can tell you when a metric moves. You decide what it looks for. We have not built this yet.
- 01You say what to watchA metric, and when to tell you.
- 02An agent runsOn a schedule you set.
- 03BonnardIt reads the context, then your sources.
- 04You hear backOnly when the metric moved.
Get the data right first
You don’t have to document everything first. As LangChain’s post puts it, “doing the work reveals what knowledge is missing”. Connect one database, let people ask their questions, and read the activity record after a week.
Get started
Start scaling accurate data today
Free for your first 3,000 calls. No seat limits.