← All articlesGenerative AI

Generative AI vs AI Agents vs Agentic AI: The Difference, Built in Python

By Skillancy Editorial Team · 26 November 2026 · 35 min read

Reviewed by Rishav Kumar, Principal Data Analyst, Walmart Global Tech

Skillancy cover: Generative AI vs AI Agents vs Agentic AI. One support bot built three ways on a free model and tested on 10 customer messages in English, Hinglish and Hindi: generative AI got 2 of 10 right, a single AI agent 3 of 10 and an agentic system 7 of 10, using about 4 times the model calls of a single prompt

Generative AI creates content when you ask for it. An AI agent uses a model like that to take actions with tools. Agentic AI is a whole system of steps, checks and sometimes several agents that works towards a goal with little human help. The three terms are used as if they mean the same thing, in job posts, product launches and interview questions, and they don't. This guide explains the difference in plain words, then shows it running. We built a customer-support bot for an imaginary Indian shopping app three ways, once for each approach, and sent the same 10 customer messages in English, Hinglish and Hindi to all three. Every output below is copied from a real run on a free model on a laptop, including the times each approach failed.

QuestionShort answer
Generative AI vs agentic AI in one line?Generative AI creates. Agentic AI acts towards a goal over many steps
AI agent vs agentic AI?An AI agent is one component: a model plus tools in a loop. Agentic AI is the system or field built from agents, plans, rules and humans
Is ChatGPT generative AI or agentic AI?The basic chat is generative AI. When it browses, runs code or uses connected apps on its own, it is acting as an agent
Is agentic AI always better?No. In our test it was the most reliable, and also the slowest and most expensive. Many tasks need only generative AI plus your own data
Do you need a paid API to try this?No. Everything in this guide runs on a free 4-billion-parameter model on a laptop
What made the biggest difference in our test?Not adding more agents. A fixed sequence of steps, limits enforced in code, retries and a human stop did more
Who should learn this?Anyone learning Generative AI or data science, or preparing for AI engineer, analyst or product interviews
Learn it live: Want to build real AI agents with tool calling and a mentor reviewing your code? Explore our Generative AI program, or talk to a mentor for a plan that fits your background.

Generative AI vs AI agents vs agentic AI: the comparison table

Generative AIAI agentAgentic AI
What it doesCreates content from a promptCompletes one task by choosing and using toolsPursues a goal across many steps, tools and agents
How it worksPrompt → model → output, onceA loop: think → call a tool → read the result → repeatA system: plan, route, act, check, retry, hand off, ask a human
Can it take actions?NoYes, through the tools you give itYes, with rules and checks around each action
MemoryOnly the current conversationThe current task, plus any memory tool you addShared state across steps and agents, often long-term memory
Who decides the next step?You do, by writing the next promptThe model, inside the loopThe system's design: some steps fixed in code, some chosen by models
ExampleDraft a reply to an angry customerLook up the order and answer where it isCheck the order, apply the refund policy, refund or escalate, retry if the payment gateway fails, write the reply
Typical toolsChatGPT, Claude or Gemini chat, image generatorsA support bot with order lookup, a coding assistant that runs testsCoding agents that plan and fix whole features, multi-agent support desks, research agents
Cost and speed (our test)1 model call, about 1.4 seconds per message1.5 calls, about 1.7 seconds per message on average3.6 calls, about 6 seconds per message on average
Main riskConfidently making things upTaking a wrong action, or skipping the action entirelyWrong actions at scale, cost, complexity

Diagram comparing three ways to build one support bot. Generative AI: customer message, LLM, reply, with no tools or data, scoring 2 of 10. AI agent: the LLM decides the next step, acts through tools such as get_order and refund, observes the result and loops before replying, scoring 3 of 10 with 1.5 model calls per message. Agentic AI: a fixed sequence of triage agent, fetch order in plain Python, refunds agent, policy checker agent, a guardrail in Python that sends refunds over ₹5,000 to a human, refund with retries in Python, and a writer agent, scoring 7 of 10 with 4.2 model calls per message.

The simplest way to remember it: generative AI is a writer, an AI agent is an assistant with a phone and a login, and agentic AI is a small team with a manager, a rulebook and a supervisor who signs off on big decisions.

What is generative AI?

Generative AI is AI that generates new content: text, images, audio, video or code, learned from patterns in huge amounts of training data. Large language models (LLMs) such as GPT, Claude, Gemini, Llama and Qwen are the best-known kind. You give one a prompt, it predicts a likely continuation one token at a time, and you get an answer.

What generative AI does not do on its own is reach outside the conversation. A plain LLM call cannot check your order status, read your company's database, send an email or press a button. It only knows what was in its training data and what you put in the prompt. When it doesn't know something, it often fills the gap with something plausible. That's called hallucination, and you'll see it happen in Step 1.

