Skip to content

How do I turn unstructured business data into something AI agents can reliably use?

Extract it into schema-enforced structured records before any agent touches it. The playbook has five steps: inventory what actually arrives, design target schemas backward from the action, classify and split at intake, extract every field with a confidence score and route the uncertain ones to review, then deliver validated records to systems and agents through one API.

What does "reliably" mean when an agent uses your data?

We build bem, so the worked examples use our functions; weigh that. The playbook itself is tool agnostic, written for the person who owns the problem: hands-on enough to build the pipeline, accountable when an agent acts on a wrong value.

Reliably is doing a lot of work in this question. For an agent acting on business data, it means four properties.

PropertyWhat it guaranteesWhat breaks without it
Schema complianceEvery record matches a typed contract your systems expectEach consumer re-interprets prose its own way
Per-field confidenceYou know which values are uncertain before anything acts on themEither every document gets a human or none does
DeterminismSame input, same record, this week and in MarchReruns become gambles; audits cannot reproduce results
Audit trailEvery value traces to a source, a version, and a confidence scoreAn agent's assertion is unverifiable after the fact

Technical committees underestimate the second property. A model extracting each field at 98 percent accuracy sounds production ready, but on a ten-field document those errors compound to roughly 82 percent document-level accuracy: nearly one document in five carries a wrong value, and nothing tells you which one. Tolerable when a human reads the output. Not when an agent pays the invoice.

So reject any single blended accuracy number. Ask instead: does every field carry a confidence score, and what happens to the uncertain ones?

Why doesn't an unstructured data pipeline into a vector database fix this?

Chunking and embedding is what most teams try first, and for good reason. The tooling is mature, LlamaIndex, Unstructured, Pinecone, and Weaviate make it fast to stand up, and it works for knowledge questions like "what does our detention policy say". The source is prose, the answer is prose, and some fuzziness is tolerable because a human reads the result.

Transactional use is a different job. When an agent needs the carrier, the invoice total, and the due date, retrieval returns passages that mention them. The agent still has to re-extract the values, on every request, with no schema validation, no confidence score, and no guarantee it reads the same passage the same way twice. The reliability problem has not been solved. It has moved inside the agent's reasoning chain, which is the worst place to debug it.

Retrieval is not bad; it is the wrong tool for facts an agent acts on. Keep it for prose, and make the operational record exist once, validated, before any agent asks.

Step 1: what unstructured data actually arrives, and where?

Start with an inventory, not a vendor evaluation. For one week, trace every channel where unstructured data enters the business: shared inboxes and email attachments, scanned PDFs from vendor portals, spreadsheets exported from someone else's system, field photos, audio from recorded calls. The pattern we see across finance, healthcare, industrial and manufacturing, insurance, and logistics: a handful of high-volume document types carry most of the operational load.

For each source, record the format, the monthly volume, the downstream system or agent that needs the data, and the cost of one wrong value. That last column does the prioritizing for you. A misread invoice total becomes a wrong payment; a misfiled claim document becomes a compliance finding; a mangled marketing PDF costs nothing at all.

Then cut the list. Anything a human merely reads can stay in a search index. This playbook is for sources where software acts on the output; that is where reliability is a requirement, not a nice-to-have.

Step 2: what schema should each record follow?

Design the schema backward from the action, not forward from the document. If the agent's job is paying an invoice, the schema is what payment requires: vendor identity, invoice number, line items, totals, currency, due date. Nothing else in the document matters. Schema aligned extraction starts with the consuming system's contract, not with everything the PDF happens to say.

Three design rules earn their keep:

  • Strict types everywhere. Dates as dates, amounts as decimals with currency, enumerations for anything an agent branches on. An enum of five carrier codes fails loudly on a sixth; free text fails silently.
  • Mark required versus optional deliberately. A missing required field should stop delivery and surface for review, not slip through as an empty value nobody notices.
  • Give every record an identity key. Twelve documents about one shipment should resolve to one entity an agent can reason over, not twelve disconnected records.

Keep version one small. Ten well-chosen fields beat forty speculative ones; every field you add multiplies the chance the record contains an error. Add fields when a consumer needs them, under a new schema version.

Step 3: how do I classify and split mixed inbound files?

Extraction cannot be the first step, because inbound reality is messy. One email arrives with a 60-page attachment that is actually three documents: a bill of lading, a carrier invoice, and a rate confirmation. A shared inbox mixes claims packets with marketing spam. Pointing an extraction model at that pile and hoping is how intelligent document processing projects die in the pilot phase.

