← Talks

O'Reilly Architecture SuperStream


Making Your Data Ready for Agentic AI

Software Architecture and the Age of Agentic AI


Pramod Sadalage
Distinguished Engineer, Thoughtworks
Prem Chandrasekaran
Market Tech Director, Thoughtworks

The consumers of your data are changing

Data for Humans

Dashboards and reports

Analysts bring context from experience

Batch-friendly — nightly refreshes are fine

Forgives ambiguity — humans interpret

Humans smell bad data

Data for Agents

Autonomous action — not just display

Context must be explicit and encoded

Real-time — stale data causes wrong actions

Zero ambiguity — agents take everything literally

Errors cascade silently

"The bottleneck is no longer the model — it's the architecture of your data."

Five attributes of AI-ready data

T
Trusted
C
Contextual
T
Traceable
G
Governed
O
Operational
1

Data Contracts & Quality

Agents can't smell bad data
Trusted

2

Traceability & Governance

Auditing autonomous agents
Traceable Governed

3

Semantic Layers

Teaching agents what your data means
Contextual

4

Searchable to Actionable

Agent-ready data access patterns
Operational


1

Data Contracts & Quality

Agents Can't Smell Bad Data

Agents treat every value as truth

The scenario:

"What's the current price for Product X?"

1
Retrieves cached price: $49.99
2
Quotes customer $49.99
3
Customer buys at $49.99
!
Actual price is $59.99 — company loses $10/unit

A human would double-check

"This price doesn't look right — didn't we update it last week?"

Humans have a smell test. They notice when data feels stale, when numbers look off, when something doesn't add up.

Agents have no smell test. They act on stale data with the same confidence as fresh data.

Every step was "correct." The data was the problem.

Schema is law: Data contracts as code


apiVersion: v3.1.0
kind: DataContract
id: product-pricing
name: Product Pricing
version: 1.0.0
status: active
schema:
  - name: product_pricing
    physicalType: TABLE
    properties:
      - name: product_id
        logicalType: string
        required: true
        primaryKey: true
      - name: price
        logicalType: decimal
        required: true
        quality:
          - type: custom
            expression: "price > 0"
      - name: currency
        logicalType: string
        required: true
        quality:
          - type: library
            metric: invalidValues
            arguments:
              validValues: [USD, EUR, GBP]
            mustBe: 0
      - name: updated_at
        logicalType: timestamp
        required: true
slaProperties:
  - property: freshness
    value: "24"
    unit: hours    # Must be < 24h for agents
            
{}

Schema enforcement

Types, nullability, constraints — no guessing

Freshness SLAs

Max staleness per dataset — nightly batch ≠ real-time agent

CI

Quality gates

Validated in CI/CD — deployment blocked on failure

Data Contract CLI — TW Radar Vol. 33
Cleanlab — TW Radar Vol. 33

For agents, schema IS law — null values corrupt vector embeddings, stale data causes wrong actions.

The quarantine pattern

Circuit breaker for data — bad data never reaches the agent

1
Data In
Raw data from sources
APIs, databases, streams, files
2
Validate
Contract check
Schema · Freshness · Quality rules
✓ Pass
Agent-ready data
Gold tier · Trusted
✗ Quarantine
Dead letter queue
Human review · Alert

Better for an agent to say "I don't know" than to act on bad data.

The agent gets silence instead of poison. That's a feature, not a bug.

Medallion architecture for agents

Raw → validated → certified → agent-optimized

Bronze
Raw

Immutable ingestion. Full audit trail and lineage preserved.

Silver
Validated

Deduplicated, schema-applied. Contract-validated for agent retrieval.

Gold
Certified

Semantic layer applied. Governed access, trusted metrics.

Adaptive Gold
Agent-curated

Agents monitor queries, materialize optimized datasets.

Adaptive Gold is new

Agents as active participants in data curation, not just consumers. They monitor frequent query patterns and materialize optimized views.

Key principle

Agents should only access Gold or above. Bronze and Silver exist for lineage and debugging — never for agent consumption.