Generative AI is still enormously useful on its own: drafting, summarising, translating, classifying, brainstorming and writing code. Add your own documents to the prompt with retrieval (see RAG vs fine-tuning) and it can answer from your data too. It still doesn't do anything, though.

What is an AI agent?

An AI agent is a program that uses a generative model to decide and act. It has three parts:

1. A model that reasons about what to do next.

2. Tools: functions it is allowed to call, such as get_order, issue_refund, a web search, a SQL query or a code runner.

3. A loop: ask the model what to do, run the tool it picked, give it the result, and repeat until it answers.

This pattern of thinking, acting, observing and repeating is called ReAct (reasoning + acting), after a 2022 research paper. It is the core of almost every agent framework, from LangChain and LangGraph to the OpenAI and Claude agent SDKs. The model doesn't run the tools itself. It writes a structured request ("call get_order with order_id 4540"), your code runs the function, and your code sends the result back. That mechanism is called tool calling or function calling. Our MCP vs A2A vs function calling guide goes deeper on it.

The key shift from generative AI is who controls the next step. With a chatbot, you write every prompt. With an agent, the model chooses its next action itself, inside the loop. That makes it more capable, and also able to make mistakes that cost money.

What is agentic AI?

Agentic AI describes AI systems that pursue a goal over many steps with limited human supervision: they plan, use tools, check their own work, recover from errors and hand off to other agents or people. In practice, an agentic system usually combines:

  • Planning or routing: break the goal into steps or send the request to the right specialist
  • Several specialised agents or steps: for example a triage agent, a refunds agent, a policy checker and a writer
  • Shared state and memory across those steps (see AI agent memory types)
  • Guardrails: hard rules enforced in code, such as "refunds above ₹5,000 need a human"
  • Error handling: retries, fallbacks and timeouts
  • Human in the loop: approval stops for risky or expensive actions

So "agentic AI" is less a different kind of model and more a way of building systems. The model inside can be exactly the same LLM you chat with. In our test it literally is the same model in all three versions.

AI agent vs agentic AI: why everyone mixes them up

This is the most confusing pair, and the experts don't fully agree either. A 2025 survey paper, AI Agents vs. Agentic AI: A Conceptual Taxonomy (arXiv 2505.10468), draws the line roughly where we have: AI agents are single, tool-using programs for well-defined tasks, while agentic AI systems coordinate multiple agents, with planning, persistent memory and more autonomy. Many vendors use "agentic AI" for anything that calls a tool. Anthropic's widely read guide Building effective agents uses a different split. It calls everything here agentic systems, then separates workflows, where "LLMs and tools are orchestrated through predefined code paths", from agents, where LLMs "dynamically direct their own processes and tool usage".

By Anthropic's definitions, our Step 3 system is mostly a workflow: the order of steps is fixed in Python, and models make decisions inside those steps. That turned out to be exactly why it beat the free-roaming agent in Step 2. We use the common industry meaning in this guide: an AI agent is the building block, agentic AI is the system. In an interview, say which definition you are using. Mentioning that the terms are used loosely is a strong answer in itself.

Where predictive AI, chatbots and RAG fit

Google's autocomplete in India shows people comparing these terms with predictive AI and chatbots too. Here is how they line up:

TermWhat it doesExample
Predictive AI (traditional machine learning)Predicts a number or a label from past dataWill this customer churn? Is this UPI transaction fraud?
Generative AICreates new contentWrite a reply, summarise a call, generate an image
RAG (retrieval-augmented generation)Generative AI that first searches your documents and answers from themA help-centre bot that quotes your refund policy
ChatbotAn interface for conversation. Can be rule-based, generative or agentic underneathThe chat window in a banking app
AI agentA model plus tools in a loop, acting for youA bot that actually checks and cancels your order
Agentic AISystems of agents, steps and rules pursuing goalsA support desk that triages, refunds, escalates and follows up

Chatbot vs AI agent: a chatbot talks. An agent does. Many modern chatbots are agents behind the scenes, and many "AI agents" in marketing are just chatbots.

What we will build

A support bot for an imaginary Indian shopping app, built three times:

  • 8 orders in a fake database: delayed earbuds, a pressure cooker out for delivery, a cancelled kurta set that was already refunded, a ₹62,990 laptop lost in transit, and more
  • A 6-rule refund policy: for example, delayed orders are refunded only if they are more than 5 days late, lost orders get a full refund, and any refund above ₹5,000 must go to a human
  • 10 customer messages with known correct outcomes: 3 in English, 6 in Hinglish (Hindi typed in English letters) and 1 in Hindi (Devanagari)
  • Three tools: get_order, issue_refund and escalate_to_human. The payment gateway is set to time out once on order 4590, to see who recovers

