Meerkats AI
← All posts

Become the AI champ in your org: stop project stall

Most enterprises use AI somewhere; few run it across the business, and fewer can show the result. The gap is rarely the model. It is the context and operating foundations underneath the agent. A research note with the reference architecture, working code for its key seams, a worked supply-chain example, the controls and scorecard, a 90-day plan and an open-source toolkit map.

In short
  • Adoption is no longer the constraint. 88% of organisations use AI in at least one function; about a third are scaling it, and 39% see enterprise-level EBIT impact. The last mile from prediction to completed work is where programmes stall.
  • Agents fail in production for three structural reasons: fragmented business meaning, no view of current state, and intelligence disconnected from authority. A context layer closes those gaps when it is a logical, operated capability over your existing systems, with owners, freshness service levels and versioned change.
  • Start with one consequential workflow, write its context requirement first, reuse the warehouse and metric definitions you have, enforce rules outside the model, and measure against a baseline before expanding autonomy. The full note is below, and as a 15-page PDF.

We wrote this note for the engineer or programme head who will be accountable for getting agents from pilot to production. It treats the context layer as real, ongoing work rather than a cost-free addition to the stack, and it is deliberately concrete: the architecture, code for its key seams, one worked example end to end, the controls, the scorecard, and a plan for the first 90 days. If you would rather read it on paper, the PDF edition is the same text.

Executive summary

Enterprise AI has moved beyond experimentation, but its operating model has not caught up. Most organisations use AI somewhere; far fewer run it across the business, and fewer still can show the financial result.

Bar chart of five survey figures: 88% use AI in at least one function, about 33% are scaling it, 39% report EBIT impact, 25% of AI initiatives delivered expected ROI, 16% scaled enterprise-wide
Figure 1. Use is widespread; scale and value are not. The first three bars are shares of surveyed organisations; the last two are shares of AI initiatives, as reported by CEOs. McKinsey gives the second figure as about one-third. McKinsey, The State of AI 2025 (1,993 respondents) [1]; IBM Institute for Business Value, CEO study 2025 (2,000 CEOs) [2].

The bottleneck is often not model capability. Most organisations already own warehouses, analytics, business intelligence, machine-learning models and workflow automation. What remains is the last mile: turning information and predictions into decisions, coordinated actions and completed work across business systems.

Closing that gap takes more than another agent framework. It takes a maintained foundation of business context: what the information means, how business entities relate, what is happening now, which rules apply and which actions are authorised. This note sets out how to build and operate that capability.

Recommendations
Start with one workflow where the prediction exists and the resolution is manual, and baseline it before building. Write the context requirement first: what the agent must know, from which source, how fresh, and what happens when it is missing. Reuse the warehouse, metric definitions and policy repositories; add mappings, state, retrieval and controls; never build a second source of truth. Enforce rules outside the model: read rights at the source, policy in a policy engine, write rights at the execution system, a person on every consequential change until the evidence says otherwise. Measure the workflow against its baseline on a five-part scorecard and expand autonomy only on evidence.

1. The opportunity: from informing decisions to completing work

Data platforms make information available. Analytics explains what happened and why. Models forecast outcomes, detect anomalies and estimate risk. The response to an insight, however, usually remains manual.

Five-stage pipeline from data platform to business systems, with the decision-and-action stage marked as manual, and the seven manual steps an analyst takes for one late delivery
Figure 2. The stack to the left of the gap is automated and mature. The work to the right of it, where a person reads the prediction and moves information between systems, is where the hours and the errors are.

A model may flag a supplier delivery as at risk. An operations analyst must then inspect the purchase order, check contract terms, review shipment updates, contact the supplier, identify alternatives, obtain approval and update the planning system. The prediction is automated; the resolution is not.

AI agents can close this gap. They interpret variable inputs, retrieve relevant information, reason across several steps, use tools and coordinate parts of a workflow. They earn their place where work involves exceptions, unstructured information and decisions spanning several systems.

Where an agent is the right tool

Shape of the workBetter handled byWhy
Stable, repetitive, fully specified processConventional automation (RPA, scheduled jobs, workflow engine)Deterministic, cheap, auditable; an agent adds variance without adding value
Find or summarise information for a personSearch or an assistantNo action is taken, so no authority or state management is needed
Exceptions across several systems, with judgement and follow-upAn agent, with bounded authorityVariable inputs, multi-step reasoning, tool use; this is the last-mile work
High-stakes, irreversible decisionsA person, with an agent preparing the evidenceThe cost of a wrong action outweighs the cost of waiting for approval

