CourseAgentic AI for Business
ModuleBuilding agents
Duration9 min
Progress0/12
Course material0/12 · 0%
  1. 1How a language model actually works10 min
  2. 2Prompting: turning intent into reliable instructions11 min
  3. 3Choosing your model9 min
  4. 4From chatbot to agent: the reasoning-action loop9 min
  5. 5Tools and function calling11 min
  6. 6Agent design patterns: beyond a single loop11 min
  7. 7Memory and knowledge: grounding agents with RAG11 min
  8. 8Building a knowledge base that retrieves well12 min
  9. 9Connecting to your systems: APIs, webhooks, and MCP10 min
  10. 10Guardrails, evaluation, and cost10 min
  11. 11Deploying an agent on a real workflow10 min
  12. 12Choosing what to automate: an ROI framework10 min

Lesson 4 / 12 · 9 min

From chatbot to agent: the reasoning-action loop

What turns a chatbot into an agent: tools, a loop, and the ability to take actions and observe results.

A chatbot reads a message and writes a reply. An agent can also act: it can call a tool, read the result, and decide what to do next, looping until the task is done. That loop is the whole difference, and it is simpler than it sounds.

The ReAct loop

The common pattern is called ReAct, short for Reason and Act. At each step the model produces a thought (its reasoning), then either an action (call a tool with some input) or a final answer. If it took an action, the system runs the tool and feeds the result back as an observation. The model reasons again with that new information. Repeat until it answers.

Thoughtreason about the goal
Actioncall a tool
Observationread the result
Answerwhen done
Loop Thought, Action, Observation until the model can answer
The agent loops: reason, take an action, observe the result, and repeat until it can give a final answer.
User: Is the large nitrile glove still in stock, and what is the price?

Thought: I need current stock and price. I should use the catalog tool.
Action: lookup_product({ "name": "nitrile glove", "size": "L" })
Observation: { "sku": "GLV-NTR-L", "stock": 240, "price_idr": 85000 }

Thought: In stock with a price. I can answer now.
Answer: Yes, the large nitrile gloves are in stock (240 units) at
        Rp 85.000 per box. Would you like to order?
One agent turn: reason, act on a tool, observe, then answer from the real data.

Tools are the agent's hands

On its own the model can only produce text. Tools are functions you expose to it: look up a product, check a calendar, create a CRM lead, send a WhatsApp message. The model never runs code itself, it requests a tool call, your system executes it, and returns the result. This is what lets an agent touch the real world while you keep full control over what it is allowed to do.

Planning and stopping

For multi-step tasks the model can plan: break the goal into steps, do them in order, and adapt if a step fails. Two practical guardrails matter here. Give it a step limit so a confused agent cannot loop forever, and a clear definition of done so it knows when to stop and answer rather than over-working a simple request.

Notice that nothing here requires a fancy framework. An agent is a loop around an LLM that can call tools, with limits. Understanding it at this level is what lets you reason about why one misbehaves and how to fix it.

What you take away

  • An agent = an LLM in a loop that can call tools and observe results
  • ReAct: thought, then an action or a final answer, with observations fed back
  • Tools are functions you expose; the model requests, your system executes
  • Always cap the steps and define when the task is done
Related Etzal serviceAutopilot: AI that runs your operationsPrefer it done for you? See how we help.
From chatbot to agent: the reasoning-action loop - Agentic AI for Business | Etzal Academy | Etzal Group