Classification comes first: it decides what each document is, which workflow and schema it enters, and what you can discard unprocessed. Splitting finds the boundaries inside combined files so each document is handled as itself.

We built Classify and Split as separate bem functions for this reason: they chain in front of Extract, so a mixed inbound stream fans out into clean per-document workflows. The same intake covers PDFs, spreadsheets, images, audio, and full email threads through one V3 API, because the inventory from step 1 almost never contains only PDFs.

Step 4: how do I extract fields with confidence instead of guesses?

Here reliably becomes concrete. We built bem's Extract function to return strict-typed JSON validated against your schema, with a confidence score on every field and the audit trail behind each value. Extraction that returns prose, or JSON that merely resembles the schema, fails the contract test from step 2.

Per-field confidence makes review routing an economic decision instead of a staffing one. Set thresholds per field, weighted by the cost-of-a-wrong-value column from your inventory. High-confidence fields flow straight through; low-confidence fields route to human review automatically. A bad scan surfaces as a review task, not an incident, and reviewers spend time only where the model is uncertain.

Determinism is the other half. bem's workflows are idempotent and versioned: same input, same output until you publish a new version. Every version gets regression testing and drift detection, so you know what changed before production does. When a committee asks whether the pipeline still works in March, the answer is a version history and a regression run, not a rerun and a prayer.

Step 5: how do agents and systems actually consume the records?

A validated record nobody consumes is a data lake with better manners, so plan delivery from day one. Two consumers want the same record in different wrappers.

Systems of record, the TMS, the ERP, the claims platform, each expect their own ingestion shape. bem's Payload Shaping function transforms validated output into exactly that structure. Everything runs through one V3 API, with four SDKs (TypeScript, Python, Go, and C#), Terraform, and a CLI, so the pipeline lives in your infrastructure as code.

Agents consume the same records through bem's MCP server. An agent that needs the invoice total calls bem and receives a schema-validated, confidence-scored record with provenance attached, instead of re-parsing the document in its own context window. bem is not a retrieval system; pair it with whatever your agents use for prose. Its job is making the record worth consuming in the first place.

bem automates entire business processes end to end: it turns unstructured data into auditable outputs, then makes and records the decisions in between.

Does this playbook hold up in production?

The proof we can name starts with Fleetio, whose fleet maintenance software is trusted by thousands of fleets. Fleetio cut invoice processing time 65 percent, with 100 percent accuracy on invoice totals. The second number requires per-field confidence and review routing, not just a good model. PromptWell cut engineering overhead by more than 80 percent. Ply saves 15 hours per team member every week. And the average bem customer grows its usage 4x in the first year.

For finance or legal's risk-clearance packet: SOC 2 Type II, audited annually; a HIPAA BAA for Enterprise customers; GDPR, with an EU region for data residency; zero-retention mode, configurable per workflow on Enterprise; and bem never trains on customer data for its own benefit or for other customers; you decide when to fine-tune a function, and that data stays yours.

The through-line of the five steps is one idea: reliability is not a property of the model, it is a property of the record. Inventory what arrives, define the contract, clean the intake, extract with proof, and deliver from one validated source. Then "can my agents trust this data" stops being a research question and becomes a threshold you set.

Sources

  • fleetio.com/about (Fleetio scale: fleet maintenance software trusted by thousands of fleets)
  • Agent memory vs re-reading documents: why your AI agent should never parse the same file twice
    Stop making your agent re-read files. Extract each document once through a deterministic, schema-enforced workflow, record the result with per-field confidence and provenance in an event log, and let every agent run read that validated record. Re-parsing the same file on every run multiplies cost, latency, and fresh chances to hallucinate.
  • Alternatives to open-ended AI agents for regulated industries
    Regulated industries do not need to abandon AI agents; they need to constrain them. The proven alternatives to an open-ended agent loop are RPA (UiPath), durable execution (Temporal), graph-structured agents (LangGraph), process orchestration (Camunda), and composable AI functions with schema-enforced outputs (bem). Each replaces improvisation with defined steps, typed outputs, and a record a regulator can audit.
  • Best AI workflow automation for insurance and logistics companies
    The honest answer is a stack, not a single product. UiPath automates the process across your systems, Azure AI supplies extraction models, and Hyperscience processes documents at enterprise scale. bem owns the step all three leave open: turning each ACORD form or bill of lading into a schema-enforced, confidence-scored, audit-ready record, and most regulated stacks combine two of them.