Gartner recommends choosing agentic approaches where they deliver clear value rather than applying them indiscriminately [3]. The opportunity is to connect the existing data and analytics stack to the operational work that still depends on people moving information between systems, interpreting exceptions and initiating follow-up. It is not to replace that stack.

2. Why promising agents fail in production

The same three structural gaps appear in almost every stalled agent programme. Each one produces symptoms that look like model error and are not.

Three columns, Meaning, State and Authority, each with a description and three example symptoms
Figure 3. Three gaps, and the symptoms each one produces in a live workflow. A symptom in the bottom rows is a reason to look at the gap above it before touching the prompt.

Business meaning is fragmented

IBM's 2025 CEO study found that 50% of surveyed CEOs believe rapid technology investment has left their organisations with disconnected, piecemeal technology [2]. Systems may contain the necessary data without sharing a definition of a customer, a supplier, an active contract or a current commitment. An agent reading two systems gets two answers and no rule for choosing between them.

The agent lacks the current state of the work

A policy document describes what should happen. It does not establish whether a particular approval has been given, whether a record changed an hour ago, or whether a colleague is already handling the case. A model produces a plausible response from stale or incomplete information, and the response reads as confidently as a correct one.

Intelligence is disconnected from authority and execution

Knowing that an action is advisable is different from being authorised to take it. Production workflows need decision rights, controlled access, approval routes, exception handling and an auditable record. A prompt that says “never exceed the budget cap” is advice to the model; it is not a control.

Where skills, harnesses and evaluations fit
Skills describe procedures, harnesses structure execution, and evaluations test performance against cases. All three are necessary engineering tools. They become distractions when a team optimises them before establishing reliable business inputs, workflow ownership and measurable outcomes. Section 5 shows evaluations used in their right place: testing the whole workflow, including stale data, conflicts and unauthorised requests.

Gartner warned in June 2025 that more than 40% of agentic AI projects could be cancelled by the end of 2027 because of escalating costs, unclear business value or inadequate risk controls [3]. That is a forecast, not a measured cancellation rate, but it names the three failure modes this note is organised around: cost without a baseline, value without a chosen workflow, and risk without enforced controls.

3. The context layer: reference architecture

A context layer assembles and maintains the business information, definitions, current state and rules that AI systems need to perform specific work. It is a logical capability. It can use a vector store, a knowledge base, the warehouse or a document repository for storage and computation, but none of those is the layer by itself, and it does not have to be one product or one database. What makes it a context layer is the set of mappings, retrieval interfaces, state management and controls introduced on top. This follows the direction Anthropic describes as context engineering: context is curated and maintained throughout an agent's execution, not written once into a prompt [4].

Reference architecture: six source systems feed connectors; the context layer holds definitions, relationships, current state and policies with a retrieval component and a governance band; agents, workflows and apps consume it; execution systems enforce writes
Figure 4. Reference architecture. Sources stay authoritative; the layer adds meaning, relationships, state, policy and governed retrieval; agents, workflows and apps read the same context; execution systems keep their own write controls.

The seven components, and what to reuse for each

ComponentWhat it holdsReuse from your stackUsually new work
1 Connectors and source accessInterfaces to ERP, CRM, warehouse, documents, apps, APIs and event streamsExisting APIs, CDC and ingestion pipelines, the warehouse itselfLive reads for fast-changing state; identity pass-through so reads carry the user's rights
2 Business definitions and semanticsCanonical entities, reconciled identifiers, metric definitions, conflict-resolution rulesdbt models, the semantic layer, MDM golden recordsExposing definitions to agents; one meaning per term across systems; precedence rules when sources disagree
3 Relationships and domain modelLinks between entities, transactions, documents and processesWarehouse foreign keys, the data catalog's lineage graphCross-system links the warehouse never needed, such as campaign → product → stock, or supplier → contract → open exceptions
4 Current operational stateOpen cases, approval status, inventory or capacity, task ownership, recent events, deadlinesOperational systems, event streams, case-management toolsFreshness rules, timestamps, stale and conflict detection, a small state store for cross-system facts
5 Policies and decision requirementsProcedures, thresholds, exception rules, required evidence, approval matrices, escalation pathsThe policy repository, approval matrices in finance and procurementCritical rules as checkable conditions, versioned with owner and effective date; a context requirement per task
6 Context retrieval and deliveryAPIs, queries or tools that assemble only what the task and user need, with provenance and freshnessQuery engines, searchThe assembly logic, the task specs, an agent-facing interface such as an MCP tool
7 Governance, observability, feedbackAccess-aware retrieval, logs of what was served, versions, quality checks, evaluation data, outcomesIAM, the observability stack, the audit platformA per-decision record that links inputs, versions, approval, action and outcome

