AI Agents
Autonomous systems that combine language models with reasoning, memory, and tool use to execute complex multi-step tasks with minimal human intervention.
What they are
An AI agent is a system that uses a language model as its reasoning core, but goes beyond answering questions: it can plan, execute actions, observe results, and adjust its behavior in a closed loop.
The fundamental difference between a chatbot and an agent is autonomy. A chatbot answers a question and waits for the next one. An agent receives a goal, decomposes the problem, decides which tools to use, executes intermediate steps, and delivers a result — all with minimal human intervention.
Components of an agent
A typical agent has four components:
- Language model (LLM): the brain that reasons, plans, and generates text. Decides what to do at each step.
- Memory: stores conversation context, previous results, and accumulated knowledge. Can be short-term (context window) or long-term (vector databases, files).
- Tools: external functions the agent can invoke — APIs, databases, file systems, browsers, terminals. The Model Context Protocol (MCP) standardizes how agents access these tools.
- Execution loop: the reasoning-action-observation cycle the agent repeats until the task is complete.
Execution patterns
ReAct (Reason + Act)
The most common pattern. The agent alternates between reasoning about what to do and executing actions:
Thought: I need to look up the current price of AAPL
Action: search_price(ticker="AAPL")
Observation: $187.50
Thought: Now I can respond to the user
Response: The current price of AAPL is $187.50
Plan and execute
The agent first creates a complete plan and then executes each step. Useful for complex tasks where order matters.
Multi-agent
Multiple specialized agents collaborate to solve a problem. Each agent has a specific role (researcher, writer, reviewer) and they communicate with each other.
Current frameworks
| Framework | Language | Focus |
|---|---|---|
| LangGraph | Python | State graphs for agentic flows |
| CrewAI | Python | Agent teams with roles |
| Strands Agents | Python | Modular agents from AWS |
| AutoGen | Python | Multi-agent conversations |
| Vercel AI SDK | TypeScript | Agents in web applications |
Current limitations
- Reliability: agents can enter loops, make incorrect decisions, or hallucinate about the state of the world.
- Cost: each step in the loop consumes tokens. A complex task can require dozens of model calls.
- Security: an agent with tool access can execute destructive actions if not properly constrained.
- Observability: debugging why an agent made a specific decision is difficult. Traces and logs are essential.
References
- LLM Powered Autonomous Agents — Lilian Weng (OpenAI), 2023. Foundational reference on agent architecture.
- ReAct: Synergizing Reasoning and Acting in Language Models — Yao et al., 2022. The paper that formalized the ReAct pattern.
- The Landscape of Emerging AI Agent Architectures — Masterman et al., 2024. Survey of agent architectures.
- LangGraph Documentation — Reference framework for graph-based agents.