Advanced · 15 min read· Updated Aug 2026

Building an AI agent on top of your data

From a ready workspace to an agent that answers business questions in natural language. What needs to be in place and how to build it.

What you will take away
  • Understand the ingredients of a good data agent
  • Build the path from the data to the answer
  • Know what makes the agent get it right or wrong

The promise is simple to state and powerful to experience: a business person asks "which channel brought in the most revenue this month" and gets the answer, with the number and context, without writing a line of SQL and without waiting in the analyst's queue. That is an agent on top of your data. It is not magic, it is architecture: when the right pieces are in place, the agent reads your data, understands the question and answers. This guide shows what those pieces are and how they fit together.

The four ingredients

A trustworthy agent comes from combining four things. And one of them matters more than the others: context. Without context the agent guesses what the data means and gets it wrong; with good context it understands what each column means and gets it right, even when reading simpler tables. The other three provide the support: accessible data to read, MCP to reach it and an AI client to talk to.

1 · Context
Semantic Layer
The ingredient that matters most
  • Context documents per table
  • Descriptions of columns and rules
  • Business definitions (what “revenue” means)
  • Turns data into knowledge
+
2 · MCP
The bridge
How the agent reaches the data
  • Connects the agent to the workspace
  • Exposes tables and context
  • Lets the agent query safely
  • One protocol, many clients
+
3 · Gold
Optional reinforcement
Helps, but is not required
  • Ready-made tables, preferably wide
  • Business rule already applied
  • Clear names, a source of truth
  • Fewer joins, less chance of error

The fourth ingredient is the AI client (for example Claude), the interface where the person asks the question in plain language. It talks to the MCP, which in turn reads your data backed by the Semantic Layer. Notice the role of each one: the Semantic Layer is the manual that explains the data, the MCP is the plumbing and the AI client is the tap. A well-modeled Gold layer helps and tends to improve the result, but it is not a prerequisite. Many people build agents that query the rawest data directly and it works well, as long as the context is there to explain what each thing means.

The path from question to answer

Every natural-language question follows the same path. Here is the whole flow at once.

QUESTION natural language AGENT AI Client via MCP GOLD LAYER ready-made tables wide, reliable SEMANTIC LAYER context documents, rules and definitions ANSWER "Instagram, R$ 42K"
The question goes in as plain language, the agent reads Gold and the Semantic Layer via MCP, and the answer comes back ready

In text, the route is: a natural-language question reaches the agent (via MCP), which reads your data backed by the Semantic Layer to understand which tables to use and what each field means, builds the query, and returns the answer. A well-modeled Gold table makes this step easier, but what actually keeps it from guessing is the context: instead of guessing that "revenue" is the vl column, it reads in the context document that revenue is valor_liquido summed after approval. Without this context, not even cleaned-up tables can save the answer.

What makes it right, what makes it wrong

The difference between an agent you trust and one that spits out wrong numbers lies almost entirely in the context it receives, more than in the layer where the data lives. The same principle applies to both sides below.

Right · data with good context
A table with reasonably clear names, plus a context document that defines "revenue", "channel" and the table's grain. The agent knows where to look, what to sum and how to filter. The answer matches the dashboard. If that table is also a wide Gold table, even better, but what makes the numbers add up is the context.
Wrong · data without context
A table with columns vl, st, dt and no description. The agent guesses the meaning, picks the wrong column and hallucinates a convincing but false number. Note that not even a well-structured Gold table solves this on its own if no one has explained what the fields mean.

This contrast is easier to see when the Gold layer and the context are evaluated together. The context document guide teaches you how to write the context that makes the agent get it right.

↗ Guide: Context document
Tip

Start small. Pick two or three tables that answer the most frequent questions and describe them very well in the Semantic Layer, instead of exposing the whole workspace poorly documented. You don't need to wait for a perfect Gold layer to start: an agent with a few well-described tables gets far more right than one with fifty tables and no context, even if those few are still fairly raw. You refine into Gold and expand later, as confidence grows.

Questions a good agent answers

When the four ingredients are in place, questions like these come back with an answer and a number, right in the chat, without going through the analyst:

Notice that these are all business questions, not technical ones. The person does not need to know the table name or the right column. That knowledge lives in the Semantic Layer, and it is the agent that uses it.

Use casegrowth

A growth team was always waiting for the analyst to run the same queries every Monday: revenue by channel, new customers, average order value. Once Gold got a consolidated wide table and a good context document, the team started asking the agent directly in chat. Routine answers left the analyst's queue, freeing the analyst for deeper investigations, and growth stopped making decisions in the dark while waiting for the weekly report.

Try it in Nekt
Pick the business question you get asked most often every week. Identify which table answers it, even if it is not a Gold table yet, and check whether it has a clear context document. If it doesn't, that is the first step before plugging in the agent, and it is more important than refining the layer.
Open in Nekt
↗ Go deeper in the docs: MCP and AI consumption in Nekt
See it in practice

Use cases that apply what this guide explains.

Continue
Trail: Operations & trust
→