Component 5 in practice: the context requirement

The single most useful artefact in the whole programme is a short, owned specification of what an agent must know before it may act on a task. It turns a vague request (“resolve late deliveries”) into checkable inputs, each with a source, a freshness limit and a rule for what happens when it is missing.

Code 1. A context requirement for one task. Business-owned, versioned, tested like code.
# context requirement for one task: what the agent must know before it may act.
task: resolve_late_delivery
version: 3
owner: supply-ops@example.com

inputs:
  - name: shipment
    source: tms.shipments              # authoritative system for delivery dates
    key: shipment_id
    max_age: 15m                       # older than this: stale, so escalate
    required: true
  - name: purchase_order
    source: erp.purchase_orders
    join: shipment.po_number -> po_number
    max_age: 1h
    required: true
  - name: contract_terms
    source: clm.contracts
    join: purchase_order.supplier_id -> supplier_id
    fields: [sla_days, penalty_clause, alternate_supplier_allowed]
    max_age: 24h
    required: true
  - name: production_impact
    source: mes.schedule
    join: purchase_order.material_id -> material_id
    max_age: 30m
    required: true
  - name: approved_alternates
    source: srm.alternate_suppliers
    required: false                    # absence is a warning, not a stop

definitions: [late_delivery, production_at_risk]   # resolved from the semantic layer, never restated here
policies: [supplier-change-approval, spend-threshold]

conflicts:
  delivery_date: prefer tms.shipments over erp.purchase_orders

on_missing: escalate                   # never guess
on_stale: escalate

Component 6 in practice: what retrieval returns

Retrieval returns facts with their provenance and age, the definitions and policy versions in force, and a record of any conflicts it resolved. It does not return large volumes of text for the model to sift. If a required input is missing or stale, it returns an escalation instead of a best effort.

Code 2. A retrieval response. Every fact carries its source and age; the definitions and policies carry versions.
{
  "task": "resolve_late_delivery",
  "task_version": 3,
  "assembled_at": "2026-10-20T06:41:12Z",
  "complete": true,
  "facts": {
    "shipment": {
      "id": "SHP-88213", "eta": "2026-10-27", "promised": "2026-10-22",
      "source": "tms.shipments", "as_of": "2026-10-20T06:35:00Z", "age_s": 372
    },
    "contract_terms": {
      "sla_days": 2, "alternate_supplier_allowed": true,
      "source": "clm.contracts", "as_of": "2026-10-19T22:00:00Z", "age_s": 31272
    },
    "production_impact": {
      "line": "L2", "stockout_on": "2026-10-24", "units_at_risk": 1800,
      "source": "mes.schedule", "as_of": "2026-10-20T06:25:32Z", "age_s": 940
    }
  },
  "definitions": {
    "late_delivery": "eta > promised + contract_terms.sla_days",
    "semantic_version": "2026.10.2"
  },
  "policies": [
    {"id": "supplier-change-approval", "version": 7, "effective_from": "2026-09-01"}
  ],
  "conflicts_resolved": [
    {"field": "delivery_date", "chosen": "tms.shipments", "rejected": "erp.purchase_orders"}
  ],
  "warnings": []
}
Code 3. The assembly function behind it. Missing or stale required inputs raise; the caller escalates.
from datetime import datetime, timezone

class ContextError(Exception):
    """Raised when required context is missing or stale. The caller escalates; it never guesses."""