Confidence-threshold routing

1
Agent processes request
Assesses data quality signals
2
Confidence score
Based on freshness, completeness, consistency
≥ 85% confidence
Autonomous action
Agent proceeds safely
< 85% confidence
Defer to human
Review → feedback loop

Pricing scenario revisited

Price data is 3 days stale.

Freshness SLA: 24 hours → violated.

Confidence drops below threshold.

"I'm not confident this price is current. Routing to a human for verification."

Key insight: Thresholds should be based on data quality signals (freshness, completeness, consistency) — not just model confidence.

Not every decision needs a human. Not every decision should skip one.

What you can do Monday morning

1

Define freshness SLAs

For every dataset agents touch, specify max staleness. Nightly batch ≠ real-time agent. A pricing dataset that's fine at 24h for dashboards may need <1h for a quoting agent.

2

Implement quarantine gates

Validate before ingestion. Dead letter queue for violations. Never feed bad data to agents. Start with your highest-risk datasets.

3

Start with Data Contract CLI

Define contracts as code. Validate in CI/CD. Block deployments on contract violations. Version your contracts alongside your schemas.

4

Add confidence routing

When data quality signals are low, defer to human review instead of autonomous action. Start with a high threshold (90%) and adjust down as trust builds.

Next up: Agents act on quality data — but who's watching? → Traceability & Governance


2

Traceability & Governance

Auditing Autonomous Agents

The audit gap

Trade finance scenario

Agent processes letter of credit: checks customer KYC, verifies compliance rules, approves $2.4M transaction — all in 30 seconds.

6 months later…

A regulator asks: "Why was this approved?"

Can you answer with full reasoning chains? Or just timestamps and table names?

Traditional audit

"What" happened — which tables were accessed, timestamps, user IDs

Agentic audit

"Why" — which sources did the agent consult, what reasoning chain led to the decision, what alternatives were considered and rejected

The gap between these two is where regulatory risk lives.

Agentic lineage

Not just "what was accessed" — but "WHY the agent decided to access it"

▶ Trace: Process letter of credit #LC-4892
1
Retrieved customer KYC data
source: compliance DB → result: verified
2
Checked sanctions list
source: OFAC API → result: clear
3
Evaluated credit terms
source: policy engine → result: within limits
Decision: APPROVE
confidence: 94% · reasoning: "All compliance checks passed, credit within policy limits"
T

Traces

End-to-end agent workflow, like a distributed request

S

Spans

Individual steps — data access, reasoning, decisions

A

Annotations

Confidence scores, reasoning chains, sources consulted

Langfuse Arize OpenTelemetry for AI
€15M
or 3% global turnover — EU AI Act penalty
for record-keeping breaches

Articles 12 & 19 requirements

Automatically log events (Art. 12) — traceable, not just timestamps

Retain 6+ months (Art. 19) — full audit trail with decision context

Explain "why" — which data sources, what logic, what alternatives were considered

Not just EU — similar regulations emerging in US (NIST AI RMF), UK, Singapore

Staged autonomy

Trust is earned, not assumed

1

Shadow mode

Agent recommends, human decides. Full logging of what agent would have done.

2

Supervised

Agent acts, human approves before execution. Full audit trail.

3

Autonomous with guardrails

Agent acts within defined boundaries. Alerts on exceptions.

4

Full autonomy

Agent acts independently. Continuous monitoring, spot-check audits.

The analogy

Like onboarding a new employee. You don't give them the corporate credit card on day one.

New hire starts with supervision, earns autonomy as trust builds. Same principle for agents.

Each stage requires

More trust — proven reliability at the previous level

More observability — increasing monitoring scope

More governance — stronger audit trails and controls

Delegated access & JIT credentials

✗ Broad service account

Agent uses shared credentials

Accesses all customer data

Persistent tokens — never expire

"Who did this?" — no attribution

✓ Delegated + JIT

Agent inherits user's permissions

Scoped access — only Alice's data

Short-lived token — expires after task

Full attribution — who, what, why

