Archos Labs
The Execution Layer

Why Your Data Model Is Breaking Your AI Agent

Rob Angeles4 min readPublished
Share
Figure holding wrong map at junction of two diverging paths, one smooth and one jagged, under spotlight.

AI agents fail in production more often from bad data models than bad reasoning. Here's the structural difference between a reporting schema and an agent-ready one.

Your agent returns a wrong answer. You check the prompt. The model also looks fine. Two tables upstream is where the real problem lives — a customer record exists under three different IDs. Your engineers designed the schema to power a sales dashboard, not to give an autonomous process a stable reference point at runtime.

The shape mismatch nobody talks about

Reporting schemas aggregate. They're built so a human can open a dashboard and see totals and grouped summaries. An agent doesn't want totals. At each reasoning step, it needs one entity and its current state alongside the sequence of events producing state. Yao et al. showed in the ReAct paper (2022) agents interleave reasoning with external lookups on every step — which means retrieval structure is a direct input to reasoning quality, not a background concern.

Stonebraker made his 2010 argument about different workloads requiring different storage shapes with databases generally in mind, but it maps exactly onto this split. A schema optimized for GROUP BY is the wrong shape for an agent doing sequential, narrow, state-dependent reads.

What entity resolution breaks

Take a subscription billing system. The reporting schema has a customers table joined to subscriptions joined to invoices, with a few denormalized columns added over the years for dashboard convenience. An agent asked to check whether a customer is eligible for an upgrade will hit the join chain and find two rows for the same person — one from a legacy import, one from the current system. It will either pick one arbitrarily or hallucinate a reconciliation. The failure looks like reasoning drift. It's an identity problem.

Agent-oriented entity resolution requires a canonical ID layer: one authoritative identifier per real-world entity, with all aliases mapped to it in a separate resolution table. Every lookup the agent performs goes through layer first. Chip Huyen's 2024 analysis of production AI systems places data and retrieval weakness above model weakness as the more common failure cause — and ambiguous entity identity is the most common retrieval weakness I've seen in systems I've helped debug. I once spent three days convinced a GPT-4 integration was hallucinating customer tenure data. It was a duplicate row from a Salesforce sync nobody had cleaned up.

Event tables over state tables

A state table tells you what is true now. An event table tells you what happened and when. Agents need the event table. Raman et al. (VLDB, 2023) make the case for event-centric modeling in systems need traceable, durable state history — which is exactly what an agent needs when it's deciding whether to take an action depends on what changed recently.

The pattern is straightforward: instead of updating a subscription_status column, append a row to a subscription_events table with a timestamp and event type. Your agent queries the last N events for an entity rather than reading a single mutable field. This also solves a context window problem. Shen et al. (2024) identify memory limits and state handling as primary agent failure points. An event table lets you give the agent a bounded, ordered slice of history rather than a reconstructed state blob.

Lookup pattern optimization is not optional

A reporting schema built for a BI tool often has indexes tuned for full-table scans and aggregations. An agent doing hundreds of narrow lookups per session will hammer those indexes in a pattern they were never designed for. You should add composite indexes on (entity_id, event_type, created_at) for your event tables and cache the canonical ID resolution layer aggressively. Lewis et al.'s RAG paper (2020) established retrieval quality determines knowledge task performance — and retrieval latency is part of retrieval quality when an agent is mid-reasoning.

Maggie Appleton's 2024 writing on agent systems makes a point not enough people notice: agents need structured tool boundaries, not better prompts. A lookup function returns a clean, scoped payload — one entity, its resolved ID, its last ten events — is a tool boundary. A function returns a joined result set from a reporting query is not.

The counterargument worth taking seriously

Latitude (2025) and Maxim AI (2025) both argue reasoning drift and tool call failures account for most production failures — prompt injection is real too, but those are the big two. An underspecified prompt causes an agent to drift off its goal. A tool call fails because an API is rate-limited. These happen independently of schema design. The honest position is schema mismatch produces wrong-but-plausible outputs are harder to attribute than a 500 error, which means they stay in production longer and cause more downstream damage.

Fix the entity resolution table first. Add the event append table for any entity whose state your agent needs to reason about. Instrument your lookup functions to log payload size and latency per call. Those three changes will surface whether schema shape is your binding constraint before you spend a week on prompt engineering.

Share
Rob Angeles

Written by

Rob Angeles

Most consulting engagements split the thinking from the doing. Rob doesn't. Principal Consultant at Archos Labs, he owns the full stack — assessment, architecture, delivery — across retail, financial services, healthcare, and government.