---
title: "Rig Context Layer — a self-maintaining context database for your data"
description: "The layer between your warehouse and every AI agent. Maps tables, joins, metrics, and business logic into something models can reason over accurately — built automatically, kept current as your schema drifts."
canonical: "https://rig.so/context-layer"
format: markdown
---

# The data context for your AI tools

Auto-generated from your warehouse, governed by your team, queried accurately by any user.

[Try Rig](https://app.rig.so/signup)[Book a demo](https://rig.so/book-demo)[See comparisons](https://rig.so/compare)

Rig Context Layer

## You can't let AI agents loose on the database

The same question, asked of the same warehouse, gives two very different answers depending on what the AI actually knows.

Sales Ops · 9:42 AM

What's our net revenue retention for enterprise accounts last quarter?

Without Rig

Used warehouse

Snowexecute\_query14 tables, 2.1 GB

NRR last quarter was roughly **147%** based on `fct_revenue`.

What's missing

No flag that this used gross revenue, wrong grain, ignored row-level access, or scanned tables the user shouldn't see.

With Rig

Used Rig integration

Rigsearch\_metricsnet\_revenue\_retention

Rigget\_metric\_detailscustomer × quarter

Rigexecute\_sql1 row returned

NRR for enterprise in 2025 Q4 was 112%.

How it resolved

Resolves to your certified `net_revenue_retention` metric, filtered to `segment = 'enterprise'` for `period = '2025Q4'`. Rows scoped per RBAC.

The warehouse didn't change. The context did.

## But semantic metrics only cover 10% of your data

The rest is tribal knowledge: how your team actually defines "active users" or "revenue".
Rig captures it in two ways.

Via ClaudeIn Rig

Save a usage rule: enterprise means ARR \> $100k and contract length ≥ 12 months.

Used Rig MCP ›

Rigcreate\_business\_termenterprise

Rigcreate\_usage\_rulesegment.enterprise

Saved.

Reply…

Opus 4.6

Every definition, whether added in chat or the UI, becomes available to every AI tool and teammate.

## Your data changes. Your context keeps up

Columns get added, tables get renamed, definitions evolve. Rig watches for drift and re-ingests automatically. No stale prompt files, no manual refresh.

1. ### Warehouse change detected
   
   A new `plan_tier` column is added to `users` in production.
   
   + plan\_tiertextNew
2. ### Drift flagged
   
   Rig notices the schema diff within minutes: no manual review, no stale prompt files.
   
   02:14 UTC · auto
3. ### Context re-ingested
   
   Metadata, embeddings, sample values and join candidates refreshed for the affected tables.
4. ### Context updated
   
   3 metrics re-validated · 1 join relearned · all agents see the new column on their next call.

You write business logic once. Rig keeps the plumbing current.

## Give your team governed and accurate data access

Rig Agents

Claude / Cursor

Fin / Decagon

Powers every agent

### Rig Context Engine

Auto Data ContextDrift DetectionAgent SandboxAccess GovernanceBusiness Logic

Auto-discovery

Snowflake

BigQuery

Redshift

& many more

### Automatic data context maintenance

- Automatically detects drifts in your schema
- No stale prompt files or manual semantic layer

### Governed data access

### Accurate information in your AI tools

## Rig's context layer is the foundation for work that relies on data

Rig Connect serves it through MCP. Rig's automations let you work with it.

[Try Rig on your data](https://app.rig.so/signup)[Book a demo](https://rig.so/book-demo)

---

- [This page as HTML](https://rig.so/context-layer)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