🔒

Delegated access

Agents inherit invoking user's permissions, not broad service accounts

Just-in-time credentials

Short-lived tokens issued per task, expire on completion

Least privilege

Minimum access needed for the specific task — nothing more

What you can do Monday morning

1

Instrument from day one

Add traces and spans to every agent workflow. Use Langfuse, Arize, or OpenTelemetry. Retrofitting observability is 10x harder than building it in.

2

Start in shadow mode

Deploy agents that recommend but don't act. Build the audit trail before you need it. Measure accuracy before granting autonomy.

3

Implement delegated access

Agents inherit user permissions, not service accounts. Issue JIT credentials for every task. No persistent tokens.

4

Build for the regulator

Design audit trails to answer "why did the agent do this?" not just "what did the agent do?" Think EU AI Act Article 12.

Next up: Now that data is trusted and governed, agents need context. → Semantic Layers


3

Semantic Layers

Teaching Agents What Your Data Means

Your agent doesn't know what "revenue" means

The agent receives:

"What was Q3 revenue for Product X?"

It doesn't know:

→ Which table to query

→ Gross sales or net of returns?

→ What "Q3" maps to in your fiscal calendar

→ Which joins connect products → orders → revenue

Your analyst knows all of this

Two years of institutional knowledge, absorbed through osmosis, tribal docs, and Slack threads.


Your agent has none of it.

What a semantic layer actually is

A declarative translation layer between business language and data

📐

Metric Definitions

How "revenue" is calculated — order_amount - discount_amount

🔗

Entity Relationships

How customers → orders → products connect — join paths, foreign keys, cardinality

📏

Business Rules

Fiscal calendars, access controls, valid dimensions per metric, time grains

Version-controlled Peer-reviewed CI/CD testable

Agents & BI Consumers
Natural language queries, dashboards, APIs
▲ governed access ▼
Semantic Layer
Metrics · Entities · Rules · Access controls
Defined as YAML in Git — single source of truth
▲ abstracts ▼
Raw Data Layer
Tables, schemas, views, warehouses

Change "revenue" once → propagates everywhere

Metrics as code


semantic_models:
  - name: orders
    entities:
      - name: order_id
        type: primary
      - name: customer_id
        type: foreign
    measures:
      - name: revenue
        agg: sum
        expr: order_amount - discount_amount
    dimensions:
      - name: order_date
        type: time
        type_params:
          time_granularity: day
            

Agent asks:

"What was Q3 revenue for Product X?"

▼ semantic layer resolves to

SELECT SUM(order_amount - discount_amount)
  FROM orders o
  JOIN products p ON o.product_id = p.id
 WHERE p.name = 'Product X'
   AND o.order_date
       BETWEEN '2025-07-01'
           AND '2025-09-30'
            

dbt MetricFlow — similar patterns in Cube.js, Snowflake Semantic Views, Databricks Metric Views

Same question, very different SQL

"What was Q3 revenue for Product X?"

Without semantic layer


-- Agent guesses table names
SELECT SUM(amount)
  FROM sales_data
 WHERE product = 'Product X'
   AND quarter = 'Q3'
            

Wrong table · Uses gross amount not net · No fiscal calendar mapping · Missing join to products

With semantic layer


-- Constrained by metric definition
SELECT SUM(order_amount
         - discount_amount)
  FROM orders o
  JOIN products p
    ON o.product_id = p.id
 WHERE p.name = 'Product X'
   AND o.order_date
       BETWEEN '2025-07-01'
           AND '2025-09-30'
            

Correct table · Net revenue formula · Fiscal Q3 resolved · Valid join path

How agents use it

🤖 Agent
1
NL question
"Revenue by region, Q3"
🧠 Semantic Layer MCP
2
Metric lookup
Definitions, valid dimensions, join paths, access rules
3
Constrained SQL
Only valid dimensions — no guessing
🗃️ Data Warehouse
4
Query execution
Runs constrained SQL against governed tables
5
← Result returns to agent with lineage — which definition was used, how it was calculated, full audit trail

