agent
An agent is a system that perceives its environment, selects actions to pursue goals, and closes the loop by observing outcomes to inform future decisions. What sets an agent apart is autonomy: the system itself decides which steps to take and which tools to call, rather than following a path someone hardcoded in advance.
In AI practice, this spans from reinforcement learning agents that optimize behavior in environments modeled by states, actions, and rewards, to language-model-driven agents that plan, call tools or APIs, maintain memory, and iterate over multiple steps until a task is complete.
Typical agent components include a planner or policy, an executor to carry out actions, an observation interface to read results, a verification step that checks the agent’s own output before it moves on, memory or internal state, and safeguards or constraints.
Agents differ from one-off model prompts by operating across multiple steps, interacting with external systems or environments, and adapting behavior toward long-term goals. They also differ from fixed workflows, where an LLM and its tools are orchestrated through predefined code paths. In a workflow, the sequence of steps is decided ahead of time. In an agent, the model chooses the next step at runtime.
Related Resources
Tutorial
Pydantic AI: Build Type-Safe LLM Agents in Python
Learn how to use Pydantic AI to build type-safe LLM agents in Python with structured outputs, function calling, and dependency injection patterns.
For additional information on related topics, take a look at the following resources:
- Building Type-Safe LLM Agents With Pydantic AI (Course)
- AI Coding Agents Guide: A Map of the Four Workflow Types (Tutorial)
- LangGraph Tutorial: Build Stateful AI Agents in Python (Tutorial)
- Pydantic AI: Build Type-Safe LLM Agents in Python (Quiz)
- AI Coding Agents Guide: A Map of the Four Workflow Types (Quiz)
- LangGraph: Build Stateful AI Agents in Python (Quiz)
By Leodanis Pozo Ramos • Updated Sept. 8, 2026