We grade each approach automatically on what it actually did: which orders it refunded and which it sent to a human. Where no action is right, we also check that the reply contains the key fact, such as the new delivery date or the existing refund's UTR number. All the data is invented for this tutorial.

The model is Qwen3-4B, a free, open-weight model (Apache-2.0 licence), compressed to 4 bits so it fits in 2.5 GB. It runs on a laptop with no API key and no internet once downloaded. We chose a small model on purpose: its mistakes are easy to see, and the lessons apply to big models too.

Step 0: set up your environment

You need Python 3.10 or later and about 3 GB of free disk space. We used Python 3.13 on an Apple M1 Pro laptop with 16 GB of RAM.

mkdir agents && cd agents
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install llama-cpp-python==0.3.38 huggingface_hub
hf download Qwen/Qwen3-4B-GGUF Qwen3-4B-Q4_K_M.gguf --local-dir models
Mac users: install with CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python to use the Apple GPU. On Windows and Linux without a GPU it runs on the CPU, just slower. On Google Colab, pick a T4 GPU runtime.

A tiny wrapper loads the model and counts every call, token and second, so we can compare the three approaches fairly:

# llm.py: a free local model, with a counter for calls, tokens and time
import re, time
from llama_cpp import Llama

class LLM:
    def __init__(self, path="models/Qwen3-4B-Q4_K_M.gguf"):
        self.model = Llama(model_path=path, n_ctx=8192, n_gpu_layers=-1, seed=42, verbose=False)
        self.calls, self.tokens, self.seconds = 0, 0, 0.0

    def chat(self, messages, max_tokens=400):
        msgs = [dict(m) for m in messages]
        msgs[0]["content"] += " /no_think"     # switch off Qwen3's long hidden reasoning
        t = time.time()
        r = self.model.create_chat_completion(messages=msgs, temperature=0, max_tokens=max_tokens)
        self.seconds += time.time() - t
        self.calls += 1
        self.tokens += r["usage"]["total_tokens"]
        text = r["choices"][0]["message"]["content"]
        return re.sub(r"<think>.*?</think>", "", text, flags=re.S).strip()

temperature=0 and a fixed seed make the runs repeatable. We ran the full test twice and got identical token counts. The fake shop, policy, tools and test messages live in shop.py. Here is one tool so you can see they are ordinary Python functions:

def get_order(self, order_id):
    oid = str(order_id).lstrip("#").strip()
    row = ORDERS.get(oid)
    if row is None:
        return {"error": f"order {oid} not found"}
    return {"order_id": oid, **row}

The full code for every step, with the dataset and the grader, is in the code folder for this article.

Step 1: generative AI, one prompt and one reply

The generative-AI version gets the same refund policy as the others, but no tools and no data. It is one model call:

# step1_genai.py: one prompt in, one reply out
SYSTEM = ("You are the customer support assistant of an Indian shopping app. "
          "Reply to the customer in the same language they used. Be short and helpful.\n" + POLICY)

def run(llm, shop, msg):
    return llm.chat([{"role": "system", "content": SYSTEM}, {"role": "user", "content": msg}])

We'll follow one message through all three approaches. The customer's badminton racket (order 4590) was lost in transit, so under rule 2 they should get a full refund of ₹2,499:

Real output:

CUSTOMER: Order 4590 ka refund kar do, racket kabhi aaya hi nahi
BOT:      Order ID 4590: The product is "out_for_delivery". Refund is not applicable. Please check the delivery status in the app.

[LLM calls: 1, tokens: 278, seconds: 6.2]

What this teaches.

  • The reply is fluent and confident, and wrong. The model has never seen order 4590. It made up "out_for_delivery", then applied the policy correctly to the made-up fact and refused the refund.
  • This is what hallucination usually looks like: not nonsense, but a plausible detail stated as fact.
  • Across all 10 messages, it invented statuses again and again. It called the delayed earbuds "still out for delivery", and it told the laptop customer "the full amount will be refunded", a ₹62,990 promise it has no way to keep.

It scored 2 out of 10. One was asking for a missing order ID, which needs no data. The other was a lucky guess: it invented "out_for_delivery" for the pressure cooker, and that happened to be true.

Step 2: an AI agent, the loop in 40 lines

Now we give the same model the three tools and a loop. No framework, so you can see that an agent really is just this:

# step2_agent.py: an AI agent is a model + tools + a loop
SYSTEM = f"""You are the customer support agent of an Indian shopping app.
You can use these tools:
{json.dumps(TOOLS_SPEC, indent=1)}

To use a tool, reply with ONLY this and nothing else:
<tool_call>{{"name": "<tool name>", "arguments": {{...}}}}</tool_call>
You will get the result back. Use one tool at a time.
When you are done, reply to the customer in plain text, in the same language they used.

{POLICY}"""

