Module 1 Lesson 2: Agents vs Chatbots
Defining the boundary. Why adding a 'Search' tool to a chatbot doesn't make it an agent.
Agents vs Chatbots: The Autonomy Spectrum
It is common to hear the terms "AI Agent" and "AI Chatbot" used interchangeably. However, to an engineer, they are fundamentally different architectures. The difference lies in Agency—the ability to plan and act without being spoon-fed every instruction.
1. The Reactive Chatbot
A chatbot is primarily Reactive. It takes an input, processes it, and provides an output. Even if it uses a tool (like searching Google), it usually does so in a single, linear step.
graph LR
User[User Message] --> LLM[Chatbot LLM]
LLM --> Tool[One-off Tool Use]
Tool --> Result[Final Answer]
2. The Proactive Agent
An agent is Proactive. Given a complex goal ("Write a report on Nvidia's last 3 earnings calls"), an agent realizes it cannot do this in one step. It must:
- Plan: Break the goal into sub-goals.
- Act: Search for the first call, take notes, search for the second, etc.
- Refine: If it fails to find a piece of data, it tries a different search term.
- Finalize: Only after several loops does it return the result.
graph TD
Goal[User Goal] --> Loop{Loop Action}
Loop --> ToolA[Search Tool]
ToolA --> ResultA[Data Found]
ResultA --> Loop
Loop --> ToolB[Math Tool]
ToolB --> ResultB[Calculation done]
ResultB --> Loop
Loop --> Done[Final Goal Reached]
3. Key Differences
| Feature | Chatbot | Agent |
|---|---|---|
| Workflow | Linear (In -> Out) | Iterative (Loop) |
| Control | User-led | Goal-led |
| Tool Use | Single/Predefined | Multi-step/Dynamic |
| Failure Handling | Returns an error / hallucination | Tries a different approach |
| Example | "Summarize this PDF" | "Improve this codebase to use Python 3.12" |
4. Code Comparison: The "Research" Task
The Chatbot Way (Linear)
def chatbot(query):
# Chatbot just asks the model to respond
return llm.call("Please search for X and tell me what you find.")
The Agent Way (Iterative)
class ResearchAgent:
def solve(self, goal):
completed = False
while not completed:
# 1. Ask model for the NEXT step
thought = llm.call(f"Goal: {goal}. What is the next logical step?")
# 2. Execute that specific step
result = self.execute_step(thought)
# 3. Check if we are finished
if "FINAL_ANSWER" in result:
completed = True
return result
5. The "Agency" Test
If you can walk away from your computer for 5 minutes and the AI is still "thinking" or "working" through a sequence of tasks, you are dealing with an Agent. If it waits for you to say "Now do this" after every step, it's a Chatbot.
Key Takeaways
- Chatbots are linear and reactive.
- Agents are iterative and goal-oriented.
- The transition to an agent requires a Control Loop that the LLM manages.
- Agency is a spectrum: some systems are "more agentic" than others depending on how many steps they can handle autonomously.