# [[Context Layers MOC]] Agents without context are just expensive autocomplete. The entire wave of enterprise AI agent deployments in 2024-2025 hit a wall because nobody solved the context problem first. The pattern: organizations built the [[modern data stack]], consolidated their warehouses, then tried to deploy [[AI agents]] on top. The agents couldn't answer basic questions like "what was revenue growth last quarter?" because they lacked business context: how revenue is defined, which tables are the source of truth, which fiscal quarter to use, and a decade of tribal knowledge that lives in people's heads, not in YAML files. This isn't a model capability gap. It's a context gap. And it's spawning a new infrastructure layer. ## The Evolution 1. **Modern data stack** (2015-2023): Ingestion, transformation, warehousing, storage. Centralize data. Make it accessible. Write SQL. Build dashboards. The assumption: clean data = self-serve analytics. It wasn't enough. 2. **Agent frenzy** (2024-2025): LLM capabilities improved. Every org wanted "chat with your data" chatbots, support agents, automated workflows. Bottoms-up (devs wanted to use new toys) and tops-down (leadership wanted cost reduction). The assumption: powerful models = effective agents. It wasn't enough either. 3. **Hitting the wall**: Most deployments failed. Brittle workflows, no contextual learning, misalignment with actual operations. The root cause wasn't bad models. It was that agents had no access to the business context required to reason about the data they were querying. ## The Context Problem Goes deeper than text-to-SQL accuracy. A data agent facing "what was revenue growth last quarter?" runs into: - **Definition ambiguity**: Is it run rate revenue or ARR? Which product lines? What's the fiscal quarter boundary? - **Source confusion**: Is the truth in fct_revenue, mv_revenue_monthly, or mv_customer_mrr? - **Stale metadata**: [[Semantic layers]] exist but were last updated by someone who left. Don't include new product lines. Disconnected from current BI tools. - **Tribal knowledge**: The real answer lives in the head of a finance analyst who knows that "for CRM data, use Affinity for USCAN deals from 2025 onwards, Salesforce for everything before that." ## Context Layer: The Missing Infrastructure The context layer sits between the data stack and the agent layer. It's a superset of what [[semantic layers]] traditionally cover. A [[semantic layers]] handles metric definitions (revenue, churn, ARPU) in specific syntax (LookML, dbt metrics) connected to specific BI tools. Necessary but insufficient for autonomous agents. A context layer adds: - **Canonical entities and identity resolution**: Who is "the customer"? Which ID system is authoritative? - **Tribal knowledge capture**: Natural language instructions alongside code. The ".cursorrules for data." - **Governance guidance**: Who can access what. Which data is PII. What compliance rules apply. - **Cross-system mapping**: How CRM connects to warehouse connects to billing connects to product analytics. - **Decision and workflow logic**: Not just what the data means, but how the organization uses it to make decisions. ## Building the Context Layer Five-step construction: 1. **Access the right data**: Table stakes. Lakehouse architecture, unified storage. But also tribal knowledge from Slack, GDrive, internal wikis. 2. **Automated context construction**: LLMs scan query history (most referenced tables, common joins), ingest dbt models, LookML definitions, existing semantic layers. High-signal automated extraction. 3. **Human refinement**: The most important and hardest step. Automated construction gets you 70%. The last 30% is implicit, conditional, historically contingent knowledge that only exists inside teams. This is the step most companies skip and then wonder why their agents hallucinate. 4. **Agent connection**: Expose the context layer via API or MCP so agents can access it in real-time. 5. **Self-updating flows**: Context is never static. Data sources change. Business definitions evolve. Agent errors should feed back into context refinement. The layer must be a living corpus. ## Market Landscape Three categories emerging: - **Data gravity platforms**: Databricks (Genie), Snowflake (Cortex Analyst). Already have the data. Adding lightweight semantic modeling and text-to-SQL. Feasible path to context layers through acquisition or in-house development. - **AI data analyst companies**: Started as "chat with your data." Learned through market pain that context is the real product. Evolving to include context construction. - **Dedicated context layer companies**: Building context-first from the ground up. Must solve data ingestion, tribal knowledge collection, and context maintenance for each customer. ## First Principles - **Context is the moat, not the model**: Any company can plug in GPT-4 or Claude. The company that captures and structures the business context owns the value layer. Models are commoditizing. Context is compounding. - **Tribal knowledge is the last mile**: The gap between what's in the warehouse and what the business actually means is filled by people. Whoever codifies that knowledge into a machine-readable context layer wins. - **Self-updating beats static**: A context layer that doesn't evolve with the business is just another stale semantic layer. The self-updating loop (agent error → context refinement → better agent) is the flywheel. ## The Azraq Parallel This framework maps directly to what [[Azraq MOC]] is building for digital infrastructure risk: - **Azraq IS a vertical context layer**: Infrastructure risk data is as fragmented as enterprise data. Environmental risk assessed separately from regulatory risk, financial modeling isolated from grid reliability. Azraq's [[Azraq Risk Engine]] is the context layer that unifies all six risk pillars into a single, queryable intelligence layer. - **The [[Azraq Data Flywheel]] IS automated context construction + self-updating flows**: Every risk assessment ingests new data, data agents continuously scan for regulatory/environmental/market changes, and the models self-improve. Steps 2 and 5 of the context layer framework, running autonomously. - **[[Domain-Specific SLMs for Risk Intelligence]] ARE the reasoning layer on top of context**: Just as data agents need business context to answer "what was revenue growth?", infrastructure investors need risk context to answer "what's the risk profile of this site?" The SLMs encode the domain context that makes raw risk data interpretable. - **[[Azraq Data Agents]] ARE the tribal knowledge codification engine**: Infrastructure risk assessment today relies on experienced consultants and market intuition. Azraq's agents codify that tribal knowledge into continuously updating risk models. This is step 3 (human refinement) being progressively automated. - **The moat implication**: If context is the moat (not the model), then Azraq's defensibility comes from the proprietary risk context corpus it builds with every assessment. No competitor can replicate years of structured, cross-category risk data accumulated across deals, geographies, and market cycles. This is the same reason Palantir's [[ontologies]] are sticky: once you've built the context layer for an organization's data, switching costs are enormous. ## Cross-Links Core: - [[AI agents]] : The consumer of context - [[AI Agents Stack]] : The infrastructure layers - [[semantic layers]] : The predecessor (now a subset) - [[knowledge graphs]] : The structural pattern - [[ontologies]] : The schema/rulebook Azraq: - [[Azraq MOC]] : Vertical context layer for digital infrastructure risk - [[Azraq Data Flywheel]] : Automated context construction in action - [[Azraq Data Agents]] : Self-updating context flows - [[Domain-Specific SLMs for Risk Intelligence]] : Reasoning layer on context Principles: - [[Defensibility Principles MOC]] : Context as moat - [[AI era Defensibility]] : Why context compounds and models commoditize - [[Consultancy-to-Platform Transition]] : Context layers are how consultancies become platforms - [[First Principles and Mental Models MoC]] - [[Wright’s Law]] : Every context layer interaction sharpens the next --- Tags: #systems #deeptech #kp #wp