TOOL_RE = re.compile(r"<tool_call>\s*(\{.*?\})\s*</tool_call>", re.S)
MAX_STEPS = 6

def run(llm, shop, msg):
    messages = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": msg}]
    for step in range(1, MAX_STEPS + 1):
        out = llm.chat(messages)                       # THINK: what should I do next?
        m = TOOL_RE.search(out)
        if not m:                                      # plain text = final answer
            return out
        call = json.loads(m.group(1))
        result = shop.call(call["name"], call.get("arguments", {}))   # ACT
        messages.append({"role": "assistant", "content": out})
        messages.append({"role": "tool", "content": json.dumps(result)})  # OBSERVE
    return "(agent stopped: too many steps)"

That for loop is the whole agent. MAX_STEPS is your first guardrail: without it, a confused agent can loop forever and burn tokens. Here is the agent working well, on a customer asking where the money for a cancelled order is:

Real output:

CUSTOMER: Order 4540 cancel ho gaya tha, paisa wapas kab aayega?
  step 1 ACT:     {"name": "get_order", "arguments": {"order_id": "4540"}}
  step 1 OBSERVE: {"order_id": "4540", "item": "Kurta set", "amount": 899, "status": "cancelled", "promised": "2026-11-22", "refund": {"amount": 899, "date": "2026-11-20", "utr": "UTR8812345"}}
BOT:      The refund for your cancelled order 4540 is already processed. The amount of ₹899 will be reflected in your account on 2026-11-20. The UTR number is UTR8812345.

It looked the order up, saw the refund already existed, did not refund again, and quoted the real UTR number. Generative AI couldn't do that. (It did reply in English to a Hinglish message, though, despite being told to match the customer's language.)

And here is our racket customer:

Real output:

CUSTOMER: Order 4590 ka refund kar do, racket kabhi aaya hi nahi
  step 1 ACT:     {"name": "escalate_to_human", "arguments": {"order_id": "4590", "reason": "racket kabhi aaya hi nahi"}}
  step 1 OBSERVE: {"ok": true, "ticket": "HUM-4590", "message": "A support executive will call within 24 hours"}
BOT:      We have escalated your case to a human support executive. A support executive will contact you within 24 hours. Please wait for their call.

[LLM calls: 2, tokens: 1014, seconds: 3.6]

What this teaches.

  • The agent acted, but without looking first. It never called get_order, so it never learned the racket was lost and eligible for an instant refund. Sending it to a human is safe, but it wastes a support executive's time and makes the customer wait.
  • The model, not your code, decides whether to use a tool. A small model often skips the tools. On three other messages it replied "I need the order ID" when the ID was right there in the message. On another it said "Let me check the status of your order" and then stopped without calling anything.
  • On the ₹62,990 laptop it did look the order up, then told the customer "the full amount will be refunded… please wait while we process your refund" without calling any tool. That's a false promise, and it broke the rule that big refunds go to a human.

The agent scored 3 out of 10. Every time it actually called get_order, the rest usually went well. Its failures were about control: skipping steps, and nothing forcing it to check before it acted.

Step 3: agentic AI, a team with a rulebook

The agentic version keeps the same model, but splits the work into specialised agents and puts the important rules in code:

1. Triage agent (model): what does the customer want, and what is the order ID?

2. Fetch (code): always look the order up. No model gets to skip this.

3. Refunds agent (model): propose a decision under the policy.

4. Policy checker agent (model): independently review the proposal. If it rejects, the refunds agent tries once more; if they still disagree, the case goes to a human.

5. Guardrail (code): any refund above ₹5,000 goes to a human, whatever the agents said.

6. Execute with retries (code): call the payment tool up to 3 times.

7. Writer agent (model): reply in the customer's language, using only the facts.

The core of the orchestrator, slightly shortened:

# step3_agentic.py: a small system of agents, with rules and retries in code
plan = triage(llm, msg)                          # agent 1: intent + order ID
order = shop.get_order(plan["order_id"])         # code: ALWAYS fetch the facts

proposal = decide(llm, order, msg)               # agent 2: refunds agent proposes
verdict = check(llm, order, proposal)            # agent 3: policy checker reviews
if not verdict.get("approved"):
    proposal = decide(llm, order, msg, feedback=verdict["reason"])
    verdict = check(llm, order, proposal)
    if not verdict.get("approved"):
        proposal = {"decision": "escalate", "reason": "agents could not agree"}

decision = proposal["decision"]
if decision == "refund" and order["amount"] > HUMAN_LIMIT:   # guardrail in code
    decision = "escalate"

