No large enterprise keeps its data in one place. Policy and claims sit in a lakehouse, finance in a cloud warehouse, an operational system in Postgres, a decade of history in SQL Server. An agent that needs context does not care where a number lives. It needs one place to ask, and one set of rules about what it may see.
InsightCompose is that place. Contexts from Databricks, Snowflake, Postgres, SQL Server and other sources sit in one catalog, with one contract shape, one service path and one audit. Each context names the source it reads; each source keeps its data where it is. This post explains how that works and what stays the same whichever warehouse a context reads.
Why not copy everything into one warehouse first?
Consolidation projects are the classic answer, and they are slow, expensive and never finished. By the time the last source is migrated, a new one has appeared. Copies also create a second problem: two places where a number can be computed, and a freshness gap between them that nobody declares.
A context layer takes the opposite approach. The data stays in the system that owns it. The context layer holds the definitions (the SQL, the parameters, the scope, the masking, the freshness) and runs them in place, read-only, at the moment they are asked or on the cache schedule the owner chose. Nothing is copied out to answer a question.
Connections: one layer, every source
Sources are registered once in the shared connections layer that all Insight products use. A connection holds the host, the catalog or database, the schema and the credentials, sealed at rest and never returned to a browser. Databricks connects with a service principal; other databases connect through the platform's adapters, read-only. The same connection serves discovery, indexing, contexts and dashboards, so there is one place to rotate a secret and one place to revoke access.
Each connection becomes an executor, and a context names the executor it runs on with its source field. A product may register several. An insurance deployment might bind lakehouse to a Databricks SQL warehouse holding the gold and platinum layers, finance to Snowflake, and ops to a Postgres replica of the policy admin system.
{
"key": "uw.book.kpis",
"source": "lakehouse",
"sql": "SELECT underwriter, line, written_premium, loss_ratio_12m FROM platinum.agg_policy_kpi WHERE period = :period",
"params": [{ "name": "period", "type": "string", "required": true }],
"row_scope": { "owner_column": "underwriter" },
"freshness": { "cadence": "nightly", "sla_minutes": 1440 }
}
The same guard on every source
A context reading SQL Server must be exactly as safe as one reading Databricks. The protections do not depend on the warehouse; they are applied by the executor around every statement:
- Scope first. The caller's scope is wrapped around the template, taken from the caller the product resolved and never from the request.
- Values are never spliced. On databases with a native driver they are bound parameters, with an expanding list for multi-value filters. On warehouses whose connectors cannot bind a list, values are rendered as literals built for that dialect, because quoting rules differ between engines and doubling quotes alone is not safe everywhere.
- One read-only statement. The SQL engine's execution policy checks the finished statement in the source's own dialect: exactly one read-only query, tables inside the allowed catalog and schemas, no file, sleep or settings functions. Writes and DDL are refused before anything reaches the database.
- A clock and a cap. A statement timeout is set in the source (a read-only transaction on Postgres, a session timeout on a warehouse) and at most the contract's row cap comes back, with one extra row read to say whether the answer was cut.
Serverless warehouses that are asleep. A stopped serverless warehouse can take tens of seconds to start. Rather than hold an agent's call open, the executor answers with a clear warming-up response and a retry hint while the start carries on, so the next try finds the warehouse running.
Dialects are the platform's problem, not the author's
Each source speaks its own SQL. Date functions, identifier quoting, limits and string escapes all differ. Authors write contexts in the dialect of the source they name, and the visual query builder writes each source's own SQL when they would rather not. The guard parses and checks the statement in that dialect, so a construct that is harmless in one engine and dangerous in another is judged by the right rules.
Definitions aligned per source
The hard part of many sources is rarely connectivity. It is meaning. Premium is a column called gwp_amt in one system and written_premium in another. InsightCompose indexes each source: it profiles tables, learns joins and aligns your glossary and agreed metrics to that source's columns, by name, by data and by meaning, confirmed by a curator. A metric such as retention carries its expression, grain and default filters per source, so a context in Snowflake and one in Databricks that both say retention mean the same thing, or say clearly that they do not.
| Source | Typical role in an enterprise | What a context there often serves |
|---|---|---|
| Databricks | Lakehouse with gold and pre-computed KPI tables | Book-of-business 360, loss triangles, peer benchmarks |
| Snowflake | Finance and shared analytics warehouse | Earned premium, commissions, budget versus actual |
| Postgres | Operational replicas and application databases | Open submissions, today's queue, recent activity |
| SQL Server | Long-running core and departmental systems | Policy history, billing status, legacy reference data |
What consumers see: no difference at all
To an agent calling a tool over MCP, or an application calling REST, a context reading SQL Server and one reading Databricks look identical: the same parameter contract, the same typed columns with labels and units, the same as_of and freshness, the same masking. The source is visible in the catalog for people who need to know, and invisible to the consumer, which is how it should be. Moving a context from one source to another, after a migration for example, is a new version of the same key, reviewed like any other change.
Where to start
- Connect the sources your agents already need, not every source you own. Two or three is typical for a first set of contexts.
- Grant schemas narrowly. The allowed schemas on each connection are the outer wall; contexts can never read past them.
- Prefer the curated layer. Point contexts at gold or KPI tables where they exist, and keep live operational sources for the questions that need minutes-fresh answers.
- Align the glossary per source before publishing contexts that share a business term.
See how contexts are defined on the Contexts page, how freshness differs per source in real-time context, and the full guard on the governance and security page.
Where people stay in charge
- Your DBAs grant the access. Connections use credentials and schemas your team issues; InsightCompose cannot read past them.
- Data owners keep the data. Rows stay in the source system and are read in place, under that system's own controls.
- Curators confirm meaning. Term-to-column alignment is a suggestion until a person confirms it.
- Owners choose the source per context. Moving a context between warehouses is a reviewed version, not a silent switch.