To build dbt models you can trust, an AI assistant like Claude needs four kinds of context: what’s specific about your business, what your raw data actually looks like, the questions the business needs answered, and tooling that connects it to your dbt project and warehouse. Meltano Cloud provides all four in one version-controlled workspace.
Your data engineers already know how to write dbt models, and AI can help them write those models much faster. But does AI always have the right context to get a model right the first time? How much back-and-forth or manual fixing does it take?
Think about a new engineer on their first day. They can write SQL, they know dbt, but they don’t have the context to build useful models immediately. It’s going to take some learning as well as the right tooling.
AI is the same. Give it a precise, well-scoped prompt and it will usually get it right. But ask it to build an entire analytics model without context, and it has to start guessing.
So we asked ourselves: what would an AI need to know to build a model we’d actually trust? We landed on four things. With the aid of Meltano Cloud MCP, they give the assistant all four in one place.
What context does AI need to build a dbt model?
- Organisational context: what’s specific about your business, and what that means for your data. Industry is the obvious starting point, but it also covers things like company size, how your teams are set up and the terms they use.
- Raw data context: what your data actually looks like once it lands, not just the schema. Think table sizes, gaps and how tables relate.
- Business questions: what the business needs to find out. Example questions tell the AI what it’s building towards.
- Tooling: how the AI reads your project and works with your warehouse. Whether your team is building with Claude Code, Cursor or Codex, your finance team is asking questions about customer retention, or your Meltano Cloud agents are proposing improvements, they should all have access to the same context.
Each one helps on its own. With all four in place, the assistant stops guessing and starts building models you’d actually ship.
Pillar 1: Why does AI need organisational context?
Why it matters: A “transactions” table can mean very different things to a bank, a retailer and a logistics company. So industry-level context is important.
But industry is only part of it. A 20-person startup and a 5,000-person enterprise in the same sector track different numbers, name them differently and answer to different people.
Organisational context is everything that makes your business yours, and without it an AI will be guessing on the processes behind stakeholder questions, or what your team actually calls a metric.
How Meltano Cloud provides it: When you create a workspace, you are asked to pick an industry. Meltano Cloud then adds a context file bundle for that industry to your Git repo, covering its core entities, relationships and probable metrics.
Once added, your team can personalise and contextualise these datasets to tailor them to your business.
Over time, this will grow to cover more of what makes your business different, perhaps including its size, headcount, how you describe your business in your own words, and any other specifics your models need to reflect.
So the models the assistant builds follow the way your industry reports, use the names your stakeholders already know, and test for the problems that actually come up. The bundle lives in your repo, so comes with all the expected auditability and version control.
Pillar 2: Why does AI need to see your raw data?
Why it matters: You’re likely pulling data from many sources. With the organisational context alone, your assistant clearly won’t be able to produce meaningful models. Before your data lands we can glean some information, including schema/streams/fields, but there’s only so much we can do with that. Once landed, the raw data gives the clearest picture of what we’re working with. Table sizes, meaningful relationships, and where the gaps are. This is fundamental to connecting your organisational context with the questions you’re asking.
How Meltano Cloud provides it: Once data has landed, the get_data_context MCP tool inspects your warehouse statistics and ingested data directly. Your dbt sources, based on the detected streams in the discovery phase of ingestion creation, are also stored. All of this is packaged up and provided as datasets, to sit alongside the organisational context.
Pillar 3: Why should you start with business questions?
Why it matters: Without the questions that you’re ultimately hoping to answer by ingesting data in the first place, you’re always going to struggle to build an accurate model. If we can frame the right questions in a prompt to an assistant, we’re removing a huge amount of guesswork. “Model the transactions table” gives an assistant very little to go on. “What is the monthly revenue by product line?” is massively helpful and guides the subsequent models with the mindset of the stakeholder.
You can generate models without questions, but if you don’t know what the business wants to find out, how do you know which insights matter most? You risk tidy tables nobody asked for, a revenue metric defined differently from how finance counts it, and tests guarding columns no one uses.
How Meltano Cloud uses it: This firmly sits within the prompt. You describe the insights you need in plain language. The assistant works backwards from that question, reaches for the context, and builds.
As with all of the context, questions are saved as datasets in your repo, alongside the queries that answer them. Your models, your questions and your context all live in one version-controlled place.
Pillar 4: How does Claude connect to your dbt project and warehouse?
Why it matters: Your organisational context lives in the repository. The raw data lives in the warehouse. Your questions are provided to the assistant. Without appropriate tooling, it’s tricky to tie it all together.
Not every team works the same way either. Some bring an existing dbt project or data warehouse, while others start a new project from scratch. The work itself varies too: engineers building models with a coding agent, business users asking questions through conversational analytics, and autonomous agents proposing improvements in the background. Good tooling has to support all of these without forcing anyone to change how they work.
How Meltano Cloud provides it: Two pieces do the work. Instructions, in the form of AGENTS.md and skills in your repo, tell the assistant how your project works and walk it through common tasks. Meltano Cloud MCP gives it a simple, secure path into your workspace and warehouse context.
Want to see it build models from your own data? Try Meltano, no credit card required. Connect a source, point Claude at your warehouse and ask it the questions your business cares about. You’ll have tested dbt models in your repo the same day.
How do the four kinds of context fit together?
Here’s all of it in one image. On the left are the first three pillars: your organisational context, your raw data context and the questions you want answered, all kept in your Meltano workspace. In the middle is the fourth, tooling. The assistant reads its instructions, uses Meltano Cloud MCP to look at your warehouse, and writes the dbt models and tests. On the right is what you end up with: tested models running in Meltano Cloud, and dashboards people can open.