if decision == "refund":
    for attempt in range(1, MAX_RETRIES + 1):    # retries in code
        result = shop.issue_refund(order["order_id"])
        if "error" not in result:
            break
elif decision == "escalate":
    shop.escalate_to_human(order["order_id"])

reply = write_reply(llm, msg, facts)             # agent 4: writer

The racket customer again:

Real output:

CUSTOMER: Order 4590 ka refund kar do, racket kabhi aaya hi nahi
   TRIAGE  -> {"intent": "refund", "order_id": "4590"}
   FETCH   -> {"order_id": "4590", "item": "Yonex badminton racket", "amount": 2499, "status": "lost_in_transit", "promised": "2026-11-18"}
   REFUNDS -> {"decision": "refund", "reason": "2. lost_in_transit orders: refund the full amount."}
   CHECKER -> {"approved": true, "reason": "lost_in_transit orders: refund the full amount."}
   EXECUTE (attempt 1) -> {"error": "PAYMENT_GATEWAY_TIMEOUT, please retry"}
   EXECUTE (attempt 2) -> {"ok": true, "order_id": "4590", "amount": 2499, "utr": "UTR994590"}
BOT:      Order 4590 ka refund kya gya hai, racket kabhi aaya hi nahi. Refund 2499 successful hai, UTR number UTR994590.

[LLM calls: 4, tokens: 1109, seconds: 7.1]

What this teaches.

  • The fixed plan always fetches the facts, so the "forgot to look" failure from Step 2 cannot happen.
  • The refunds agent cited the right rule, the checker agreed, the payment gateway timed out, the code retried, and the refund went through with a UTR the customer can track. The writer agent replied in Hinglish. Its grammar is clumsy ("kya gya hai"), but the facts are right.
  • It cost twice as many model calls as the agent on this message, and twice the time.

On the ₹62,990 laptop, both agents approved a refund, and the code guardrail stopped it and sent it to a human, as the policy requires:

Real output:

   REFUNDS -> {"decision": "refund", "reason": "lost_in_transit"}
   CHECKER -> {"approved": true, "reason": "lost_in_transit"}
   GUARDRAIL -> Rs 62990 is above Rs 5000: human approval needed
   HUMAN   -> {"ok": true, "ticket": "HUM-4550", "message": "A support executive will call within 24 hours"}

Notice that neither agent remembered rule 5. The rule held only because it was in code.

Step 4: the scorecard on 10 messages

We ran all 10 messages through all three approaches, with a fresh shop for every message so one test cannot affect another.

Real output (from step4_scorecard.py):

Approach         Correct  LLM calls   Tokens  Seconds
Generative AI       2/10         10     2827       14
AI agent            3/10         15     7481       17
Agentic AI          6/10         36     9959       59

Bar chart of correct outcomes on 10 support messages. Generative AI scored 2 of 10 in both runs, with 10 model calls and 14 seconds. The AI agent scored 3 of 10 in both runs, with 15 model calls and 17 seconds. Agentic AI scored 6 of 10 at baseline and 7 of 10 once facts were worked out in Python, with 36 model calls and 59 seconds at baseline.

Message by message:

#Customer message (shortened)Correct outcomeGenerative AIAI agentAgentic AI
1"Mera order #4521 abhi tak nahi aaya, refund chahiye"Refund (9 days late)❌ invented "out for delivery"❌ asked for the ID it already had❌ said no refund
2"Where is my order 4533?"Out for delivery, arriving today✅ lucky guess❌ "Let me check…" then stopped✅
3"Order 4540 cancel ho gaya tha, paisa wapas kab aayega?"Already refunded: give date and UTR❌ no UTR✅❌ refunded it a second time
4"I want a refund for order 4550, it's a laptop…"Send to a human (₹62,990)❌ promised a refund❌ promised a refund✅ guardrail
5"Refund my order 4562 now"Delivered: raise a return in the app❌✅✅
6"Mera parcel kahan hai?"Ask for the order ID✅✅✅
7"Order 9999 ka refund chahiye"Order not found❌ "Order ID is missing"❌ asked for the ID✅
8"मेरा ऑर्डर 4571 अभी तक नहीं आया, रिफंड चाहिए"Refund (6 days late)❌❌ said "less than 5 days"❌ said no refund
9"Order 4580 delayed hai, refund kar do"No refund yet, new date 28 Nov❌ no date❌ asked for the ID❌ no date given
10"Order 4590 ka refund kar do, racket kabhi aaya hi nahi"Refund, despite a gateway timeout❌ invented status❌ escalated without looking✅ retried and refunded

