The Four Components of Every AI Agent
Every modern AI agent has four parts: (1) an LLM as the reasoning engine, (2) a set of tools the agent can invoke, (3) memory (short-term context and optional long-term store), and (4) a control loop that decides when to act, when to call a tool, and when to stop. Frameworks like LangGraph, CrewAI, and AutoGen all express variations of this architecture.
The four components in detail:
- LLM brain. The reasoning engine — typically GPT-4-class, Claude, or Gemini. Responsible for parsing the task, deciding what to do next, and producing the final response.
- Tools. Functions the agent can call: search a knowledge base, query an API, execute code, send an email, write a file. Defined via OpenAI Function Calling schemas, Anthropic tool use, or framework-specific equivalents.
- Memory. Short-term context (the conversation so far, plus tool results) lives in the LLM's context window. Long-term memory (cross-session) typically uses a vector database or key-value store.
- Control loop. The orchestrator that runs perceive → reason → act → observe in a loop. Frameworks differ in how explicit and controllable this loop is — LangGraph makes it a graph, CrewAI makes it role-based collaboration, AutoGen makes it conversational.
AI Agent vs Chatbot vs Workflow
A chatbot answers single turns. A workflow executes predefined steps in a fixed order. An AI agent makes autonomous decisions about which steps to take, in what order, and when to stop — using an LLM as the decision-maker. Anthropic's 'Building effective agents' (Dec 2024) recommends using workflows when the path is predictable, and agents only when dynamic decision-making is required.
The clean distinction:
- Chatbot. Single-turn or multi-turn dialogue. No tool use, no autonomous action. Output is text.
- Workflow. A predefined chain of steps (sometimes including LLM calls). Order is fixed by the developer. The LLM does not decide what to do next; it just fills in steps.
- Agent. The LLM decides what to do next at each step — whether to call a tool, ask a clarifying question, or stop. Order is dynamic and model-driven.
Anthropic's December 2024 engineering guide emphasizes a pragmatic point: most production systems should be workflows, not full agents. Agents add power but also add cost, latency, and unpredictability. Reach for an agent only when the task genuinely requires dynamic decision-making.
Common Types of AI Agents
The most common types in 2026 are: tool-use agents (single LLM + tools, the dominant pattern), ReAct agents (reasoning interleaved with acting), planner-executor agents (a planner agent decomposes the task, executor agents run the steps), multi-agent systems (multiple specialized agents collaborate), and human-in-the-loop agents (the loop pauses for human approval).
- Tool-use agent. The simplest and most common — one LLM, a list of tools, a control loop. OpenAI Function Calling / Anthropic tool use is the underlying primitive.
- ReAct agent. Reasoning and acting interleaved. The agent thinks out loud (Reason), then takes an action (Act), then observes the result, then thinks again. Introduced in the ReAct paper (Yao et al. 2022).
- Planner-executor. A planner agent decomposes the task into steps; one or more executor agents carry them out. Useful for long-horizon tasks.
- Multi-agent system. Multiple specialized agents collaborate (researcher, writer, reviewer). CrewAI and AutoGen are designed around this pattern.
- Human-in-the-loop (HITL) agent. The loop pauses at defined points to request human approval before taking high-risk actions. Required for many enterprise and high-risk EU AI Act use cases.
Ready to build your first AI agent?
Alice Labs ships production AI agents — including governance, observability, and human-in-the-loop controls — for enterprises across Sweden and Europe.
Talk to an agent engineerWhen to Use an AI Agent (and When Not To)
Use an agent when the task has unpredictable structure, requires multiple tool calls, or benefits from iterative refinement. Skip it when the task is a fixed sequence (use a workflow), single-turn (use a chatbot or function call), or low-tolerance for non-determinism (use deterministic code).
The pragmatic decision rule:
- Use an agent when: the task path is genuinely unpredictable, the agent needs to choose among many tools, or iterative refinement (think → try → revise) produces materially better results.
- Use a workflow when: the steps are known in advance, even if some steps involve LLM calls. Workflows are cheaper, faster, and more predictable.
- Use deterministic code when: the task can be expressed as traditional logic. LLMs are not good at math, exact lookups, or strict business rules — keep those in code.
Frequently Asked Questions
Further reading
- Anthropic — Building effective agents (Dec 2024)· anthropic.com
- OpenAI Function Calling documentation· platform.openai.com
- ReAct: Synergizing Reasoning and Acting in Language Models (Yao et al. 2022)· arxiv.org
- LangGraph documentation· langchain-ai.github.io