Agentic OLAP Primitives That Surface Warehouse-Class Queries From a Live Supabase Schema
Pre-calculated Parquet datasets give agents governed analytics without a warehouse.

Analytics for Supabase teams should run on a governed analytical copy. Pre-calculated OLAP primitives derived from a live Supabase schema give dashboards and AI agents warehouse-class queries without a separate warehouse. Shared metric definitions and an MCP delivery layer make those queries consistent and permissioned while keeping analytical demand off production.
Why analytical queries don't belong on the Supabase instance serving your app
Supabase’s row-oriented Postgres database is tuned for fast lookups, inserts, and updates. Analytical queries ask it to scan and aggregate large sets of rows instead. These workloads compete for the same CPU and memory when they run on the primary instance. The way the system is built creates this conflict even when no query is unusually slow.
Other constraints make direct analytical access harder. Charting tools that struggle with binary-encoded document data, row-level security friction, and connection-pool limits complicate reporting against application tables. These are consequences of a transactional design. Columnar engines such as DuckDB store data by column and execute aggregations much faster. That difference in how the engines store data remains even after query tuning.
The available mitigations introduce costs of their own. The pg_duckdb extension executes analytical queries through DuckDB while leaving data in Postgres tables, but it is unavailable on managed Supabase. That restriction is reasonable for a managed multi-tenant platform. A read replica separates reads from the primary, but uses the same compute size and receives its own compute bill, without the plan credits that still offset primary compute. Its disk is slightly larger to accommodate WAL archives and uses the same per-GB rate, so a replica roughly doubles database spend in practice.
What OLAP primitives actually are and why pre-calculation is the right unit
An OLAP primitive is a modeled analytical dataset prepared before a consumer requests it. These primitives include pre-aggregated fact tables, dimension tables, and metric definitions stored in a format optimized for analytical reads. They replace repeated SQL against normalized application tables with a reusable result. The unit of work changes from an improvised query to a governed dataset.
Pre-calculation does the costly computation on a schedule in a separate process. Governed Parquet files hold the results, and DuckDB makes them queryable without production connection-pool pressure. Agents and people read a snapshot rather than opening a live analytical connection to the transactional database. This provides warehouse-class analytical access without a separate warehouse or ETL pipelines. It also embeds an agreed definition of metrics such as revenue or conversion before consumers begin asking questions.
Four layers give this architecture its structure. The Data Substrate contains verified, permissioned, refreshable data, while the Reasoning Layer supplies semantic schemas and metric definitions. The Delivery Layer exposes that governed material through an MCP endpoint. The Decision Layer connects an action to an owner and an outcome. Each has a separate responsibility, and allowing agents to query the substrate without the intervening governance removes the controls that make the result trustworthy.
How do you get analytics and dashboards from a live Supabase schema without ETL?
The existing Supabase schema supplies the starting point for the Data Substrate. Postgres already exposes the tables, types, relationships, and row-level security policies that describe the application’s data. The analytical layer reads that structure and models its contents into OLAP-shaped datasets stored as governed Parquet. No application schema changes or new warehouse infrastructure are required.
Modeling determines what that representation means. It distinguishes facts from dimensions, establishes the grain of each metric, and defines what counts as a complete record for an analytical question. Grain fixes the level at which a metric is calculated. Those decisions belong to a data engineer or a governed data layer, rather than to each dashboard author or agent at query time. Otherwise, every new consumer has to reconstruct the same business logic from application tables.
The resulting copy is derived from production but stored separately, with analytical results never written back to the application database. Building and refreshing it still requires reading the source. Once the copy is ready, though, agent queries add no read load to the transactional instance. For dashboards and BI tools, the decisive criterion is therefore access to governed analytical data.
Why the Reasoning Layer — metric definitions and semantic schemas — cannot be skipped
Faster access does not resolve disagreement about what a number means. One engineer calculates Q2 revenue with SUM(revenue), while another uses SUM(amount_captured). Both queries can read the right records and still give different answers. The discrepancy sits in the definition. Faster execution only returns the disagreement sooner.
An agent connected directly to those tables becomes another interpreter. It must choose which field represents revenue and which business logic applies, just as the engineers did. MCP can then distribute competing readings to more consumers simultaneously. A successful connection is therefore insufficient evidence that an analytical answer is fit for use.
The Reasoning Layer resolves this problem by establishing shared metric definitions before consumption. A pre-calculated dataset embeds the agreed calculation, so agents consuming that metric do not construct competing definitions through different SQL. BI surfaces and applications use the same governed meaning of conversion or active subscriber. Pre-calculation makes that definition part of the analytical asset itself.
Definitions also need ownership and validation context. The Reasoning Layer holds metric ownership, certification status, and sensitivity classification so agents can tell whether to trust an asset and whether it matches current business logic. Without that context, an agent can retrieve a value without knowing who is accountable for its meaning. Atlan’s governed MCP approach illustrates the distinction by exposing its data graph with metadata about owner, certification status, and sensitivity classification. The agent receives context as well as values.
How the MCP Delivery Layer works and what changed in the July 2026 specification revision
MCP gives agents a common way to discover and consume the governed substrate. With a common protocol in place once per application and once per source, participants no longer have to maintain N×M application-to-source connectors. One server exposes the analytical assets, and compliant agent clients consume them. The server fronts governed Parquet. Dataset discovery and retrieval therefore do not require agents to access the production database.
The protocol exposes three complementary primitives. Tools do things such as run a query or trigger a report, while Resources give context such as schemas, governed datasets, and metric definitions. Prompts supply reusable templates for repeatable analytical workflows. Together, they support both retrieval and interpretation of analytical data. Agents discover available datasets and request them by name through Resources and Tools, within the governed service.
MCP’s maintainers finalized a major specification revision on July 28, 2026, removing protocol-level session tracking. The protocol is now stateless, with protocol version, client identity, and capabilities included in a _meta field on each request. A request can reach any instance behind a plain round-robin load balancer. For a shared analytical service handling concurrent agents, this removes session affinity as a scaling requirement and makes horizontal scaling more straightforward.
The security failure modes that appear when agents touch databases without a governed layer
The central security failure is often access design. A broad credential created to unblock a pilot can become the agent’s permanent standing access. Atlan’s AI agent access guide describes this credential-first pattern as a common way things go wrong. The “God User” anti-pattern gives agents more authority than their tasks require. Because an agent can issue thousands of queries in the time a person takes to write one, an overbroad permission has a much larger potential blast radius.
Supabase adds concrete workload and permission boundaries to this concern. Direct agent queries can exhaust the connection pool or bypass row-level security when their access permits it. These are not problems that better model behavior alone resolves. The Open Agent Passport paper characterizes the underlying gap as an authorization failure. Policy must be enforced before a tool call executes.
A proxy can introduce a related “confused deputy” risk. An MCP server operating under a trusted identity can be manipulated into performing unauthorized actions. The NSA’s May 2026 report stated that MCP’s rapid proliferation had outpaced development of its security model. The governed layer must enforce permissions between the agent and the data.
Tools should have a narrow purpose, with hard-coded queries and parameter validation in place of generic database access. A centralized layer checks permissions, logs access, and routes analytical requests to the isolated copy. Atlan’s approach checks who is making the request against policy and returns only the assets, rows, and columns they are allowed to access. Open Agent Passport adds synchronous pre-action authorization against a declarative policy. That control complements the governed data layer.
Why most Supabase teams cannot staff the data function these patterns require — and what that means for founders
This architecture needs work that many Supabase teams have no dedicated specialist to do. The typical team is a small company, often a solo founder or a few people without a data engineer. The team has to build analytical tables, keep definitions and permissions up to date, manage refreshes, and track how the system is running. Those responsibilities remain part of running dependable analytics even when headcount is small.
Most small teams do not monitor AI workloads or maintain formal prompt management, and a substantial fraction lack an evaluation process. A team with an AI-native product may still lack people and processes to keep it running. Giving agents direct database access can add more work for a team that already lacks the means to oversee it. A connector supplies access, but does not supply that missing function.
For founders in this position, the practical requirement is a managed data capability. It must offer pre-modeled OLAP primitives, shared metric definitions, agent-safe MCP access, and a way to see both database and business metrics. This role requires a full digital data team delivered as a managed capability, with a scope broader than a BI tool or warehouse alone. The scope is the governed substrate and its operation, without a dedicated hire.
Supabase can support reporting on active subscriptions, completed actions, and retention cohorts, but should not automatically replace specialized product analytics or marketing attribution tools. The discipline is to define one source of truth for business metrics. From there, unnecessary PII can be kept out of external platforms without forcing every analytical task into the same tool.
Observability as the operational requirement that ties the whole architecture together
The governed substrate also supplies the context needed to operate a growing application. When database metrics remain in a separate silo, teams cannot readily connect API latency spikes with connection-pool saturation or compare query performance with deployment events. Business reports and views of how the system is running end up separate. With observability data in the analytical layer, teams can look at those relationships together. The same architecture that serves agents can help teams catch problems before they cause outages.
Supabase shipped “Observability on Auto-Pilot” in September 2026 around the premise that teams often do not know what to watch until something breaks. Proactive anomaly detection addresses that operational gap. Pebblely reached a million users in seven months, Mobbin migrated two hundred thousand users off Firebase, and Humata scaled to millions of users while cutting vector database cost. The platform can support growth, but observability needs to be built in before it reaches a million users.
In the complete architecture, observability data joins pre-calculated OLAP primitives and shared metric definitions in one governed substrate. Humans, BI surfaces, and agents consume the same numbers, while metrics reach inboxes, Slack, and dashboards instead of depending on someone remembering to check. The Decision Layer connects those findings to action with an owner and an outcome. Analytical consumption stays outside the production connection pool, without a separate warehouse or ETL pipeline to maintain. The application database serves the application, while the governed copy supports the queries and operational decisions that growth demands.


