Chat with your data, without handing it over
How a canister on an OpenCloud cloud engine stays the source of truth while ChatGPT or Claude asks the questions.
Most “chat with your data” products start the same way: you give the AI your data. You upload a CSV, sync a folder into a vector index, or paste a database connection string into a third-party dashboard. From then on there are two copies of your data, yours and the one the model sees, and you have to trust that they stay in step and that the second copy is looked after as carefully as the first.
Hugo ask is a small, non-commercial demo for learning that does it the other way round. The data lives in exactly one place: a Motoko canister running on an OpenCloud cloud engine. ChatGPT and Claude never receive the dataset. Either one connects through the ICP MCP connector, signs in with the user’s Internet Identity, and calls a few read-only query methods. The canister answers from its own rows, and the assistant turns those answers into language.
The model does the talking. The canister does the counting, and decides who may ask.
What the demo contains
The app is two canisters on an OpenCloud engine subnet.
The backend is written in Motoko. It holds a 500-row snapshot of the Tobi-Bueck/customer-support-tickets dataset, published by Tobi Bück under CC BY-NC 4.0. The full dataset has 61,765 tickets, far too many to compile into a canister, so the snapshot is stratified: English and German tickets both appear, along with every priority from very_low to critical. Each ticket has a subject, body, reply, type, queue, priority, language and up to three tags. The rows are compiled directly into the canister, so answering a question never involves a call to Hugging Face or any other outside service.
The frontend is a static Astro site served from an asset canister. It explains how the system works, shows the frontend canister id, and walks a user through connecting the ICP MCP connector in ChatGPT or Claude. It also has an Access page where people sign in and request access and where the admin approves them. The frontend publishes one other important file: /.well-known/ic-architecture, a small JSON manifest that lists the canisters belonging to this app.
There is no chat box on the website. You ask in ChatGPT or Claude.
How a question travels
sequenceDiagram
autonumber
actor User
participant Assistant as ChatGPT or Claude
participant MCP as ICP MCP connector
participant FE as Frontend canister
participant BE as Backend canister
User->>Assistant: frontend canister id, then a question
Assistant->>MCP: tool call (signed in with Internet Identity)
MCP->>FE: GET /.well-known/ic-architecture
FE-->>MCP: declared canisters: frontend, backend
MCP->>BE: read Candid interface
MCP->>BE: getApiDoc(), schema()
BE-->>MCP: API guide + column catalogue
Assistant->>MCP: execute({ filters, groupBy, count })
MCP->>BE: execute(json) as the user's principal
BE->>BE: run the query
BE-->>MCP: rows of named cells
MCP-->>Assistant: result
Assistant-->>User: answer in plain language
First, the user adds the Internet Computer (ICP) plugin by DFINITY in ChatGPT, or adds the same connector in Claude at https://mcp.internetcomputer.org/mcp, and signs in with Internet Identity. The “Questions only” permission level is enough, because every data method is a query that cannot change state.
Next, the user pastes the frontend canister id into the chat. The Connect page shows that id. The connector opens the app from it and fetches the manifest. This is the trust boundary on the app’s side: the connector only calls canisters that the manifest declares.
The connector then reads the backend’s Candid interface, which is embedded in the Wasm module, and the assistant calls getApiDoc() and schema(). The API guide explains how to write a query. The schema lists every column, its type and what it means. With those two documents, the assistant can translate a question such as “How many high-priority tickets are in each queue? Then show me five German ones, subject and queue only” into one or two execute calls.
Finally, the canister on the OpenCloud engine runs the query against its own data and returns a page of rows, each a list of named cells. The assistant reads them and writes the answer.
A small, honest query language
execute takes a single JSON document. It isn’t SQL, and that’s intentional. A small language is easy for a model to learn from one page of documentation, and easy for a canister to run safely.
It supports:
- Filters:
eq,neq,gt,gte,lt,lte, andcontainsfor text columns - Shaping:
selecta list of columns,orderBywithdesc,limitandoffset - Aggregates:
count,sum,avg,minandmax, with an optionalgroupByon one column
Results come back in pages with a hard cap. When the long text fields (body or answer) are selected, a page holds at most 20 rows; otherwise it holds 50. A ticket body averages around 420 characters, so even a full-text page stays far below the Internet Computer’s 2 MB limit on query responses. A response includes hasMore, so the model knows when to fetch the next page.
Mistakes don’t crash anything. An unknown column, an unknown operator or a limit above the cap returns an error message, which the model can read and correct.
The aggregates are the point of the design. When the assistant says “there are 23 high-priority tickets in Technical Support,” that number was computed by the canister over the real rows. It wasn’t estimated by a model reading a sample of text, and it can’t come from a stale copy, because there is no copy.
Identity is the access control
Every call that reaches the backend through the connector is signed with the user’s Internet Identity. The canister therefore knows the caller’s principal on every request, without passwords, API keys or tokens pasted into a prompt.
Access control is a short list of principals kept in the backend. requestAccess never grants admin.
claimAdmin(): a canister controller takes the admin role. Any previous admin stays on the list as an enabled member. This is the recovery path if the admin’s Internet Identity is lost.requestAccess(): a signed-in caller is recorded as pending. Asking again does not change a decision.setAccess(principal, enabled),removeAccess(principal)andlistAccess(): only the admin can call these, from the Access page. Enabling turns a pending or disabled principal on. Removing deletes a non-admin record and frees the slot. The admin cannot disable or remove itself, and the anonymous principal cannot be enabled or removed.getApiDoc(),schema()andexecute(): these answer only when the caller’s principal is enabled. Everyone else gets “Access denied. Ask the admin to enable your Internet Identity.”- Anonymous callers of the update methods are rejected in the canister’s
inspecthook, before their arguments are even decoded.
The website signs users in with a fixed derivation origin. As a result, the principal a user sees on the Access page is the same principal the connector presents when it calls the backend on that user’s behalf. So when the admin approves someone on the website, that person’s ChatGPT or Claude session can read the data, and disabling or removing them cuts it off again. No secret is ever shared with the model.
Why a cloud engine
OpenCloud cloud engines run canisters with zero cycles. The engine operator pays at the engine level, so the app itself doesn’t manage a token balance or top-ups. The design respects that model:
- No call attaches cycles, and the backend makes no calls to other subnets. The data and the logic sit in the same canister.
- The canister runs no inference. Engines do offer an inference endpoint through the engine operator, but a public
chatmethod would let anyone who can call it spend the engine’s inference credit. Instead the user brings their own model, here ChatGPT or Claude, and the canister only serves data. - The Candid interface is kept in the Wasm metadata, so the connector can discover the API without any extra configuration.
This divides the work cleanly. The engine provides cheap, always-on, tamper-resistant compute and storage for the data. The assistant provides language understanding. The user’s Internet Identity links the two.
What this demonstrates
- One copy of the truth. The dataset lives in a canister on an OpenCloud cloud engine, and that canister is the source of truth. The AI queries it but never holds it.
- Exact answers. Counts, filters and groupings are computed deterministically by the canister, and the model only puts them into words.
- One identity for people and their assistants. Internet Identity is both the login for the website and the credential behind the assistant’s calls, and one admin decides who gets in.
- Discovery by manifest. A single JSON file plus a self-describing API is everything an assistant needs to start using an app, once it has been given the frontend canister id. No custom plugin for this app, and no hosted middleware.
Limits, stated plainly
- The data is a fixed snapshot. Changing it means a new build and deploy, and on purpose there is no method that uploads or replaces rows.
- There is one read-only table and a small query language, not a general database.
- The dataset’s licence is non-commercial, so this is a demo for learning. A product would need data it is allowed to use commercially.
- Publishing the
ic-architecturemanifest counts as accepting the ICP MCP App Operator Terms. Only the person operating the app can make that decision.
Try it
-
In ChatGPT, add the Internet Computer (ICP) plugin. In Claude, add the connector at
https://mcp.internetcomputer.org/mcp. Sign in with Internet Identity and choose Questions only. -
Open the Hugo ask site, sign in on the Access page with that same Internet Identity, and request access. Wait for the admin to enable your principal.
-
On Connect, copy the frontend canister id (
dud23-qyaaa-aaac3-qaaba-cai) and paste it into the chat with a question:Frontend canister id: dud23-qyaaa-aaac3-qaaba-cai
How many high-priority tickets are in each queue? Then show me five German ones, subject and queue only.
The assistant will read the API guide, look up the schema, query the canister and answer. Every number in its reply comes from the canister on the OpenCloud engine.
Dataset: Tobi-Bueck/customer-support-tickets by Tobi Bück, CC BY-NC 4.0. A 500-row stratified sample is used here as a non-commercial demo for learning.