How does Claude build a dbt model from a single prompt?

Here’s what happens, step by step, when you connect a data source and ask an assistant for dbt models:
- It reads your repository. First it picks up its instructions (AGENTS.md and skills), your industry bundle and the raw data context.
- It looks at your real data. Through Meltano Cloud MCP, it checks what’s in your warehouse and runs read-only queries to see what the tables actually hold.
- It writes the dbt project. It adds the models and tests to your repository, next to the context it used.
- It ships the change. It commits and pushes to Git, then publishes the update to your Meltano Cloud workspace.
- It runs and checks the pipeline. Once you give the go-ahead, it runs the pipeline and reads the logs to confirm the models built and the tests passed. After that, the models run on their own whenever new data lands.
If a dbt run fails, the assistant reads the logs, works out what went wrong and suggests a fix, so you’re not left digging through errors yourself.
Why run your dbt models in Meltano Cloud?
It’s not an explicit requirement to run your models in Meltano Cloud in order to build them with this agentic workflow. But if you do, there are plenty of benefits:
- No separate dbt hosting platform. Ingestion and transformation live in one place, so there’s no second subscription to any tool.
- Models that run on fresh data. Trigger dbt the moment ingestion finishes, with retries and timeouts built in.
- Failure alerts. Failed runs trigger an automatic diagnosis with deep links to the remediation.
- Observability. You can run Elementary inside your Meltano Cloud project for deeper data validation, all version-controlled alongside your models.
How do you get started? Five steps
- Sign up. Try Meltano, no credit card required.
- Create a workspace. Pick your industry, connect to your warehouse, add your data sources. Meltano Cloud sets up a Git repo with dbt plugins pre-installed.
- Ingest your data. Set up a schedule, or trigger manually.
- Connect Meltano Cloud MCP. Follow the setup guide to add the Meltano Cloud MCP to Claude, so it can see your workspace and warehouse context.
- Get building. Ask your coding agent something like “Build dbt models, marts and tests to answer the following questions…”. It now has all the context and access to the code it needs, so it can build the marts, models and tests, commit them to your repository, and run everything in your workspace, all from a single prompt.
Want to see what Claude builds when it has the full picture? Try Meltano, no credit card required, and run your first prompt against your own data.
Prefer a walkthrough? Book a call and we’ll build your first models with you.
Frequently asked questions
Can Claude build dbt models?
Yes. Claude Code can write dbt models, marts and tests from a plain-language prompt. The quality depends on context. With Meltano Cloud MCP connected, Claude can see your industry context, your raw data and the questions you’re answering, so it builds models that fit your business instead of guessing.
Does the AI get write access to my warehouse?
No. The assistant explores your warehouse with read-only queries through Meltano Cloud MCP. Every model and test it writes goes into your Git repository as code you can review. Models only build in your warehouse when you give the go-ahead to run the pipeline.
Do I need to run my dbt models in Meltano Cloud?
No. You can build models with this workflow and run them wherever you run dbt today. Running them in Meltano Cloud means ingestion and transformation live in one place, models trigger as soon as fresh data lands, and failed runs come with an automatic diagnosis.
Does it work with Cursor or Codex as well as Claude?
Yes. The context lives in your repository as files, including AGENTS.md and skills, so any coding agent that reads your repo can use it. Meltano Cloud MCP works with any assistant that supports MCP. Our setup guide covers Claude.
Can I bring an existing dbt project?
Yes. You can bring an existing dbt project or warehouse into Meltano Cloud, and the assistant builds on your current models instead of starting from scratch. Your organisational context, raw data context and business questions sit alongside your existing code in the same repo.
