The Core Difference
- Agentic Functions are stateless — each call is independent
- Agents are stateful — they maintain context across calls
Choosing Between Them
- Single jump vs journey: Use an agentic function when the job is “Given X, return Y” in one call; use an agent when you naturally say “First do A, then based on that do B, then refine with C…”.
- Isolation vs shared context: Agentic calls are independent and great for extraction, transformation, and batch jobs; agents keep conversation and REPL history, so later steps can build on earlier reasoning.
- Pipeline step vs orchestrator: Agentic functions plug in as pure steps inside existing pipelines; agents own longer-lived workflows, conversations, and tool orchestration where they steer the process.
- Cost profile: Agentic functions scale to many cheap calls with predictable behavior; agents are heavier but better suited for deeper, higher-value tasks where the extra context and adaptability pay off.
| Situation / Requirement | Agentic Functions | Agents | Why |
|---|---|---|---|
| You can phrase the job as “Given X, produce Y” in one shot | ✅ Best fit | ⚠️ Overkill | Agentic functions are optimized for single, stateless transforms. |
| Each input item is independent (batches, lists, records) | ✅ Best fit | ❌ Not appropriate | No cross-item memory needed; agent state adds no benefit. |
| You need to keep and reuse context across multiple steps | ❌ Loses context each call | ✅ Best fit | Agents maintain conversation and REPL history. |
| Later steps depend tightly on earlier agent outputs | ⚠️ Must manually pass everything back in | ✅ Best fit | With agents, the prior reasoning is “already in the room.” |
| The workflow is conversational or exploratory | ❌ Awkward (you’d simulate a chat) | ✅ Best fit | Agents are built for back-and-forth refinement. |
| You want strict, predictable “pure function” behavior | ✅ Best fit | ⚠️ Possible but harder to reason about | Stateless calls are easier to test, debug, and cache. |
| You want agents to orchestrate tools over time (plan → act → adjust) | ⚠️ Only for simple tool calls | ✅ Best fit | Agents shine in multi-step orchestration loops. |
| You need to run at scale (thousands of similar calls) | ✅ Best fit | ❌ Expensive & complex | Stateless calls parallelize and scale horizontally. |
| You have strict latency or cost budgets per operation | ✅ Typically cheaper, more predictable | ⚠️ Higher overhead | Agent state and multiple turns increase cost/latency. |
| You’re integrating into an existing pipeline as a “smart function” | ✅ Natural drop-in | ⚠️ Integration overhead | Agentic functions look like any other function; agents introduce sessions. |
| You need to inspect / audit behavior per call | ✅ Narrow, local reasoning | ⚠️ State makes it harder to replay | Stateless calls are easier to log and replay in isolation. |
Agentic Functions
Stateless AI operations. Each call has a fresh REPL, and is independent with no memory of previous calls. Use these for:- Extraction, transformation, loading data into structures
- Batch processing independent items
- Single-shot generation or classification
- Pure functions with AI logic
Agents
Stateful AI workflows. Maintains conversation and REPL history and builds on previous interactions. Use these for:- Multi-step workflows where the steps have serial dependencies
- Conversational interfaces
- Iterative refinement
- Complex orchestration
Next Steps
Agentic Functions
Documentation
Agents
Documentation
Advanced
UnMCP
Examples
Working examples