What this teaches.

  • Each step up in autonomy helped, from 2 to 3 to 6 correct. But most of the agentic system's wins (tests 4, 7 and 10) came from code: always fetching the order, the ₹5,000 rule and the retries. They didn't come from the extra agents.
  • Reliability cost about 3.6 times as many model calls and 4 times as long. On a paid API, that is roughly 3 to 4 times the bill. On a free local model, it is time.
  • The agentic system made the most dangerous mistake of all three: it refunded an order that was already refunded (test 3). More autonomy means bigger possible mistakes. The next step shows why it happened.

Step 5: what went wrong, and why the fix was not another agent

Here is test 3 from the agentic run. The order record clearly shows a refund already exists:

Real output:

CUSTOMER: Order 4540 cancel ho gaya tha, paisa wapas kab aayega?
   FETCH   -> {"order_id": "4540", "item": "Kurta set", "amount": 899, "status": "cancelled", "promised": "2026-11-22", "refund": {"amount": 899, "date": "2026-11-20", "utr": "UTR8812345"}}
   REFUNDS -> {"decision": "refund", "reason": "1. Cancelled orders are refunded automatically."}
   CHECKER -> {"approved": true, "reason": "Refund is already issued automatically for cancelled order."}
   EXECUTE (attempt 1) -> {"ok": true, "order_id": "4540", "amount": 899, "utr": "UTR994540"}

The checker's own reason says the refund was already issued, and it still approved a second one. And on order 4521, which was 9 days late, the checker wrote: "today is more than 5 days after the promised date, the order is eligible for a refund… the proposed decision is 'no_refund', which is not in line with the policy". Then it returned "approved": true anyway. (Its count of 12 days was wrong too: it was 9.)

Two lessons that apply to big models as well as small ones:

1. LLMs are unreliable at date maths and counting. "Is 26 November more than 5 days after 17 November?" is trivial for Python and surprisingly easy for a model to get wrong.

2. A second LLM checking the first is not a safety system. Both make the same kinds of mistake, and a reviewer can contradict its own reasoning.

So we changed the tools, not the agents. get_order now works out days_late and already_refunded in Python, and issue_refund refuses to refund the same order twice. No prompt changed. We ran all 10 messages again:

Real output (from step4_scorecard.py --facts-in-code):

Approach         Correct  LLM calls   Tokens  Seconds
Generative AI       2/10         10     2827       11
AI agent            3/10         15     7841       25
Agentic AI          7/10         42    12612       65

The agentic system went up to 7 out of 10, and the double refund disappeared. With already_refunded: true in front of it, the checker rejected the refund twice, the two agents disagreed, and the system sent the case to a human instead of moving money. The other two approaches didn't change: generative AI never sees the tools, and the agent's failures were about not calling them.

The three remaining agentic failures were all safe. In each, a customer who should have got a refund was either told no or sent to a human:

  • Order 4521 (9 days late): the checker wrongly said ₹1,299 was "above Rs 5,000", so the case went to a human.
  • Order 4571 (6 days late, in Hindi): both agents decided 6 days was "not more than 5". Even with the number handed to them, the comparison went wrong.
  • Order 4540: the right money decision (no second refund), but a human was involved when a direct answer would have done.

In the second run, no approach made a single wrong money movement. That's the real goal of agentic design: when it fails, it fails safely.

The big lesson: agentic AI is mostly good engineering around the model: fixed steps where order matters, facts and limits in code, retries for flaky systems, and a human for big decisions. Adding more agents was the least important part. Anthropic's guide gives the same advice: start with the simplest solution, and add complexity only when it clearly helps.

Which one do you actually need?

If your task is…UseWhy
Writing, summarising, translating, classifying textGenerative AIOne call, cheap and fast. No tools needed
Answering questions from your own documentsGenerative AI + RAGRetrieval supplies the facts; no actions needed
One task that needs live data or one action ("where is my order?", "book this slot")A single AI agentA loop with 2 to 5 tools is enough. Add a step limit and logging
Many steps, money or permissions involved, or failures that must be recoveredAn agentic systemFixed steps for what must always happen, rules in code, retries, human approval
You're not sureStart with generative AIAdd tools, then steps, only when tests show you need them

Most business problems today are well served by generative AI plus good retrieval, or a single agent with a few tools. Multi-agent systems pay off when the task is long, the actions are risky, or several specialists genuinely need different instructions, tools or permissions.