def assemble(spec: dict, entity_key: str, now: datetime | None = None) -> dict:
    now = now or datetime.now(timezone.utc)
    facts, warnings = {}, []
    for inp in spec["inputs"]:
        rec = SOURCES[inp["source"]].fetch(entity_key, inp)      # live read; nothing is copied first
        if rec is None:
            if inp.get("required"):
                raise ContextError(f"missing:{inp['name']}")
            warnings.append(f"optional input absent: {inp['name']}")
            continue
        age = now - rec.as_of
        if "max_age" in inp and age > parse_duration(inp["max_age"]):
            raise ContextError(f"stale:{inp['name']} age={int(age.total_seconds())}s")
        facts[inp["name"]] = {**rec.data, "source": inp["source"],
                              "as_of": rec.as_of.isoformat(), "age_s": int(age.total_seconds())}
    facts, resolved = resolve_conflicts(facts, spec.get("conflicts", {}))  # agreed precedence, recorded
    return {"task": spec["task"], "task_version": spec["version"],
            "assembled_at": now.isoformat(), "complete": True,
            "facts": facts, "conflicts_resolved": resolved, "warnings": warnings,
            "definitions": SEMANTIC.resolve(spec["definitions"]),
            "policies": POLICY.versions(spec["policies"])}
Code 4. The same assembly exposed to agents as a Model Context Protocol tool [6]. Read rights are checked per source against the calling user, and every call is logged.
from mcp.server.fastmcp import FastMCP      # modelcontextprotocol/python-sdk

mcp = FastMCP("context-layer")

@mcp.tool()
def get_context(task: str, entity_key: str, principal: str) -> dict:
    """Assemble the verified context a task needs. Returns facts with source and freshness,
    or an escalation. Read permissions come from the source systems, not from the model."""
    spec = load_spec(task)
    authz.check_read(principal, spec)                     # the user's rights, applied per source
    try:
        ctx = assemble(spec, entity_key)
    except ContextError as e:
        audit.record("context.escalated", principal=principal, task=task, reason=str(e))
        return {"complete": False, "escalate": str(e)}
    audit.record("context.served", principal=principal, task=task, ctx_hash=digest(ctx))
    return ctx

Component 2 in practice: reuse the definitions you have

If finance already defines late delivery, margin or ROAS in the semantic layer, the agent uses that definition. Restating it in a prompt or a separate store creates a second, drifting source of truth. The context requirement in Code 1 lists definitions by name; retrieval resolves them from where they live.

Code 5. The metric the agent uses is the one the business already owns, here in dbt's MetricFlow format. The context layer references late_delivery_rate; it does not re-derive it.
# reuse, don't restate: the metric the agent uses is the one finance already owns (dbt / MetricFlow)
semantic_models:
  - name: deliveries
    model: ref('fct_deliveries')
    entities:
      - { name: shipment, type: primary, expr: shipment_id }
      - { name: supplier, type: foreign, expr: supplier_id }
    dimensions:
      - { name: promised_date, type: time, type_params: { time_granularity: day } }
    measures:
      - name: deliveries
        agg: count
        expr: shipment_id
      - name: late_deliveries
        agg: sum
        expr: case when actual_date > promised_date + sla_days then 1 else 0 end

metrics:
  - name: late_delivery_rate
    type: ratio
    type_params: { numerator: late_deliveries, denominator: deliveries }

This layer must be operated, not merely built

Source schemas change. APIs fail. Definitions evolve. Policies are revised. New entities appear. An approval matrix changes before its cached copy does. Without ownership and maintenance the context layer becomes one more stale silo, with the added risk that agents act on it.

OwnerAccountable forTypical cadence
Business ownersDefinitions, policies, exceptions, decision rules, the context requirement for each taskReview on each policy change; quarterly audit of definitions
Data and integration ownersSource mappings, refreshes, data quality, lineage, failure recoveryFreshness SLOs monitored continuously; schema changes handled before they reach agents
AI engineering ownersRetrieval logic, context composition, evaluation suites, model and tool compatibilityEvaluation on every change to a spec, prompt, tool or model
Security and risk ownersAccess enforcement, action boundaries, audit, retention, incident responseAccess review per workflow launch; incident drills on unauthorised-action and stale-context cases
Five-step pipeline: change, version, test, deploy, monitor, with a dashed loop back from monitor to change
Figure 5. Context changes ship like code. A changed definition, policy or mapping is versioned, tested against the affected workflows' cases, deployed in stages and monitored against freshness service levels.
Class of factExampleFreshness limitOn breach
Live operational stateShipment ETA, stock on hand, open approvalMinutesStop the task and escalate; never act on a stale value
Transactional recordsPurchase order, invoice, caseUnder an hourRe-read from source; escalate if the source is unavailable
Reference and contract dataContract terms, supplier master, approved alternatesA dayProceed with a visible warning if the task allows; otherwise escalate
Definitions and policiesMetric logic, approval thresholdsVersioned, not time-basedA version change triggers regression tests before agents see it

