Diagram: the AI assistant reaches ClickHouse, GA4 and clickstream only through a data gateway

The brief

A group of brands kept its data in ClickHouse, plus web analytics in GA4 and clickstream. Every question, from “how many first deposits did we get last week?” upwards, went to an analyst and waited in a queue. The client wanted managers to ask an AI assistant directly. The data, however, contained names, phone numbers and e-mails, and one brand's team must never see another brand's figures.

The solution

We connected an AI assistant to the data through a gateway built on the Model Context Protocol (MCP). The assistant never talks to the database directly. The gateway decides what it may read, hides personal data and stops queries that are too heavy, while agreed metric definitions keep its answers in line with the reports.

How a question becomes an answer

A manager types a question in the chat. The assistant writes a query, sends it through the gateway and turns the result into an answer or a chart. Regular reports run on a schedule the same way.

 

Diagram: the AI assistant reaches ClickHouse, GA4 and clickstream only through a data gateway

 

 

 

How it works technically

The safety rules live in the gateway, not in the AI's instructions.

 

Read-only, and only your own brand

Each team works in its own space. The gateway allows reading only from that space's databases. Writing, temporary tables and loading data from outside sources are blocked.

 

Personal data stays hidden

Columns with names, phone numbers, e-mails and logins are closed. The assistant can count unique users without ever seeing their IDs.

 

Heavy queries are stopped

Each query has limits of 90 seconds and 1,001 rows and stops if the user disconnects. The gateway waits for the full result, so a cut-off answer never looks complete.

 

One definition per metric

For every brand we agreed which table and field define a first deposit, a successful withdrawal or an active player. The assistant gets these definitions, so its numbers match the BI reports.

 

 

 

Results

 

Answers without a queue

Managers get answers to routine questions on their own.

 

Analysts on harder work

The analytics team spends less time on standard exports.

 

No personal data in AI

Names, phones and e-mails never reach the model.

 

Brands kept apart

Each team sees only its own data.

 

Numbers people trust

The chat, scheduled reports and BI use the same metric definitions.

 

 

 

FAQ

 

Is it safe to give AI access to a database?

Yes, if access goes through a gateway with read-only rights, hidden personal data and query limits. The model never connects to the database directly.

 

What is MCP?

The Model Context Protocol is an open standard for connecting an AI assistant to your data and tools. Your MCP server decides exactly what the assistant can do.

 

Why does AI sometimes give different numbers than a report?

Usually because a metric is defined differently in different places. That is why we fix the definitions for each brand before launch.

 

 

 

  1. Claude
  2. Model Context Protocol
  3. ClickHouse
  4. Google Analytics 4

Beginning cooperation, we share the values of our clients and get insight into their worldview to move their genuine image to digital and fulfill all business tasks.

We're hiring

Addicted to fresh ideas, want to grow professionally, eager to explore what's possible.

Think that sound like you?
Discover career opportunities at NodeArt.

Discover positions