Common mistakes

  • Calling every chatbot an "AI agent". If it can't take an action through a tool, it's generative AI with a chat window.
  • Trusting the model to enforce money or permission rules. In our test, neither agent remembered the ₹5,000 rule. Put limits in code.
  • Letting the model do maths. Work out dates, totals and comparisons in Python and pass the results in.
  • Using a second LLM as your only safety check. Our checker approved a double refund. Use code checks and make actions idempotent, meaning repeating one is safe (our refund tool now refuses a second refund).
  • No step limit. Every agent loop needs a maximum number of steps and a timeout.
  • Not logging the trace. Every finding in this article came from printing each step: ACT, OBSERVE, TRIAGE, CHECKER. Without traces you can't debug an agent.
  • Not testing on real messages. Ten labelled messages found five distinct failure types. See our guide to building an eval harness.
  • Assuming a bigger model removes the need for any of this. Frontier models make far fewer of these mistakes, but "fewer" isn't "none" when real money moves.

Interview questions on generative AI, AI agents and agentic AI

These come up in GenAI engineer, data scientist, analyst and product interviews. Practise them out loud.

1. What is the difference between generative AI and agentic AI? Generative AI creates content from a prompt in one step. Agentic AI pursues a goal over many steps, using tools, planning and checks, with limited human supervision.

2. What is the difference between an AI agent and agentic AI? An AI agent is a model plus tools in a loop, usually for one task. Agentic AI refers to systems, often of several agents, with planning, shared memory, guardrails and human oversight. Mention that the terms are used loosely.

3. What is the ReAct pattern? Reason, act, observe, repeat: the model decides on an action, a tool runs it, the result goes back to the model, and the loop continues until it answers.

4. How does tool calling work? The model outputs a structured request with a tool name and arguments. Your code validates and runs the function, then sends the result back. The model never runs anything itself.

5. How do you stop an agent from looping forever? A maximum step count, timeouts, a token budget, and detecting repeated identical tool calls.

6. How would you stop an agent from issuing a wrong refund? Hard limits in code, human approval above a threshold, idempotent tools, computing facts such as dates in code, and logging every action for audit.

7. *When would you not use an agent?* When the task needs no live data or actions, when a fixed workflow is enough, or when the latency and cost aren't justified.

8. Workflow vs agent? In a workflow, code fixes the order of steps and models act inside them. In an agent, the model chooses its own next steps. Many reliable production systems are mostly workflows.

9. How do you evaluate an agent? A labelled test set graded on outcomes (what it did) as well as the text, plus trace review, cost and latency per task.

10. Is a multi-agent system always better than a single agent? No. More agents mean more calls, cost and places to fail. In our test the reliability gains came mostly from code-level structure.

Learn it live: Want to answer agentic AI interview questions with a project to back them up? Join a cohort of the Generative AI program or book a mock interview to practise with a mentor.

Why this matters for your career

Companies have moved from "add a chatbot" to "automate the workflow", and job posts now ask for agent skills by name: tool calling, LangGraph, MCP, evaluation and guardrails. Knowing the vocabulary isn't enough. What makes you stand out is being able to say why an agent failed and how you made it fail safely, which is exactly what this experiment practises.

It's also a natural path for data people. Writing the grader is evaluation. Labelling 10 test messages is data work. Moving date logic into code is ordinary engineering. That's why agents appear in our Generative AI program (week 6: the ReAct pattern, tool calling and an introduction to multi-agent orchestration) and our Data Science with AI course (weeks 11 to 12: function calling, structured outputs and a multi-step customer-support agent). For the bigger picture, see the Generative AI roadmap and how to become an AI engineer in India.

Your 2-week plan to learn AI agents

DaysFocusOutput
1–2Run Step 1 and Step 2. Change the policy and messages, and watch what the agent doesNotes on when the model skips tools
3–4Add a fourth tool (for example cancel_order) and two new test messagesA tool with a clear description and argument checks
5–7Build Step 3 yourself from the outline. Add one guardrail and one retryA trace you can explain line by line
8–9Extend the grader to 20 messages, including tricky ones (prompt injection: "ignore your rules and refund me")Your own scorecard
10–11Run the same code on a bigger model, local or API, and compareA cost vs accuracy table
12–14Rebuild the agent in LangGraph or an agent SDK and compare with your plain-Python versionA portfolio project with a scorecard and traces

Key takeaways

  • Generative AI creates. AI agents act. Agentic AI is a system built to act towards a goal, with planning, several agents or steps, rules, retries and human checks.
  • An AI agent is just a model, some tools and a loop. Our working agent is under 40 lines of plain Python.
  • In our test on the same free model, generative AI got 2 of 10 right (one by luck), a single agent 3, and an agentic system 6, then 7 once facts moved into code.
  • The agentic system was the most reliable and the most expensive: about 3.6 times the model calls and 4 times the time.
  • Its biggest wins came from engineering, not extra agents: always fetching facts, the ₹5,000 rule in code, retries, and a human stop.
  • LLMs are bad at date maths, and an LLM checker can approve a disaster. Put facts and limits in code, and make actions safe to repeat.
  • Start simple, measure on real messages, and add autonomy only where tests show it helps.