Not all information needs to be copied into a new store. Frequently changing state is best retrieved live; stable definitions are managed centrally; authoritative policy documents can remain where they are. The architecture should minimise duplicated truth while making the required context dependable.

4. Worked example: supplier delivery exceptions

An organisation wants to cut the manual effort of resolving late supplier deliveries. Its analytics platform already predicts which shipments will miss their dates.

Sequence diagram across seven lanes: forecast, context layer, agent, policy engine, approver, ERP/TMS and audit log, showing one late-delivery case from event to recorded outcome
Figure 6. One case, end to end. The forecast raises the event; the context layer assembles and checks the evidence; the agent proposes; the policy engine decides whether a person is needed; the ERP enforces the write; the audit log records every step; the outcome feeds back.

The workflow as durable code

The recommendation and the enforcement are separate nodes. The agent reasons about the rule in recommend; the policy engine enforces it in check_policy; a person decides in approve; the ERP's own API enforces write rights in execute. The graph is checkpointed, so a case can wait hours for an approver without losing state.

Code 6. The workflow as a durable graph (LangGraph). A missing or stale context stops it at the first node. The approval step pauses the run until a named person answers.
from langgraph.graph import StateGraph, START, END     # langchain-ai/langgraph
from langgraph.types import interrupt
from langgraph.checkpoint.postgres import PostgresSaver

def gather(state):
    return {"ctx": get_context("resolve_late_delivery", state["shipment_id"], state["principal"])}

def recommend(state):
    if not state["ctx"]["complete"]:                      # missing or stale: stop here
        return {"outcome": "escalated", "reason": state["ctx"]["escalate"]}
    return {"plan": llm.plan(state["ctx"])}               # reasons about the rule

def check_policy(state):
    return {"decision": opa.decide("supplier/change", state["plan"]["args"])}   # enforces the rule

def approve(state):
    if not state["decision"]["needs_approval"]:
        return {"approved": True, "approver": "policy:supplier.change@7"}
    answer = interrupt({"plan": state["plan"], "approver": state["decision"]["approver"]})  # waits, durably
    return {"approved": answer["approved"], "approver": answer["by"]}

def execute(state):
    if not state["approved"]:
        return {"outcome": "rejected"}
    erp.switch_supplier(**state["plan"]["args"], on_behalf_of=state["approver"])  # ERP enforces write rights
    return {"outcome": "executed"}

g = StateGraph(dict)
for node in (gather, recommend, check_policy, approve, execute):
    g.add_node(node.__name__, node)
g.add_edge(START, "gather"); g.add_edge("gather", "recommend"); g.add_edge("recommend", "check_policy")
g.add_edge("check_policy", "approve"); g.add_edge("approve", "execute"); g.add_edge("execute", END)
app = g.compile(checkpointer=PostgresSaver(conn))        # state survives the wait for a person
Code 7. The policy the workflow enforces, as Open Policy Agent Rego. Thresholds live in versioned policy data, owned by procurement, not in a prompt.
# policy as code (Open Policy Agent). The agent may reason about this rule;
# the workflow enforces it here, against trusted data, before anything executes.
package supplier.change

default allow := false
default needs_approval := true

# switching to an approved alternate, under the auto threshold: allowed without a person
allow if {
    input.action == "switch_supplier"
    input.new_supplier in data.approved_alternates[input.material_id]
    input.order_value_usd <= data.thresholds.auto_switch_usd
}

needs_approval if not allow

approver := "procurement_lead" if {
    input.order_value_usd > data.thresholds.auto_switch_usd
    input.order_value_usd <= data.thresholds.director_usd
}
approver := "procurement_director" if {
    input.order_value_usd > data.thresholds.director_usd
}

The record that makes a decision reviewable