The semantic layer constrains the LLM — only valid dimensions appear for selected metrics. That's a feature, not a bug.

What you can do Monday morning

1

Audit your tribal knowledge

Identify your top 10-15 business metrics. Document how they're actually calculated today. You'll find 2-3 conflicting definitions for the important ones.

2

Define metrics as code

Pick a tool that fits your stack:
dbt → MetricFlow Standalone → Cube.js
Snowflake → Semantic Views

3

Expose it to your agents

Connect via MCP server or API. The agent queries the semantic layer, never the raw schema.

4

Test with adversarial questions

Ask ambiguous terms, edge cases, cross-domain joins. Every hallucination = a gap in your semantic definitions.

Anti-pattern: Don't boil the ocean — start with the metrics your first use case needs, not a full warehouse model.

Next level: Knowledge Graphs

When relationships matter more than metrics

"Which customers bought Product X but churned after we changed the pricing in Q2?"

Multi-hop reasoning across entities, events, and time — flat tables can't answer this.

GraphRAG — TW Radar: Trial
Graphiti — TW Radar: Assess · Temporally-aware
Customer
bought
Product X
churned after
Pricing Change

3 entities · 2 relationships · multi-hop traversal

Semantic layers → structured metrics  |  Knowledge graphs → relationship reasoning  |  Together → institutional memory

Next up: Agents understand your data — but can they act on it? → From Searchable to Actionable


4

From Searchable to Actionable

Agent-Ready Data Access

Your agent can read, but it can't act

The scenario:

"I see that all the payments for the PO's are not yet received for Party Foo."

1
Retrieve troubleshooting guide
2
Check live PO service status
3
Create helpdesk ticket

Traditional RAG stops at step 1

RAG can search documents — it retrieves the right troubleshooting guide.

But it can't query live systems to check if the PO's are actually received for Party Foo right now.

And it can't take action — no ticket creation, no status update, no workflow trigger.

Agentic AI needs data that's not just searchable — it's actionable.

The data access spectrum

Three tiers — most organizations are stuck at Tier 1

Tier 1 · Read
Retrieval

RAG, vector search, document lookup

PO System: retrieve troubleshooting guide

Embeddings Vector DB
Tier 2 · Real-time
Structured queries

Live APIs, database reads, service status

PO System: check payment status NOW

MCP-Read APIs
Tier 3 · Write-back
Controlled mutations

Create records, trigger workflows, update state

PO System: create helpdesk ticket

MCP-Write Tools

Most orgs are stuck at Tier 1. Agentic AI requires all three.

MCP: USB-C for AI

"One protocol to connect any AI model to any data source or tool."

— Anthropic, Model Context Protocol specification
BEFORE: N × M
M1
M2
M3
⤫ ⤫ ⤫ ⤫ ⤫ ⤫
T1
T2
T3
9 custom integrations
AFTER: N + M
M1
M2
M3
┃   ┃   ┃
MCP
┃   ┃   ┃
T1
T2
T3
6 standard connections
97M

SDK Downloads / mo

Official MCP SDKs, early 2026 (from ~2M/mo at launch)

10K+

MCP Servers

Community and vendor-built integrations

Agentic AI Foundation

Joined Dec 2025 (hosted by Linux Foundation) — open governance

Adopted by:

Anthropic OpenAI AWS Google Microsoft

Three primitives, one protocol

Resources
Read

Expose data for agents to read. Structured, discoverable, schema-described.

PO System: troubleshooting docs, config data

Safe — read-only
Prompts
Templates

Reusable interaction patterns. Shape how agents approach tasks.

PO System: IT triage workflow template

Shapes behavior
Tools
Write

Functions agents can invoke. Real-world side effects.

check_po_payment_status()
create_ticket()

Real-world consequences

Risk escalates left to right: safeshapes behaviorreal-world consequences

Anti-pattern: Naive API-to-MCP

Thoughtworks Technology Radar Vol. 33 — HOLD  ·  Design capabilities, not endpoints.