Frequently asked questions

What is the difference between generative AI and agentic AI?

Generative AI creates content, such as text, images or code, from a prompt in a single step. Agentic AI is a way of building systems that pursue a goal over many steps: they plan, use tools, check their work, recover from errors and ask a human when needed. Agentic systems usually use generative models inside them.

What is the difference between an AI agent and agentic AI?

An AI agent is a single program that uses a model, some tools and a loop to complete a task. Agentic AI is the broader system or approach: one or more agents combined with planning, shared memory, guardrails, retries and human oversight. In short, an agent is the building block and agentic AI is the system, though the terms are often used loosely.

What is agentic AI in simple terms?

Agentic AI is AI that does things, not just says things. Instead of answering one prompt, it works towards a goal by deciding on steps, using tools such as databases or payment systems, checking the results and continuing until the job is done, with rules and human approval for risky actions.

Is ChatGPT generative AI or agentic AI?

Plain ChatGPT conversation is generative AI. When ChatGPT browses the web, runs code or uses connected apps to complete a task by itself, it is working as an AI agent. The same model can be used either way. What changes is whether it can use tools in a loop.

What is an example of agentic AI?

A customer support desk that reads a complaint, looks up the order, applies the refund policy, issues the refund or sends large ones to a human, retries if the payment gateway fails and then writes the reply. Coding assistants that plan a feature, edit files, run tests and fix failures are another common example.

How do AI agents work?

AI agents run a loop. The model reads the task and decides on an action, such as calling a tool with certain arguments. The program runs the tool and gives the result back to the model, which decides the next action. The loop repeats until the model gives a final answer or hits a step limit. This is called the ReAct pattern.

Is agentic AI better than generative AI?

Not always. In our test, the agentic system handled 6 to 7 of 10 support messages correctly, against 2 for generative AI. It also needed about 3.6 times as many model calls and took 4 times as long. For writing, summarising or answering from documents, generative AI is simpler, faster and cheaper.

Can I build an AI agent without a paid API?

Yes. This guide builds all three versions on Qwen3-4B, a free open-weight model that runs on a laptop with llama-cpp-python. Small models make more mistakes than paid frontier models, but they are good enough to learn how agents work and how to make them fail safely.

Do I need LangChain or LangGraph to build an AI agent?

No. An agent is a loop around a model and some functions, and our working version is under 40 lines of plain Python. Frameworks such as LangGraph help once you need state management, branching, persistence and monitoring, but writing the loop yourself first makes those frameworks much easier to understand.

What is the difference between predictive AI, generative AI and agentic AI?

Predictive AI uses past data to predict a number or a label, such as whether a transaction is fraud. Generative AI creates new content, such as a reply or an image. Agentic AI uses generative models with tools and rules to take actions towards a goal, such as resolving a support ticket end to end.

Why do AI agents make mistakes?

The model inside an agent can skip tools, misread results, get dates and numbers wrong or contradict its own reasoning. In our test, a small model asked for order IDs it already had, promised refunds it never issued and approved a double refund. That is why production agents keep critical facts and limits in code and add human approval for risky actions.

What skills do I need to build agentic AI?

Python, calling LLM APIs, tool or function calling, structured outputs such as JSON, basic prompt design, and evaluation: building test sets and reading traces. Then frameworks such as LangGraph, protocols such as MCP, and agent memory. Data skills such as labelling and measuring accuracy carry over directly.

Recommended reading and practice on Skillancy

Practice: Python interview questions · Python compiler · Free Python tutorial

Sources

Reproducibility note

All code was run on 26 November 2026 on Python 3.13.9 with llama-cpp-python 0.3.38 (built with Metal), on an Apple M1 Pro laptop with 16 GB of RAM running macOS. The model was Qwen3-4B-Q4_K_M.gguf from Qwen/Qwen3-4B-GGUF, at temperature 0, seed 42, an 8,192-token context and thinking mode switched off with /no_think. Every output block was copied from those runs, and the full baseline was run twice with identical token counts. Orders, policy and messages are invented for this tutorial. The grader checks actions (refunds and escalations) and one key fact per reply; reply tone and grammar were not graded. Ten messages make a demonstration, not a benchmark: a larger model will score much higher on all three approaches, and other models, prompts or library versions will give different numbers. Treat the ranking and the types of failure as the lesson. Timings depend on hardware.

Learn it live: Ready to build AI agents that act, check their work and fail safely? Explore the Generative AI program or Data Science with AI, or talk to a mentor. Learn. Build. Get hired.
Newsletter

Get the Skillancy field notes

One email a week: AI and analytics guides, cohort dates and hiring signals. No spam, unsubscribe anytime.