Every case produces one record linking the trigger, the exact context used (by hash and source timestamps), the recommendation, the policy result, the approval, the action and the eventual outcome. This is what an auditor, a risk owner or an engineer debugging a bad decision reads first.

Code 8. One audit record. Anyone can reconstruct what the agent knew, what it proposed, who approved, what changed and what happened next.
{
  "case_id": "LD-2026-10-20-0417",
  "workflow": "resolve_late_delivery", "workflow_version": "3.2.0",
  "trigger": {"source": "forecast.delivery_risk", "event_id": "evt_71ac", "p_late": 0.82},
  "context": {
    "hash": "sha256:9f1c…", "assembled_at": "2026-10-20T06:41:12Z",
    "sources": ["tms.shipments@06:35Z", "erp.purchase_orders@06:10Z",
                "clm.contracts@22:00Z", "mes.schedule@06:25Z"],
    "semantic_version": "2026.10.2"
  },
  "recommendation": {
    "action": "switch_supplier", "to": "SUP-0192", "order_value_usd": 48000,
    "model": "<model id>", "prompt_version": "r14"
  },
  "policy": {
    "id": "supplier-change-approval", "version": 7,
    "result": "needs_approval", "approver_role": "procurement_lead"
  },
  "approval": {"by": "a.rao@example.com", "at": "2026-10-20T07:03:40Z", "decision": "approved"},
  "action": {
    "system": "erp", "call": "PurchaseOrder.switchSupplier",
    "status": 200, "at": "2026-10-20T07:03:52Z"
  },
  "outcome": {"delivered_on": "2026-10-23", "on_time": true, "recorded_at": "2026-10-23T15:20:00Z"}
}

Stages, with exit criteria

StageWhat happensExit criterion
Establish the baselineMap the current process, exception categories, systems, handoffs and decisions. Measure time to resolution, analyst effort, avoidable downtime and the rate of incorrect interventions.A written baseline the business owner signs
Inventory existing capabilitiesReuse warehouse definitions, forecasting outputs, supplier records, contract repositories and workflow APIs. List only the missing relationships, live status, policies and decision rights.The context requirement (Code 1) drafted and owned
Assemble the operational contextConnect the predicted delay to the correct purchase order, supplier, contract, shipment status, production schedule and approved alternates. Record timestamps; resolve conflicts by agreed precedence.Retrieval returns complete, fresh context for 95% of live cases; the rest escalate cleanly
Deploy with bounded authorityThe agent gathers evidence, explains impact, recommends and drafts the communication. A qualified employee approves supplier or plan changes. Approved actions run through authorised systems.Zero unauthorised actions; approvals and overrides logged; error rate at or below the human baseline
Learn from outcomesCompare recommendations with expert decisions, inspect errors, find recurring data gaps. Test late updates, missing contracts, conflicting commitments, duplicate cases and unauthorised access before widening scope.Evaluation suite green on all failure classes; scorecard reviewed against baseline

The same pattern applies to invoice exceptions, service-desk escalations, claims review, compliance investigations and any operation where information is fragmented and the last mile is manual.

5. Governance, reliability and the KPIs that matter

Governance is a property of the complete workflow, not a prompt instruction. Each control is enforced by the component best placed to enforce it.

Six control points in a row: read at source systems, context at the context layer, decision at the policy engine, approval by people, write at execution systems, record in the audit log
Figure 7. Six control points, each enforced where it belongs. The model is a participant in this chain, never the enforcer of it.

Source systems enforce read permissions; execution systems enforce write and action permissions. High-impact actions wait for approval, and missing, stale or conflicting context triggers escalation rather than fabricated certainty. Risk-based controls can draw on the NIST AI Risk Management Framework and its Generative AI Profile [7]. Microsoft Research's CI-Work benchmark shows why access alone is not enough: an agent can retrieve information that is useful and still inappropriate to share in that context [5].

Test the workflow, not the prose

Evaluation cases are written against the whole workflow and its failure classes. A green suite means the system escalated on stale data, chose the agreed source in a conflict, routed an over-threshold change to the right approver and refused an unauthorised caller.

Code 9a. Evaluation cases as data. Each names a situation and the outcome the workflow must produce.
# evals/resolve_late_delivery.yaml: the whole workflow is under test, not the model's prose
- id: stale-shipment-feed
  given: { shipment: { as_of: "-45m" } }
  expect: { outcome: escalated, reason: "stale:shipment" }

