Data context and governance

    Everyone's banging on about context, but what actually is it?

    A context layer is a navigational map of your data: which systems exist, where their data is stored, how metrics are defined, and what tables and business terms mean. When someone asks for the context on a deal, they mean background facts. Those facts are data, and they belong in the warehouse, where the source system keeps them current.

    By Toby Mather · Published

    Key takeaways

    • In a data team, context means the map: systems and storage, metric definitions, business meanings and relationships.
    • Facts such as "John is the CFO and the main buyer" are the territory. They belong in structured tables in the warehouse, kept current by the system they came from.
    • Memory files, markdown trees and custom context repos copy facts out of their source, so they drift as soon as the source changes.
    • A context layer contains the semantic layer and covers the many questions that no predefined metric answers.
    • For a data team, context engineering means giving the model the right map and a governed route to current facts, and longer prompts do little for either.
    1. 01Source systems

      CRM, billing, support

    2. 02Warehouse tables

      The territory, kept current by syncs

    3. 03Context layer

      The map: systems, metrics, meanings

    4. 04Gateway

      Which facts this agent may read

    5. 05AI agents

      Read the map, then the current row

    Facts live in warehouse tables. The context layer points at them and describes them, and copies held in memory files drift away from the source.

    What do people mean by context in ordinary conversation?

    In a sales meeting, asking for the context on a deal means asking who is involved, what they bought before, what was said on the last call and when the contract renews. Those are facts, and the person asking wants the background before they walk in.

    In data and AI work the word has picked up other meanings, and they get mixed up. A model's context window is everything it can see on one request. A context layer is a maintained description of your data estate. Vendors also use the word for caches, catalogs, memory stores and semantic layers, which is why the term feels slippery.

    If a context layer is a map, what is on it?

    A context layer is the description of your data that lets a person or an agent find the right facts and use them correctly. It covers the systems you run and how data flows between them, the warehouse tables that hold each system's data, what each table and column means, which tables are trusted, how each metric is calculated, and the caveats that would otherwise live in one analyst's head, such as which rows most queries should exclude.

    An ontology is part of the same map. It names the business entities, such as customer, contract and invoice, and the relationships between them. We treat the ontology, the semantic layer and the context layer as parts of one map, because an agent needs all of them to answer anything beyond a stock metric question.

    Why does "John is the CFO and the main buyer" belong in the warehouse?

    It is a fact about the world, and it will change. John might move to another company, or a new CFO might arrive halfway through the deal. Your CRM already holds his role and the deal's contacts, and a sync brings them into the warehouse, where that table has an owner, an update schedule and access control.

    If you copy the fact into a context file for an agent, you now have two versions. When John leaves, the CRM gets updated and the context file keeps saying he is CFO, so the agent tells your account executive to email someone who left in March. The map should say that buyer roles live in the opportunity contact table, synced from Salesforce every day, and the agent should read the current row.

    Why do memory files, markdown trees and custom repos go stale?

    They are copies. A memory file written during a conversation, a markdown tree of company notes and a custom repo of context documents all start as accurate snapshots of something that lives elsewhere. Nothing updates them when the source changes, and usually nobody owns keeping them in step.

    They are useful for scratch working notes: what an agent has tried during the current task, a preference a user stated, the plan for this session. They are the wrong place for business facts that already have a source system, because on top of going stale, they sit outside the warehouse access rules.

    Hand-written descriptions of the data drift too. A file that says revenue is in fct_orders is correct until someone renames the table. A context layer that reads the warehouse schema can flag the rename, while a hand-written file keeps pointing at a table that no longer exists.

    How does a context layer sit next to a semantic layer?

    The semantic layer is the part of the map that defines business numbers. It answers how you calculate net revenue. The context layer covers everything around it: which table to use for a question no metric covers, what a status code means, how two systems' customer IDs join, and which tables are safe to build on.

    Plenty of real questions never touch a predefined metric. Tracing one order through a logistics log, checking why a payment failed, or finding every account a salesperson owns across two CRMs all need the map and the raw tables. Cleo found this when it put agents on its warehouse: the questions were often ambiguous, and answering them took context beyond metric definitions, from across the whole warehouse.

    What do AI agents actually need from the map?

    An agent reads the map on every question, so gaps show up quickly as wrong answers. In our experience the useful parts are these:

    • Which tables are trusted for a topic, so the agent starts from the right set
    • What tables and columns mean, including units and the rows most queries should exclude
    • Certified metric definitions, so agreed numbers come out the same every time
    • How entities join across systems, such as a Salesforce account to a billing customer
    • Where each kind of fact lives, so the agent reads the current row instead of a remembered one

    Why does the map need an access layer?

    The map tells an agent where the facts are. Something else has to decide which of those facts this agent, acting for this person, is allowed to read. A sales agent working for one rep should see that rep's accounts, and a finance agent should not wander into payroll because the map mentions where payroll lives.

    That decision belongs at query time, on the warehouse, with a role per agent and a log of every call. A paragraph in the agent's instructions asking it to behave does not enforce anything.

    What is a context graph, and is it something different?

    A context graph is a context layer stored as a graph, with nodes for systems, tables, columns, metrics and terms, and edges for lineage, joins and ownership. DataHub uses the term for its platform, and Atlan writes about similar ground. The structure suits agents because they can follow edges from a question to a metric to a table.

    Apply the same test as before. A graph of tables, metrics and lineage is a map. A graph that stores customers, deals and people is data, and it belongs under the same access control as the warehouse it came from. Our comparison post covers knowledge graphs and ontologies side by side.

    Is context engineering just prompt work?

    Anthropic describes context engineering as the strategies for curating and maintaining the best set of tokens for a model during inference, which covers tools, external data and message history as well as the prompt.

    For a data team the useful version is narrower. Give the model the map of the data, the certified metrics relevant to the question, and tools that read current facts from the warehouse under a role. A longer prompt will not fix a missing metric definition, and pasting facts into the prompt brings back the stale-copy problem.

    How Rig does it

    Rig Map is the map, sitting over your warehouse data. It holds the ontology, the semantic layer and the context layer, and keeps them current as schemas change. In Context Studio a data team groups tables, metrics and rules into business areas, writes table and column descriptions, adds usage rules for the caveats, certifies metrics and marks trusted tables with a gold star. The Systems Map shows how data moves between systems and which reports and workflows depend on each field.

    Context Metrics scores the map out of 100 and lists the busiest tables missing descriptions, area tags or metrics. Eval Lab replays real questions through Rig's chat engine and grades the answers, so gaps show up before a user finds them. Novakid took a similar approach before opening its warehouse of more than 5,000 tables to the commercial team: it narrowed what the AI could see to well-described source tables, each carrying its business meaning.

    The facts stay in your warehouse, kept current by Ingest or your existing pipelines. Gateway decides who reads them: each agent has its own role, token and daily call limit, row scoping limits people to their own records, their reports or their team, and every call is logged under the agent's name.

    Tools and approaches

    Redis
    Redis uses context layer for the runtime that decides what an agent knows at each step: memory, retrieval, semantic caching and session state. Redis Iris brings these together. This is the agent-runtime meaning of the term, and it can run alongside a data map.
    DataHub
    An open-source metadata platform that describes itself as a context platform for AI agents, with a context graph that brings lineage, data quality and real-time context together. It is MCP-native.
    Atlan
    Atlan describes its context layer as the governed layer that connects AI agents to trusted data, made of metadata, lineage, glossary and governance, and delivered to agents over MCP.
    Cube
    For Cube, the semantic layer is the governed core of a wider context layer: metrics, dimensions, joins and access rules served to AI clients over MCP.
    Alation
    Alation describes its platform as an operating system that keeps data apps and agents accurate, with a catalog as one module among several.

    Common questions

    Is a context layer the same as a semantic layer?

    A semantic layer is part of a context layer. It defines business metrics. The context layer adds systems, storage, table meanings, relationships and caveats, which agents need for the questions no metric covers.

    Can I keep context in a markdown repo next to the agent?

    For scratch notes and instructions, yes. For business facts and data descriptions, a repo drifts from the source as soon as something changes. Keep facts in the warehouse and generate the map from the systems themselves where you can.

    Where should "John is the CFO" live?

    In the warehouse, in the contact or opportunity table synced from your CRM. The context layer should record where that table is and what its columns mean, and the agent should read the current row when it needs the answer.

    Is context engineering just prompt work?

    Prompt writing is one part of it. Anthropic describes context engineering as curating everything that enters the model's context, including tools and external data. For a data team that means the map, certified metrics and governed tools that read current facts.

    How does Rig Map relate to a context layer?

    Rig Map is Rig's context product. It holds the ontology, the semantic layer and the context layer over your warehouse, and Gateway controls which people and agents can read the data it points at.

    Sources

    Vendor documentation checked on 20 November 2026. Confirm current features and terms with the vendor.

    About the author

    Toby Mather, Co-founder and CEO, Rig. Toby co-founded Rig after seeing how hard it was for business teams and AI to work with complex internal data. He was previously co-founder and CEO of Lingumi and CPO at Novakid.

    Talk to Rig

    See your stack drawn as one diagram

    An architect drafts a one-page diagram of your warehouse, sources and access path, then offers a 30-minute walkthrough.