What are agents?
An agent is an AI system that can autonomously execute tasks by making decisions about tool usage and process flow. Unlike traditional automation that follows predefined paths, agents can dynamically adapt their approach based on context and intermediate results. Agents are also distinct from co-pilots (such as traditional chat applications) in that they can fully automate a task, as opposed to simply augmenting and extending human input.
- Agents → non-linear, non-deterministic (can change from run to run)
- Workflows → linear, deterministic execution paths
- Co-pilots → augmentative AI assistance requiring human intervention
If this is your first time working with or interacting with agents, this example illustrates how an agent works within a context like booking a vacation.
Imagine you are trying to book a vacation. You need to research flights, find hotels, check restaurant reviews, and keep track of your budget.
A traditional automation system follows a predetermined sequence:
- Takes specific inputs (dates, location, budget)
- Calls predefined API endpoints in a fixed order
- Returns results based on hardcoded criteria
- Cannot adapt if unexpected situations arise
A co-pilot acts as an intelligent assistant that:
- Provides hotel and itinerary recommendations based on your preferences
- Can understand and respond to natural language queries
- Offers guidance and suggestions
- Requires human decision-making and action for execution
An agent combines AI's ability to make judgments and call the relevant tools to execute the task. An agent's output will be nondeterministic given:
- Real-time availability and pricing changes
- Dynamic prioritization of constraints
- Ability to recover from failures
- Adaptive decision-making based on intermediate results
An agent can dynamically generate an itinerary and execute on booking reservations, similarly to what you would expect from a travel agent.
Agent systems typically have three primary components:
- Decision Engine: Usually an LLM (Large Language Model) that determines action steps
- Tool Integration: APIs, functions, and services the agent can utilize — often via MCP
- Memory System: Maintains context and tracks task progress
Agents operate in a continuous loop of:
- Observing the current state or task
- Planning what actions to take, using AI for reasoning
- Executing those actions using available tools
- Learning from the results (storing results in memory, updating task progress, and preparing for next iteration)
The Cloudflare Agents SDK provides the infrastructure for building production agents:
- Persistent state — Each agent instance has its own SQLite database for storing context and memory
- Real-time sync — State changes automatically broadcast to all connected clients via WebSockets
- Hibernation — Agents sleep when idle and wake on demand, so you only pay for what you use
- Global edge deployment — Agents run close to your users on Cloudflare's network
- Built-in capabilities — Scheduling, task queues, workflows, email handling, and more
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2026 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-