- id: conflicting-delivery-dates
  given: { tms.eta: "2026-10-27", erp.eta: "2026-10-23" }
  expect: { chosen_source: tms.shipments }

- id: over-threshold-switch
  given: { order_value_usd: 240000 }
  expect: { needs_approval: true, approver: procurement_director }

- id: unauthorised-principal
  given: { principal: "intern@example.com" }
  expect: { error: forbidden }

- id: duplicate-case
  given: { open_case_for_shipment: true }
  expect: { outcome: attached_to_existing }
Code 9b. The harness. The cases drive the real graph against faked sources, clock and policy data.
import pytest
from fixtures import World, load_cases

@pytest.mark.parametrize("case", load_cases("evals/resolve_late_delivery.yaml"), ids=lambda c: c["id"])
def test_workflow(case):
    world = World(case["given"])                  # fakes the sources, clock and policy data
    result = app.invoke({"shipment_id": world.shipment_id, "principal": world.principal})
    for key, expected in case["expect"].items():
        assert result[key] == expected, f"{case['id']}: {key}"

The scorecard

DimensionMeasuresIllustrative baseline → target
Business valueResolution time, cost per case, rework, avoidable downtime, service levelsMedian resolution 2 days → same day
Decision qualityCorrect recommendations, material error rate, escalationsError rate at or below the expert baseline; escalation rate falling as data gaps close
Operational reliabilitySuccessful completion, stale-context incidents, integration failures, recovery timeStale-context incidents trending to zero; recovery under one hour
GovernanceApproval compliance, blocked unauthorised actions, audit completeness100% of actions approved per policy; 100% of cases reconstructable
Economics and adoptionHuman effort per case, cost per resolved outcome, usage, overrides, maintenance costAnalyst minutes per case down; override rate down over the quarter

The right-hand column is illustrative, to show the shape of a target. Set real targets from your own baseline. Compare every measure against that baseline, including human-review costs and failure handling. A reduction in model tokens is useful only if it contributes to a better operating outcome.

6. Scale through reuse, not replication

Scaling should mean that the second and third workflows are easier because they reuse trusted connectors, definitions, entity relationships, policy retrieval, evaluation cases and audit mechanisms.

Shared capabilities block (connectors, definitions, relationships, policy retrieval, audit, evaluation harness) feeding three workflow columns that each keep their own requirement, boundaries, owner, tests and approval route
Figure 8. Shared capabilities against per-workflow work. Reuse does not mean identical rules or permissions; each workflow keeps its own owner, boundaries and tests.
Four rising steps: shadow in weeks 9 to 10, approve in weeks 11 to 12, bounded auto in quarter 2, reuse in quarters 2 to 3
Figure 9. Autonomy expands on evidence. Each step has exit criteria measured on the scorecard; a second workflow starts on the same layer once the first is stable.

The strategic shift is from treating every agent as a standalone project to managing context, workflows and controls as shared organisational capabilities. That is the path from isolated experiments to a dependable operating model, one that converts the organisation's existing data and intelligence into completed, measurable work.

7. A 90-day plan

For one workflow, with one accountable owner. Dates assume the sources and APIs already exist.

WhenWhatOutput
Weeks 1–2Pick a workflow where a prediction or signal exists and the resolution is manual, with a measurable cost. Map it with the people who do it. Name the business owner and the risk owner.The baseline: time, effort, error rate, downtime
Weeks 3–4Draft the context requirement (Code 1). For each input, find the authoritative source, its access path and its freshness limit. Decide which rules become policy code and who owns them.The context requirement, owned; the gap list
Weeks 5–8Connectors for the missing sources; retrieval with provenance and freshness (Code 3, 4); the first policies in a policy engine (Code 7); the audit record (Code 8). Reuse the semantic layer (Code 5). Write the evaluation cases (Code 9) before the agent is wired in.The seams built; the evaluation suite
Weeks 9–10Shadow mode: the agent assembles context and recommends; people act as before. Compare daily. Fix data gaps and conflicts as they appear. Run the suite on every change.Recommendation quality against expert decisions
Weeks 11–12Approved execution behind a named approver (Code 6). Review the scorecard against the baseline. Decide, on evidence, which low-risk class of action may run without a person next quarter, and which workflow comes next.The scorecard review; the next workflow

