Why Doesn’t AI do the right thing with Variables?

31 Oct. 0204 - - Total Reads 1,084

AI Process Software

Why your AI says the right thing — but doesn’t do the right thing

One of the most frustrating realities of enterprise AI is that while models like ChatGPT or Claude are excellent at talking, they’re far less reliable at doing. Specifically, passing variables — like a user’s name, a date, an ID, or a workflow command — from an AI response into your application often breaks in unexpected ways.

Why? Because LLMs don’t know your business logic. They aren’t structured programs — they’re prediction engines that guess the next most likely words. That means even when they generate the correct-sounding answer, those answers are not reliably parseable, consistent, or machine-actionable unless heavily engineered.

For example, an AI might respond with:

“Sure, I’ll schedule your meeting with Sarah at 10am Tuesday.”

But under the hood, it failed to provide a usable datetime object or reference a valid user ID. So your app has no clue what to do next.

This becomes a major issue in use cases like form submission, CRM updates, task creation, or any workflow where structured data must be extracted and executed. A chatbot might say the right thing, but unless it outputs clean variables in a predictable format — and your app knows how to interpret them — nothing happens.

How to Solve It

There are a few solutions emerging. OpenAI’s function calling or Anthropic’s tool use allow developers to define the structure of expected variables. With these tools, you can tell the AI: “Only respond using this schema” — which makes the response reliably parseable by your system.

Here’s an example JSON output from function calling:

To get there, you need to:

  1. Define your app’s expected function schemas
  2. Use models that support structured outputs (e.g., GPT-4 with function calling)
  3. Test and handle fallback cases when AI guesses incorrectly

Enterprise AI doesn’t just need to talk — it needs to act. Getting variables right is the difference between a smart-sounding bot and a truly integrated, outcome-driven system.

If you’re ready to move from potential to production, AndMine can help engineer these logic layers so your AI doesn’t just respond — it gets things done.

Michael Simonetti, BSc BE MTE
Posted by:

Post Reads: 1.1K

Share this

Go on, see if you can challenge us on "Why Doesn’t AI do the right thing with Variables?" - Part of our 183 services at AndMine. We are quick to respond but if you want to go direct, test us during office hours.

Add Your Comment

Trusted by

Scrum.org
VISSF
Kadac
Loan Market
Jalna
interact logo
Bintani Australia
Wild Rhino Shoes
Engine Swim
Matchbox Homewares
Cell Therapies
Federation Square
131 Pizza
Kay&Burton
Schiavello
HGG 
Herbert Smith Freehills
htn logo
Mark Alexander Design
Grainshaker
Xavier
Bigcommerce
skillhire logo
SunSense Digital Agency
nextgenskills logo
Bulk Nutrients
Telstra
University of South Australia
kestrel logo
Mamma Lucia
Gilchrist Connell
James Buyer Advocates
CCI
Melrose MCT
Naturtint
Passage To India
News
Australian Organic Food CO
iPrimus
Ello
Celebrate Health
Ebay
OJAY
French Tables
Switzer Media+Publishing
AC/DC
Melbourne Central
Royal Freemasons
Bondi Sands
work and training logo
Amino Active
ISO Certified
Positive Poster
Florsheim Shoes
itfe logo
ctc logo
Green St Juice CO
Federation University Australia
CAN- Common Wealth Bank
Tomorrow Stars Basketball
Forbes
The Royal Melbourne Hospital
Magento
WTFN
Craft CMS
Passage Foods
Carlton Football Club
Mecca Brands
Dinosaur Designs
SMH – The Sydney Morning Herald
Arc One
Instant RockStar
ISO CERTIFIED 27001
POSTER Magazine
Drupal
Paypal
McArthur Skincare
learning partners logo
mas national logo
Google
Grow Your Business
Bostik
Marshall White
Fast.co
Globird
Fit My Car
Tribe
Hanover
Boston Consulting Group
High Street Armadale
Beaumont
nara logo
Heat Holders
NGS Super
Crumpler
Associated Press
Madman Entertainment
BlackMores
Toy World
Uber
aga logo
intojobs logo
GooglePlay
Microsoft Certified Azure Fundamentals
Rackspace
Melrose Health
Think & Grow Rich Inc
ACTUATE IP
Palace Cinemas
SwinBurne University of Technology
Gilbert+Tobin
Movember
RMIT University
Brisbane Times
Australian Government
Fairfax Media
Victorian Government
Street Kitchen
PranaOn
The Age
Ubertas Group
LBG Australia and New Zealand
TPP
Elucent
Aqium Gel
Garmin
Coles
Launtel
Oracle
Adobe Professional
intowork logo
Grays Ecommerce
Peter Mac
Sports Power
Tek Ocean
ATT logo
Parker Lane
Cronos Australia
Ego Pharmaceuticals
Vendor Advocacy Australia
Corrs chambers westgarth
Oakdale Meat Co
Castran Gilbert
National Relay Services
Plants
Shell
Appstore
OMS – Order Management System
21st Century Australia Party
National Museum of Australia
Macpherson Kelley
Cooper Mills
Windsorsmith
liberal
Toni&Guy
Natralus Australia
Catholic Insurance
MyAccount
Hairhouse Warehouse
findstaff logo
Vitura Health
Acquia Certified Site Builder Drupal
Rock Pool Group
OpenAI
NextTech
Dial Before You Dig
Maxine
Unsw Australia
Atlantic Group of Companies
White Suede
GPT Group
Moov Head Lice
Australian Anthill
Bolle Safety
help logo
DUSA, Deakin University Student Association
The Canberra Times
Gadens
ADP Payroll
Inferflora
Jetstar
QV Skincare
Smart Company
Focus On Furniture
Taylor Rose
Sunday Creek
ABC
Novvi
Watches of Switzerland
Tassal
Macmillan Publishing
Van Egmond Group
CB Richard Ellis
Viktoria & Woods
Bank of Cyprus
Chia
Australian Physiotherapy Association
Magento Solution Specialist
Cleanfit
NMI Insurance
Eway
The Burger Cheese
Max’s
Melbourne Heart
Arthur Galan
Melbourne Sports and Aquatic Centre – MSAC
One Shift
Banki Haddock Fiora
The University Of Melbourne
Engineers Without Borders
Metricon
Rydges
Thomson Geer
MAP
DeeWhy Market
Etihad Stadium
Fresh Cheese Company
King Wood Mallesons
The Fortune Institute

Testimonials

I wanted to thank you and your teams for the responsiveness and quality of the work you have done for the french version of the site. We had a very good feedback on the quality of the site from our French network. Vincent Berlinet

More Testimonials
AndMine-Google-Partner-Signature