The question behind the buzzword
Everyone's talking about AI agents, but what does "decide" even mean when the thing doing it is just predicting words? If you've watched a demo of an AI agent booking a flight, writing a report, or sending emails on its own, you've probably wondered: is it actually thinking, or is it just very fast guessing? The honest answer is closer to the second one — but that doesn't make it any less useful. It just means you need to understand what's really happening under the hood before you hand over your business processes to one.
At TokenByToken, we work with Australian small business owners who want straight answers. Tradies, mortgage brokers, accountants, consultants — people who don't have time to decode Silicon Valley jargon. So here's the plain-English version of how AI agents make decisions, what they can actually do for your business, and where they'll still stuff it up if you're not watching.
"AI is not magic. It's a very fast, very patient assistant that can read, write, and follow instructions — but only if those instructions are clear, and only if someone is checking its work."
— The working definition I use with clients
The loop: observe, reason, act
Every AI agent runs on a loop. It goes around and around, and each lap has three steps: observe, reason, act. Some people call this the "agent loop" or compare it to the OODA loop (Observe, Orient, Decide, Act) that fighter pilots and military strategists use. The idea is the same. The agent looks at the world, thinks about what to do, does something, and then starts again.
Here's the key: the agent doesn't "know" anything. It has no common sense, no intuition, no gut feeling. Every lap of the loop, it starts fresh from the information it can see at that moment. That's why the loop matters so much. If something breaks in the observe step, the rest of the loop is guaranteed to go wrong.
Think of it like a tradie walking onto a job site. First, they look around — what tools are here, what's the job, what's broken? Then they think about what needs doing and in what order. Then they pick up a tool and do the work. Then they look again to see if the fix held, or if something else needs attention. An AI agent does the same thing, except its "tools" are software functions, its "job site" is data and messages, and it never gets tired or distracted. But it also never notices the smell of gas or sees that a client looks worried. It only sees what you feed it.
Step 1: Observing — what the agent can see
The observe step is where the agent gathers information about its current situation. This might include:
- New emails or messages in a Slack channel
- Changes to a spreadsheet or database
- The result of a web search it just ran
- What a user just typed into a chat window
- Output from a previous action (like a file it just read)
None of this happens automatically. Someone has to build the connections. If you want an agent to watch your Gmail inbox, you need to give it access to the Gmail API. If you want it to check your CRM, you need to hook it up. The agent is blind to everything else. It doesn't browse the internet on its own unless you give it a search tool. It doesn't know your calendar unless you connect it.
Here's where it gets tricky. The amount of information an agent can "see" in one go is limited. This is called the context window, and it's measured in tokens (roughly, words or word-pieces). A typical agent might have a context window of 4,000 to 128,000 tokens. That sounds like a lot, but if you're feeding it long emails, PDFs, and conversation history, it fills up fast. Once the context window is full, the agent starts forgetting the oldest things. It's like trying to hold a long meeting where everyone keeps forgetting what was said in the first ten minutes.
Real-world example: Mortgage broker follow-up agent
Suppose you're a mortgage broker and you build an agent that watches your inbox for new loan applications. The agent observes:
- A new email arrives with a client's financial documents attached
- The agent reads the email, downloads the PDF, and extracts the key numbers
- It checks your CRM to see if this client already exists
- It looks at your calendar to find a free slot for a call
All of this is the observe step. The agent is just gathering raw material. It hasn't made any decisions yet — it's collecting the facts it needs to decide.
If the observe step is broken — say the PDF is scanned and the agent can't read it, or the CRM connection times out, or the email has 20 attachments and the agent only checks the first one — the rest of the loop will run on bad information. Garbage in, garbage out. This is the single most common failure mode for business agents.
Step 2: Reasoning — how it decides what to do
This is the step that feels like magic. The agent takes everything it observed, plus its instructions, plus any memories it has access to, and it decides what to do next. But remember: it's not "thinking." It's running a large language model (LLM) that predicts what a helpful assistant would do in this situation, based on patterns it learned from training data.
Here's roughly what happens inside the reasoning step. The agent's software takes all the observed information, formats it as a prompt, and sends it to the LLM. The prompt usually looks something like this:
You are a helpful assistant for a plumbing business. You can use the following tools: check_calendar, send_sms, create_job_card, lookup_client_history. Here is what you observe: [insert all the observed data]. What is your next thought? If you need to use a tool, say which one and what parameters to pass.
The LLM then generates a response. It might say:
I need to check the client's history to see if they've had this issue before. I'll use the lookup_client_history tool with the client_id from the email.
This response is parsed by the agent software, which then actually calls the lookup_client_history function with the right parameters. The agent didn't "decide" in the human sense. It generated text that happened to describe a useful action, and the software interpreted that text as a command.
This is why reasoning can go wrong in very specific ways:
- Tool mis-selection: The agent picks the wrong tool because the prompt description was ambiguous. It tries to send an SMS when it should create a job card.
- Parameter hallucination: The agent invents a parameter that doesn't exist, or guesses a client ID instead of using the real one from the email.
- Reasoning loops: The agent thinks "I need to check the calendar" then "I need to check the calendar" then "I need to check the calendar" forever, because each check doesn't give it the answer it wants and it has no memory that it already checked.
- Overconfidence: The agent decides it has enough information when it doesn't, and proceeds to act on incomplete data.
The quality of the reasoning depends almost entirely on the quality of the prompt and the tools available. A well-built agent has carefully described tools, clear instructions about when to use each one, and guardrails that stop it from looping or guessing. A poorly built agent is like a new apprentice with a vague brief and no supervision — it'll do something, but it might not be what you wanted.
Real-world example: Accountant's end-of-quarter workflow
An accountant builds an agent to process quarterly BAS lodgements. At the reasoning step, the agent looks at:
- The list of unprocessed client files
- Each client's previous BAS history
- Whether required documents are present
- Any flagged anomalies in the numbers
The agent then decides: "Process Client A first because their file is complete and has no flags. Use the prepare_bas tool with client_id=A and quarter=Q3." That's a reasoning step. If the agent had instead said "Process all clients at once" or picked a client with missing documents, the reasoning would be flawed — and the action step would fail or produce bad output.
Step 3: Acting — what it actually does
Once the agent has reasoned its way to a decision, the action step is where it actually does something in the real world. This might mean:
- Calling an API to send an email or SMS
- Writing data to a spreadsheet or database
- Generating a PDF report
- Triggering a webhook to another system
- Posting a message in Slack or Teams
- Creating a calendar event
- Running a calculation or analysis
The action step is where the agent touches your actual business systems. This is also where the most damage can be done. A reasoning error is just a bad thought. An action error sends the wrong email to a client, deletes a database row, or books a meeting at 3am.
Good agent design includes safeguards here. Actions should be:
- Reversible where possible: Draft the email, don't send it. Create the job card, but set it to "pending review."
- Logged: Every action should be recorded with a timestamp and the reasoning that led to it, so you can audit later.
- Rate-limited: If the agent gets stuck in a loop, it shouldn't send 500 emails in ten minutes.
- Scoped: The agent should only be able to touch the systems and data it needs. It doesn't need admin access to your entire AWS account to send a Slack message.
Real-world example: Tradies dispatch system
A plumbing business builds an agent that assigns jobs to available plumbers. The action step might look like this:
- Agent observes a new job booking via email
- Agent reasons: "Job is in Marrickville, blocked drain, urgent. Plumber B is closest and has no jobs after 2pm. Assign to B."
- Agent acts: Creates a job card in the dispatch system, sends an SMS to Plumber B with the address, and emails the client to confirm the booking.
If the action step fails — say the SMS sends but the job card creation fails — the client gets a confirmation but the plumber has no record. The system is now inconsistent. This is why agents need transactional design: either all actions succeed, or none do, and a human gets notified.
After the action, the loop goes back to observe. The agent checks the result of what it just did. Did the SMS send? Was the calendar updated? Did the API return an error? This closes the loop and either continues the task or stops if the goal is achieved.
Memory: the agent's notebook
So far, we've talked about the agent as if it only sees what's in front of it right now. But some agents have memory — a way to remember things from one loop to the next, or even from one day to the next. This is where agents start to feel less like a chatbot and more like a real assistant.
There are two types of memory you need to know about:
Short-term memory (context window): This is everything the agent can see in the current conversation or task. It's fast, always available, and limited by the token cap we discussed earlier. If the agent is processing a long task, older parts of the conversation get pushed out. It's like having a very detailed conversation with someone who forgets the beginning once it gets too long.
Long-term memory (vector database, notes, state files): This is where the agent stores information it wants to keep beyond the current task. Common approaches include:
- Vector databases: The agent stores facts as embeddings (numerical representations) and can search them later by semantic similarity. "What did I learn about this client's preferences?"
- Structured notes: The agent writes to a file or database in a structured format (JSON, markdown) that it can read back in future tasks.
- State files: A file that tracks the current status of ongoing tasks — like a project manager's whiteboard that persists between sessions.
Memory is powerful, but it's also fragile. If the agent writes incorrect information to its long-term memory, it will keep repeating that mistake. If two agents share the same memory and one writes garbage, the other one reads it. If the memory search returns irrelevant results because the embedding similarity was tuned poorly, the agent will act on bad context.
A good rule of thumb: memory should store facts, not reasoning. Store "Client prefers afternoon calls" rather than "Client is difficult." Store the job status, not the agent's opinion about the plumber's performance. Memory corruption is one of the hardest agent bugs to fix because it only shows up later, when the agent "remembers" something that never happened.
Where agents still need babysitting
Here's the honest truth: most AI agents running in small businesses today still need a human watching them. Not hovering over every click, but checking in, reviewing outputs, and handling exceptions. The fantasy of "set and forget" is mostly just that — a fantasy. Here are the specific failure modes that will catch you out:
Infinite loops: The agent gets stuck repeating the same observe-reason-act cycle because it doesn't have a way to recognise it's going in circles. It might check the same API 200 times, racking up costs and API rate limits. You need loop detection and a hard stop after a reasonable number of attempts.
Tool mis-selection: The agent has five tools and picks the wrong one because the descriptions were too similar or the prompt was ambiguous. It tries to "delete" when it means "archive." This is especially dangerous if the tools have real side effects.
Hallucinated parameters: The agent generates a function call with parameters that look plausible but are wrong. It invents a phone number, guesses an ID, or formats a date in the wrong way. The API call fails, or worse, it succeeds and updates the wrong record.
State corruption: The agent's memory or context gets polluted with incorrect information, and it starts making decisions based on false premises. This is the agent equivalent of a bad game of telephone — each loop slightly distorts the truth until it's unrecognisable.
Cost explosions: Every loop costs money. LLM calls cost per token. API calls might have fees. If an agent gets stuck in a loop or handles a high volume of tasks, a $50 monthly bill can become $500 overnight. You need budget caps and monitoring.
Silent failures: The agent fails but doesn't tell anyone. It logs an error to a file you never check, or it marks a task as complete when it actually gave up. The worst failures are the ones you don't notice until a client calls asking why nobody replied to their urgent email.
The fix for all of these is not better AI — it's better engineering. Guardrails, logging, human review steps, rate limits, and fail-safes. The AI does the grunt work. The human does the quality control. That's the model that actually works today.
The reality check: what this costs and what it takes
Let's talk money and time, because this is where the hype videos usually go quiet.
What it costs:
- A basic agent stack using off-the-shelf tools (Zapier, Make, Replit, OpenAI API) will run you roughly $50 to $200 per month in software and API fees. That's for a simple agent handling a single workflow with low volume.
- A more serious setup with custom code, a vector database, proper logging, and multiple integrations will land in the $200 to $800 per month range, not including your time or a developer's.
- A fully custom-built agent with tailored tools, security review, and ongoing maintenance typically costs $2,000 to $8,000 upfront in development, plus ongoing monthly costs.
What it takes:
- A demo that looks impressive in a video: about 20 minutes to set up with a pre-built template.
- An agent that actually works reliably in your business: 20 to 40 hours of design, testing, debugging, and iteration. That's if you know what you're doing. If you're learning as you go, double it.
- Ongoing maintenance: plan for 2 to 5 hours per month reviewing logs, fixing edge cases, updating prompts when the underlying AI model changes, and adjusting tools when your business processes change.
Why the gap between demo and production? Because demos show the happy path. The real world throws curveballs: malformed emails, API downtime, clients who type in all caps, spreadsheet columns that got renamed, and the hundred other ways reality diverges from the test case. Building an agent that handles the happy path is easy. Building one that fails gracefully when things go wrong is the hard part.
Also, the AI models themselves change. OpenAI, Anthropic, Google, and others update their models regularly. A prompt that worked perfectly last month might behave differently this month because the underlying model was retrained. This is not a bug you can fix — it's a maintenance reality. You need to budget time for prompt regression testing, just like you'd test software after an update.
What to do next
If you've read this far, you now understand more about AI agent decision-making than most of the people selling them. You know it's a loop: observe, reason, act, repeat. You know the agent doesn't think — it predicts. You know tools are just APIs and functions, memory is just stored notes, and failure is not a possibility but a certainty that needs planning for.
The next step isn't to go build an agent tonight. It's to identify one tedious, repetitive workflow in your business that follows clear rules and has clear inputs and outputs. Maybe it's the follow-up sequence after a new client enquiry. Maybe it's the checklist your accountant runs at end-of-quarter. Maybe it's the way you dispatch jobs to your tradies. Pick something small, something bounded, and something where a mistake is annoying but not catastrophic.
Map out the observe-reason-act loop for that workflow. What does the agent need to see? How should it decide? What actions should it take? Where would it fail? Where does a human need to check its work? That map is your specification. If you can write that down clearly, you're 80% of the way to building something useful — whether you build it yourself, use a no-code tool, or hire someone to do it properly.
Start there. Start small. Start with your eyes open.
Need a hand mapping your first agent workflow?
TokenByToken works with Australian SMBs to design practical AI systems that actually work. No jargon, no overpromising — just honest help with the boring stuff that takes up your time. Get in touch if you want to talk through what's possible in your business.