✗ 1:1 endpoint wrapping


# 50 REST endpoints = 50 MCP tools
@tool def get_po_payment_status_chicago(): ...
@tool def get_po_payment_status_nyc(): ...
@tool def get_po_payment_status_london(): ...
@tool def create_po_payment_ticket(): ...
@tool def create_po_payment_ticket_network(): ...
# ... 44 more tools
            

50 tools → agent can't choose correctly
No business context · Tool sprawl kills accuracy

✓ Business capabilities


# 3 capabilities with rich descriptions
@tool
def check_service_status(
    service: str, location: str
) -> ServiceStatus:
    """Check real-time health of any
    infra service by name & location."""

@tool
def create_support_ticket(
    category: str, priority: str
) -> Ticket: ...
            

3 tools → clear agent decisions
Rich descriptions · Parameterized · Composable

LLMs are bad at choosing from large tool sets. 5-10 well-described capabilities beat 50 thin wrappers.

MCP + A2A: The full protocol stack

🤖
IT Support Agent
A2A
🤖
Ops Agent
A2A
🤖
Ticketing Agent
┃ MCP
┃ MCP
┃ MCP
Knowledge Base
Docs · Runbooks
Monitoring APIs
Status · Logs · Metrics
ServiceNow
Tickets · Workflows

"Build with any framework. Equip with MCP. Communicate with A2A."

— Google, Agent-to-Agent Protocol announcement · 150+ supporting organizations

MCP = vertical (agent ↔ tools)   |   A2A = horizontal (agent ↔ agents)

End to end: PO Payment scenario

1
Retrieve
RAG lookup
PO System troubleshooting guide, payment status, known issues, request payments steps, etc.
Resource
2
Query
check_po_payment_status()
Payment system DOWN since 08:47. Affects 23 PO's.
Tool (read)
3
Act
create_po_payment_ticket()
Priority: High. Auto-routed to ITOps. 23 affected users linked.
Tool (write)

What you can do Monday morning

1

Map your data access tiers

Pick your top 3 agent use cases. For each, classify what's needed: read-only retrieval, real-time structured access, or write-back actions. Most gaps are in Tiers 2 and 3.

2

Design capabilities, not endpoints

Group your APIs into 5-10 business capabilities with rich descriptions. Think "what can this agent do?" not "what endpoints exist?"

3

Start with MCP Resources

Read-only first — lowest risk, immediate value. Expose knowledge bases and configuration data. Graduate to Tools only after governance is in place.

4

Instrument from day one

Log every tool invocation: who triggered it, what was called, when, and on behalf of whom. You'll need this for audit and debugging.

We've covered all four pillars. Next → The reference architecture that ties it all together.

The AI-ready data stack

Every layer depends on the one below it

4
Observability Layer
Traces, agentic lineage, reasoning chains, governance controls
Traceable Governed
Topic 2
3
Agent Access Layer
MCP, function-calling APIs, A2A, capability-oriented tools
Operational
Topic 4
2
Semantic Context Layer
Semantic layer, knowledge graphs, metadata, metric definitions
Contextual
Topic 3
1
Data Foundation
Contracts, quality gates, medallion architecture, freshness SLAs
Trusted
Topic 1

Four things to take home

1

Context over models

Semantic layers are the highest-ROI investment. The <20% → 95%+ accuracy gap isn't about the model — it's about the context you give it.

2

Read before write

Start with MCP Resources (read-only), graduate to Tools (write) with governance. Staged autonomy, not all-or-nothing.

3

Contract everything

Freshness SLAs, schema enforcement, quarantine bad data. Agents can't smell bad data — your architecture has to.

4

Instrument from day one

Traces and spans in every agent workflow. Retrofitting observability is 10x harder. Build for the regulator before they ask.

"When agents become your primary data consumers, the architecture of your data IS the architecture of your AI."

O'Reilly Architecture SuperStream


Thank You



Pramod Sadalage
Distinguished Engineer, Thoughtworks
Prem Chandrasekaran
Market Tech Director, Thoughtworks