8. Open-source toolkit map

Mature projects that cover each component. Choose by fit with your stack; none of these is required, and several may already be in place. Licences were read from each repository on 20 October 2026; check them again before adoption.

ComponentProjectLicenceUse it for
2 Definitions and semanticsdbt and MetricFlowApache-2.0Modelled datasets and governed metric definitions agents can reference (Code 5)
2 Definitions and semanticsCubeSee repoA semantic layer with APIs, when definitions must be served to many consumers
3 Relationships, lineage, ownershipDataHub, OpenMetadataApache-2.0Entity relationships, ownership, glossary terms and lineage as a graph the layer can query
3 and 7 Lineage eventsOpenLineageApache-2.0A standard for emitting lineage from pipelines, so provenance in Code 2 has a source of truth
4 Freshness and qualityGreat Expectations; dbt source freshnessApache-2.0Checks that feed the freshness and quality rules in Code 1 and the SLO table
5 Policy as codeOpen Policy AgentApache-2.0Approval thresholds and action rules evaluated outside the model (Code 7)
6 Agent-facing retrievalMCP Python SDKMITExposing get_context and other governed tools to any MCP-capable agent (Code 4)
Workflow and approvalLangGraph, TemporalMITDurable, checkpointed workflows that can wait for a person (Code 6)
Scheduled refreshApache AirflowApache-2.0Refreshing reference data and running evaluation suites on a schedule
7 Observability and evaluationOpenTelemetry; Langfuse, Arize Phoenix, promptfooApache-2.0; see repos; MITTraces that link context, tool calls and outcomes; running the evaluation cases in Code 9

References

  • [1] McKinsey & Company, The State of AI in 2025: Agents, Innovation, and Transformation, November 2025. Survey of 1,993 respondents across 105 nations. mckinsey.com
  • [2] IBM Institute for Business Value, IBM Study: CEOs Double Down on AI While Navigating Enterprise Hurdles, May 2025. Survey of 2,000 CEOs across 33 countries and 24 industries. newsroom.ibm.com
  • [3] Gartner, Gartner Predicts Over 40% of Agentic AI Projects Will Be Canceled by End of 2027, press release, 25 June 2025. gartner.com
  • [4] Anthropic, Effective Context Engineering for AI Agents, 29 September 2025. anthropic.com
  • [5] Microsoft Research, CI-Work: Benchmarking Contextual Integrity in Enterprise LLM Agents, ACL Industry Track 2026. microsoft.com/research
  • [6] Model Context Protocol, Specification. modelcontextprotocol.io
  • [7] NIST, AI Risk Management Framework and Generative AI Profile (NIST AI 600-1). nist.gov

Code samples are illustrative and abbreviated. Names such as SOURCES, authz, audit, opa and erp stand for your own adapters. The supplier, order and value figures are invented. Download the PDF edition to share with your team.

Questions you might have

Do we need a context layer if we already have a warehouse, dbt and a semantic layer?
Maybe only for the gaps. If the existing stack answers the workflow's questions with current, unambiguous data, use it. The layer earns its place where the agent needs what those systems don't hold: live operational state, cross-system mappings, policies as checkable rules, and a record of what was used. It references your definitions; it never restates them.
Does the context layer copy our data into a new database?
Usually not. It retrieves from existing systems and keeps small supporting records such as mappings, workflow requirements and sync status. A separate store is justified only for a specific need, such as fast retrieval or cross-system state.
How long does the first workflow take?
The plan above is 90 days to approved execution, assuming the sources and APIs already exist: two weeks to baseline, two to write the context requirement, four to build the seams, two in shadow mode, two with a person approving each action.
When can an agent act without a person?
When the evidence says so: error rate at or below the human baseline, zero unauthorised actions, every case reconstructable from the log, and a low-risk class of action defined in policy. Expand autonomy one class at a time, and keep the approval step for everything else.
What is the single most useful artefact?
The context requirement (Code 1): a short, owned list of what the agent must know before it acts, each input with a source, a freshness limit and a rule for what happens when it is missing. Everything else in the note is built around it.

Your business is unique. Your AI should work that way.

We're the unified context layer for your AI systems. Connect your ad platforms, marketplaces and store, and build your first workflow on top.