Building AI Agents from Scratch with Python · Foundations
Agents vs. Chatbots vs. Workflows
It's worth being precise about the boundaries, because the right architecture depends on getting this call right before you write code.
Chatbot
user message → model → reply
No loop, no tools, no memory beyond the conversation transcript. If your product only needs this, building an agent is over-engineering — you're adding failure modes for no benefit.
Workflow
step 1 → step 2 → step 3 → done
The sequence is fixed in code, even if individual steps call an LLM (e.g. "summarize, then translate, then send"). This is usually the better choice when you can enumerate the steps, because it's deterministic and testable.
Agent
loop:
observation → model decides the next action → action → observation → ...
The sequence of steps is not known ahead of time — it emerges from the model's decisions at runtime.
Rule of thumb: start with a workflow. Only reach for an agent when you catch yourself writing branching logic that tries to anticipate every possible situation — that's usually the sign that the model should be making the branching decision instead of your code.