LLMs vs. AI Agents: Cognitive Generation vs. Executable Workflows
Large language models generate text from context; agents add tools, orchestration, and state so work can actually complete. This article clarifies that boundary, the four-layer stack, why “thinking” still fails without a closed loop, and how request volume versus prompt-cache hit rate drives cost—plus engineering trade-offs between features and cache stability.
From “can talk” to “can act”: draw the boundary first
A large language model (LLM) is a conditional generation system: given context and instructions, it predicts the next tokens. It can summarize documents, write code, and break down plans, and it can look like it is “thinking” in a conversation. Without an external execution channel, it cannot open a webpage, read files on your machine, send email, change configuration, or call business systems. Output stays natural language or structured text; whether the task finishes depends on a human doing the work.
An agent treats the model as a decision and planning hub and attaches observable, invocable, feedback-capable “hands and feet.” A typical path is: understand the goal → choose tools or sub-flows → execute → read results → judge whether the bar is met → replan if needed. Web search, workspace I/O, browser or office automation, and schedule-triggered jobs belong to the execution layer—not magic baked into model weights.
For developers and enterprises, this split drives architecture: a chat API alone yields an assistant; shippable, inspectable workflows need tool protocols, permission boundaries, state, and failure recovery.
Capability layers: cognition, tools, orchestration, and memory
Split the system into four layers so “a strong model” is not mistaken for “a system that can do work.”
Cognition understands intent, decomposes steps, and asks questions or decides conservatively under uncertainty. Model differences show up in wrong tool choice, hallucinated calls, and premature stop—but no model can cross unauthorized networks or filesystems.
Tools wrap real capabilities as callable interfaces: retrieval, files, browsers, messaging, code execution, internal APIs, and so on. Tool descriptions (name, parameter schema, return contract) enter the prompt. When the schema changes, the model’s picture of what it can do changes, and wrong-tool rates rise. That is an engineering problem, not a copywriting problem.
Orchestration decides when to call the model, when to run in parallel, when to hand off to a sub-agent, and when to compress context. A separate compression call or a runtime model switch changes the context fingerprint of later requests.
Memory and state cover session history, long-term preferences, skill libraries, and scheduled-task state. Cross-session or multi-day memory stuffed into the system prompt both burns tokens and tends to invalidate cache keys.
Almost all of an agent’s increment over a raw LLM lives in the last three layers. Benchmarks that only score single-turn generation systematically understate closed-loop complexity.
Why “it can think” still does not finish the job
In practice, failures rarely come from the model’s inability to write a plan. They come from a missing loop:
- Unreliable observation: retrieval ran but results never returned to context, or the browser snapshot was too coarse.
- No termination: the model keeps “checking one more step,” spend rises, and the business gets nothing.
- Permissions and side effects: it can write files without sandboxing and audit, so enterprises will not go live.
- Combinatorial tools: each new capability adds failure modes (timeouts, auth, format drift).
Agent product completeness often shows up as: UI and CLI consistency, long-term memory and skill loading, messaging integration, browser automation, sub-agent division of labor, runtime model switching, and evolving skills. None of these is hard in isolation; the hard part is stability, observability, and controllable cost at once.
Cost structure: request count and cache hit rate
Under token billing, an agent bill is rarely “unit price × one answer.” One user task can expand into tens or hundreds of model calls: planning, tool selection, digesting tool results, self-check, compression, sub-agents. Request count itself is a cost multiplier.
The other lever is prompt cache. If the system prompt, tool definitions, and long document prefixes stay byte-stable across requests, later calls can hit cache and cut input cost and latency. Hit rate falling from high to middling, stacked on request inflation, can move total cost by an order of magnitude. Abstractly: fewer requests and high hits keep the bill in check; many requests and low hits make even flashy features hard to scale.
Exact amounts depend on model, pricing tier, cache policy, and task shape; a single bake-off number is not a universal conclusion. The mechanism is general: request count × (1 − effective cache hit rate) often explains bill differences better than “which vendor’s model.”
Structural tension between features and cache
Many “useful agent features” break cache stability. That is protocol tension, not sloppy implementation.
Runtime model switch. If the model id is in the system prompt, a switch invalidates the whole prefix and cold-starts cache. If it lives in request metadata instead of the prompt, cache can survive, but orchestration must track the current model plus billing, rate limits, and capability differences (context window, tool-call format). Across calendar days or session rebuilds, cache windows also expire; product policy must version stable prefixes and separate hot vs. cold load.
Every extra tool. The easy path is to grow the tool list and JSON schema. The system prefix gets longer and more volatile, the cache invalidation surface grows, and the model is more likely to pick the wrong tool or drop parameters. A more stable approach is to mount a minimal toolset by scenario, or inject infrequent capabilities as on-demand “skill packs” instead of always exposing everything. Injection still changes the prefix, so split a stable, cacheable core from variable plugins whose misses stay local.
Context compression. When the dialogue grows, the easy move is a separate summarization call, then stitch the summary back. That call almost never hits cache; the summary differs every time, so the main dialogue’s later prefix changes too—you are voluntarily abandoning cache. Alternatives include sliding windows that truncate the middle, structured memory separate from raw text, and external retrieval for stable knowledge instead of stuffing it into the system prompt. Each loses information; you trade “don’t blow the window” against “don’t kill the cache.”
Either pole is easy: cut features and hit rate rises; ignore the bill and you can stack features. Doing full function (UI, memory, skills, schedules, messaging, browser, sub-agents, model switching, hot skill load) and high hits is a systems design problem.
Practical engineering compromises
- Layer the prefix. Version the most stable system role, safety policy, and core tool schemas at the front; put user profile, day’s skills, and current model as far back as possible or in request-level fields.
- Minimal toolsets. Route tool packs by task type instead of one global kitchen sink. Prefer dynamic skill load for new capabilities and assess impact on the cache key.
- Decouple compression from the main dialogue. If you must compress, store summaries in memory; keep the main path on a stable template. Avoid rewriting the entire system prompt on every compression.
- Observe the request graph. Log per-task request count, cache hits, tool errors, and early stops. Optimize request inflation and miss causes together, not only cheaper models.
- Default-minimal permissions and side effects. Once agents have hands and feet, enterprises stall on audit, approval, and rollback—not on one more demo skill.
On the cloud, object storage can hold skills and artifacts, queues can carry async and scheduled work, containers can run sandboxed executors, and logging plus alerts can cover tool failures and cost spikes. Treat these as execution backends; do not cram everything into one oversized prompt.
How to choose: conversational assistant or task agent
If the need is Q&A, drafting, or explaining code, an LLM plus retrieval is often enough: short path, easier cache, bounded risk. If the need is “research, land files and notifications, and change state across systems until done,” you must build as an agent: tool contracts, state machines, human confirmation points, cost guardrails.
Evaluate agents on three things at once: task completion (including recoverable failure), requests per task and cache hit rate, and whether feature changes constantly jitter the prefix. A long feature list with structurally low hits lets cost eat the experience; high hits with missing capability fail real workflows. Product strength is balancing the two with architecture, not slogans.
The model supplies general cognition; the agent connects cognition to an executable world. That layer is the shared language for later model choice, prompt design, and cloud operations.
