AI in the Data, Code in the Process

Hero image for AI in the Data, Code in the Process

If you need the same answer twice, don't use AI.

I learned this the hard way during a project where headquarters mandated to use OpenClaw - an AI orchestration platform and workflow automation tool that had been making the rounds in tech publications. The requirement wasn't driven by the problem we were solving. It was driven by visibility. Decision-makers had heard this name everywhere.

The actual work was straightforward: automate a set of multi-step tasks with clear inputs, clear outputs, and deterministic logic. Nothing ambiguous. Nothing requiring interpretation or context-aware responses. Just reliable, repeatable processing that needed to happen the same way every time.

The specified architecture would have required dedicated hardware installations, per-machine configurations, and staff training on platforms they didn't need to understand. The overhead was significant. The justification was probably to some extend trend-driven.

I restructured the project. Removed this tool from the design. Replaced it with clean deterministic code — written efficiently with AI assistance during development, but deterministic in execution. No orchestration platform. No hardware purchases. Everything moved to the cloud with a simplified workflow.

The project shipped faster, ran cheaper, and required less maintenance. But the resistance was still there. Removing AI-powered tools felt like a step backward to stakeholders who equated sophistication with AI agents handling every step in the process.

Where AI Actually Belongs

The confusion comes from treating AI as a universal architecture instead of understanding where non-determinism is a feature versus where it's a liability.

AI belongs where you need interpretation. When I built a knowledge base during a company meeting — connecting training manuals, support tickets, and recorded sessions into a searchable system — the value was in AI's ability to understand natural language queries and synthesize information across disconnected sources. The same question asked in slightly different ways should return contextually relevant answers. Non-determinism was exactly what I needed there.

But business logic, transactional flows, and validation rules require the opposite characteristic. If a payment processing workflow returns different results for identical inputs, that's not intelligence — it's a bug. If an inventory calculation varies based on the AI agent's "interpretation" of the same data, your accounting is broken.

The Enterprise AI Maturity Index shows this misapplication at scale: 59% of organizations use agentic AI, but only 9% have autonomous workflows. The gap represents companies that deployed AI agents everywhere without asking which processes actually benefit from non-deterministic behavior.

The Development Versus Execution Distinction

The most productive approach separates AI assistance during development from AI execution in production. AI accelerates the creation of deterministic tools. It doesn't replace the need for these deterministic tools.

When I need to write validation logic, database queries, or API endpoints, AI helps me write them faster. But the output is still deterministic code that behaves predictably in production. AI assisted in the creation process. But it doesn't run the process.

This distinction matters because failure modes are different. AI assistance during development fails gracefully — you review the code, test it, and fix what doesn't work. AI execution in production fails unpredictably — the same input might produce different outputs depending on model behavior, token limits, or service availability.

Companies treating agentic AI as the universal solution are designing instability into their own systems. They're putting non-deterministic behavior in places where determinism is a business requirement.

The Cost of Misplaced Intelligence

I've seen teams spend months building AI agents to handle workflows that could have been solved with fifty lines of deterministic code. The agent approach requires prompt engineering, error handling for model failures, retry logic for API timeouts, monitoring for drift, and ongoing tuning as the model's behavior changes over time.

The deterministic approach requires writing the logic once and deploying it. The maintenance burden is lower. The behavior is predictable. The failure modes are known.

The economic argument is clear when you run the numbers. AI agents consume tokens, require specialized monitoring, and introduce operational complexity that scales with usage. Deterministic code runs at computational cost — orders of magnitude cheaper for repeated operations.

Systems need predictable behavior in their core processes. Customer data, financial calculations, and operational workflows cannot behave differently on Tuesday than they did on Monday for reasons nobody can explain.

The Data Layer Is Different

Data retrieval, analysis, and synthesis represent the opposite case. This is where AI's non-deterministic nature becomes valuable rather than problematic.

When someone queries a knowledge base, they're not looking for the same answer every time. They're looking for the most relevant answer given their specific context and phrasing. When AI analyzes customer support tickets to identify patterns, slight variations in output based on different analytical approaches can reveal insights that deterministic queries might miss.

The pattern that works is to use AI at the data layer and deterministic code at the process layer. Let AI interpret, classify, and synthesize information. Use deterministic code to act on that information in predictable ways.

A practical example: AI can analyze customer behavior data and flag accounts that might churn. But the automated response to those flags — sending specific emails, adjusting pricing, or triggering sales outreach — should follow deterministic rules. The intelligence is in understanding the data. The reliability is in how you act on that understanding.

Evaluating Where AI Belongs

When evaluating where AI fits in your system, ask which characteristic the workflow actually needs. If the same input must produce the same output, you need deterministic code. If you need interpretation, classification, or context-aware response, you need AI.

The most common architectural mistake is using AI agents to do work that should have been deterministic code — built fast with AI assistance during development, but deterministic in execution.

This evaluation changes how you approach AI implementation. Instead of asking "How can we add AI to this process?" ask "Does this process benefit from non-deterministic behavior?" Most processes don't. Most data analysis does.

The companies that get AI implementation right understand this distinction. They use AI where interpretation adds value and avoid it where consistency is required. They build AI-assisted tools quickly but deploy deterministic systems reliably.

AI in the data, code in the process. That's the architecture that actually scales.