Comparison
Agentic AI vs Generative AI: Differences and Examples
Generative AI is a model that produces new content, such as text, images, audio or code, from a prompt. Agentic AI is a system that puts such a model in a loop with tools so it can take actions, read the results and keep going until a task is done. Agentic AI is built on generative AI.
Last updated · By Rohit Ghumare
Agentic AI vs generative AI at a glance
| Generative AI | Agentic AI | |
|---|---|---|
| What it is | A model that samples new content resembling its training data | A system: a model, tools, a loop and a stop condition |
| Unit of work | One prompt, one response | One goal, many steps |
| Who chooses the next step | The person, by writing the next prompt | The model, by choosing the next tool call |
| Contact with the outside world | None by itself; it only emits tokens or pixels | Reads files, calls APIs, runs code, sends messages |
| State | Forgotten after the reply | A message history that grows, often checkpointed |
| Run length | Seconds | Minutes to hours |
| What you review | The final answer | The whole trajectory of actions |
| How it fails | A wrong or made-up answer | That, plus drift, loops and acting on bad tool output |
| Cost | Predictable per request | Varies widely from run to run |
| Examples | Writing a draft, generating an image, completing code | A coding agent fixing a bug, a research agent producing a cited report |
When to choose each
Choose generative AI alone when
- The whole task fits in one request: draft this email, summarize this document, classify this ticket, translate this page.
- Everything the model needs is already in the prompt.
- A person reads the output before anything happens. The model suggests; the person acts.
- You need predictable cost and latency per request.
Choose an agent when
- The task needs information the model does not have, such as the contents of a repository or today's data.
- The task needs actions: run the tests, query the database, open the pull request.
- You cannot list the steps in advance, because each step depends on what the last one returned.
- The work is long enough that prompting the model step by step yourself would be the bottleneck.
Consider a fixed workflow first
Between the two sits a workflow: several model calls in an order your code decides. If you can write the steps down ahead of time, a workflow is cheaper, easier to test and easier to trust than an agent. Use an agent when the model has to choose the path.
Code: one example per side
Both scripts use only the Python standard library and run offline.
Generative: a tiny generative model. It learns which word follows which from a small corpus, then samples a new sentence. One call, one output, no actions.
import random
corpus = "the cat sat on the mat . the dog sat on the rug . the cat saw the dog .".split()
follows = {}
for word, nxt in zip(corpus, corpus[1:]):
follows.setdefault(word, []).append(nxt)
random.seed(10)
word, out = "the", ["the"]
while word != "." and len(out) < 12:
word = random.choice(follows[word])
out.append(word)
print(" ".join(out))the cat sat on the cat sat on the rug .Agentic: the same idea of a model, now inside a loop with a tool. The model function here is a scripted stand-in so the example runs offline; replace it with a real model call and the loop does not change. The calculator parses the arithmetic itself, so text from a model is never run as Python.
import ast
import operator
OPS = {ast.Add: operator.add, ast.Sub: operator.sub, ast.Mult: operator.mul, ast.Div: operator.truediv}
def evaluate(node):
if isinstance(node, ast.Constant) and type(node.value) in (int, float):
value = node.value
elif isinstance(node, ast.BinOp) and type(node.op) in OPS:
value = OPS[type(node.op)](evaluate(node.left), evaluate(node.right))
elif isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.USub):
value = -evaluate(node.operand)
else:
raise ValueError("only numbers, + - * / and parentheses are allowed")
if abs(value) > 1e12:
raise ValueError("number is too large")
return value
def calculator(expr):
if len(expr) > 100:
raise ValueError("expression is too long")
return str(evaluate(ast.parse(expr, mode="eval").body))
TOOLS = {"calculator": calculator}
def model(history):
observations = [turn for turn in history if turn[0] == "observation"]
if not observations:
return ("action", "calculator", "1200 * 0.15")
if len(observations) == 1:
return ("action", "calculator", f"1200 - {observations[0][1]}")
return ("finish", f"The discounted price is {observations[-1][1]}")
history = [("user", "What is 1200 with a 15% discount?")]
for turn in range(5):
step = model(history)
if step[0] == "finish":
print(step[1])
break
_, tool, argument = step
result = TOOLS[tool](argument)
print(f"{tool}({argument}) -> {result}")
history.append(("observation", result))calculator(1200 * 0.15) -> 180.0
calculator(1200 - 180.0) -> 1020.0
The discounted price is 1020.0That loop has the five parts every agent needs: a message history that grows, a tool registry, a stop condition, a turn budget (range(5)) and tool results fed back as observations.
Common mistakes
- Treating them as competing products. An agent contains a generative model. Improving the model improves the agent.
- Calling any chatbot with a long prompt an agent. If nothing loops and no tool runs, it is one generative call.
- Building an agent for a one-shot task. If one request does the job, a loop adds cost, latency and new ways to fail.
- Skipping the turn budget. A loop with no cap can run, and spend, until someone notices.
- Trusting tool output as instructions. A web page or file the agent reads is data. Only the user's own instructions count as permission to act.
- Reviewing only the final answer. An agent can report success after a failed step. Read the trajectory, not only the last message.
- Assuming per-step accuracy carries over. At 99% per step, with step errors independent, a 70-step run succeeds only about half the time.
- Letting consequential actions run unattended. Sending, deleting and paying should wait for approval.
Frequently asked questions
Is agentic AI a type of generative AI?
Agentic AI is built on generative AI, not a separate kind of model. An agent uses a generative model, usually a large language model, as the part that decides what to do next. Around it sits a loop with tools, a message history, a stop condition and a step budget.
Is ChatGPT generative AI or agentic AI?
It depends on what it is doing. A plain chat reply, where the model writes text and stops, is generative AI. When a chat product is given tools, such as search or code execution, and uses them over several steps to finish a task, it is working as an agent. The model underneath is the same.
What is an example of agentic AI?
A coding agent is the clearest one. Given a bug report, it reads files, runs the tests, edits code, runs the tests again and stops when they pass. Each step is a tool call whose result feeds the next decision. A chatbot that only suggests a fix is generative, not agentic.
Do I need agentic AI, or is generative AI enough?
Generative AI is enough when one prompt in and one response out solves the task: drafting, summarizing, classifying, translating. Reach for an agent when the task needs outside information or actions and the steps cannot be listed in advance. If the steps are fixed, a scripted workflow is cheaper and safer.
Why are agents harder to make reliable than chatbots?
Errors compound across steps. If each step succeeds 99% of the time, independently of the others, a 70-step task still finishes correctly only about half the time. Long runs also add failure types a single reply does not have: drifting off the goal, looping, and acting on untrusted tool output.
Learn it by building
These free lessons build both sides from scratch:
- Generative Models — Taxonomy & History: the five families of generative model and what each one trades off.
- The Agent Loop: Observe, Think, Act: the loop above, with a tool registry and trace, in standard-library Python.
- Tool Use and Function Calling: how a model asks for a tool and gets the result back.
- Anthropic's Workflow Patterns: Simple Over Complex: when a fixed workflow beats an agent.
- The Shift from Chatbots to Long-Horizon Agents: what changes when runs last hours instead of seconds.