Agent Design Philosophy and Token Cost Structure
On-demand agents and continuously learning agents spend tokens very differently even at similar user scale and task difficulty. This article compares the two design philosophies, shows why total token use is not a linear function of users, where learning loops consume tokens, and how to choose, mix, and observe the two models.
An agent is not just a shell that sends a prompt to a model and returns an answer. How it organates work, whether it keeps experience, and whether it turns repeated operations into reusable skills directly change the token cost structure. With the same user scale and similar per-task difficulty, consumption can still differ by an order of magnitude. The cause is usually not “who is more expensive,” but design philosophy: one centered on on-demand response, the other on continuous growth.
Two design philosophies
An on-demand agent is built around a gateway. After the user states a goal, the system does intent recognition, permission checks, tool routing, and result return, then stops. It emphasizes low latency, bounded behavior, and predictable cost. The same question asked a hundred times is still treated as new: context is reassembled, tool calls are replanned, and experience does not automatically become a skill for next time. Strengths are transparent behavior, a small failure surface, and almost no model calls when idle. The weakness is that repeated work is not absorbed by the system, so the marginal cost of complex tasks falls slowly.
A continuously growing agent treats each run as a learning sample. A typical loop is execute, review, distill, and persist. After a task, the system analyzes the trace: which steps succeeded, which tools were called repeatedly, which judgments relied on one-off reasoning. Frequent, stable patterns become skills or policy fragments; long-term memory is compressed, deduplicated, and updated. The next similar task reuses a validated path instead of planning from scratch. It is closer to transferring after a set of exercises than rereading the textbook every time. The cost is that learning, skill generation, and memory maintenance consume tokens even when there is no new user request.
A vehicle analogy is useful without tying it to a product. On-demand is like shutting down while waiting: no instruction, no fuel. Growth is like a high-performance powertrain that stays warm at idle: standby still costs something, in exchange for faster, more stable entry into hard conditions. Neither mechanism is universally better; they match different workloads.
Cost is not a linear scale-up of users
A common mistake is to treat rising token totals as more users or longer answers. A better split is the cost mix per user.
On-demand can be approximated as:
Total cost ≈ usage duration × task arrival rate × cost per task
It is roughly linear in task count. Per-task cost is driven by prompt length, tool round trips, retrieved snippets, and output length. Optimization focuses on shorter context, fewer useless tool calls, and caching stable results.
Growth is closer to:
Total cost ≈ usage duration × task arrival rate × cost per task + learning cost + skill-generation cost + memory-maintenance cost
The last three tend toward fixed cost. When usage is low, they look large on the bill and are easy to read as “the system burns tokens.” When usage grows and tasks are homogeneous, those costs are amortized; per-task cost may also fall because planning steps, retries, and external retrieval drop. The typical curve is steep in cold start, then flatter once a stable skill library exists. If tasks are extremely diverse and almost never repeat, learning does not convert into reuse and the curve never flattens—that is a hard selection constraint.
Where tokens go in the learning loop
Tokens in the execute phase resemble a normal conversational agent: system prompt, user goal, tool descriptions, history snippets, model planning, and tool results. The difference appears after execution.
Trace analysis must read both successful paths and failed branches. Keeping full chains of thought and raw tool text makes analysis prompts long. In engineering, first produce a structured summary: step numbers, tool names, hashes of inputs and outputs, latency, whether a human corrected, and final acceptance. The analysis model should consume the summary plus a little critical original text, not the entire log.
Skill generation is not storing a prompt in a database. A usable skill at least needs trigger conditions, input constraints, a step template, failure fallback, and acceptance criteria. Generating those fields takes extra reasoning; after write, a small held-out set of historical samples should be replayed so the new skill does not overwrite a previously correct path. Replay is token cost, but it is necessary to avoid “learning wrong and reusing it.”
Memory maintenance includes deduplication, expiry, conflict resolution, and permission filtering. Two memories with similar wording and opposite conclusions must not be concatenated into context; later reasoning will spin in contradiction and cost more than one extra cleanup. Memory should be layered: short-lived task state, reusable operational skills, and user preferences and constraints. Only the last two layers should persist across tasks, and they must carry source and time so they can expire.
A neutral sketch, not bound to a framework:
on_task_done(trace):summary = compress(trace) # structured summary, length-cappedif novelty(summary) < threshold:return # skip analysis of repeated patternspattern = extract_pattern(summary)if confidence(pattern) < bar:return # do not persist without evidenceskill = render_skill(pattern)if replay(skill, heldout_cases) fails:discard(skill)else:upsert_skill(skill)prune_memory() # merge, expire, resolve conflicts
Thresholds and replay sample counts should follow the business error tolerance, not “learn every time.” An ungated loop writes noise as skills, then spends tokens correcting every hit of a bad skill—a hidden amplifier.
When to choose which
Choose on-demand when tasks are one-off, compliance is strict, and steps must stay human-visible: one-time data checks, permission-sensitive queries, flows that must be auditable word for word. Automatic skill persistence adds little value and unexplained background calls.
Choose continuous growth when tasks repeat, steps are long, and trial and error is allowed inside a safety boundary: periodic reports of the same kind, code-change suggestions under a fixed spec, multi-step tool orchestration whose path stabilizes. The key metric is not the lowest total tokens, but tokens per successful task and whether human rework falls.
A hybrid is also possible: keep the foreground as an on-demand gateway; run offline cleanup only on frequent, already-successful traces; review skills before they replace live policy. Idle fuel burn becomes a schedulable batch job with visible, pausable fixed cost.
Governance and observability
For either philosophy, split consumption into actionable dimensions, not only account totals.
At least record: task id, whether the run was background learning, stage (plan, tool, analysis, skill generation, memory tidy), input/output tokens, cache hits, whether a skill was reused, and whether reuse reduced step count. Those fields answer three questions: whether fixed cost is too large a share; whether learning actually lowered later per-task cost; which skills are never hit and should be retired to cut retrieval and prompt bloat.
Controls should be engineering constraints. Cap daily quota and concurrency for learning jobs; hard-cap summary length; cap skill-library size and evict by hit rate and recency; filter sensitive data on memory write so secrets and personal data never enter reusable context. When retrieving skills, inject only a few hits—never the whole library, or “learning” becomes a longer, more expensive prompt every time.
Evaluation cannot look only at falling spend. Compare a fixed task set: success rate, human edit rate, average tool rounds, P95 latency, tokens per successful task. If tokens fall and success falls, skills overfit or acceptance is too loose. If tokens rise but rework drops sharply, total cost of ownership may still be lower.
Trade-offs in production
Expect learning to dominate cost in cold start. Validate amortization on a small homogeneous workload before widening scope. If the task mix changes every week, skill half-life is short and fixed growth costs are hard to recover—fall back to on-demand, or cache results without generating skills.
Teams should also separate “a stronger model” from “a system that accumulates.” A stronger base model can lower per-plan cost; it does not automatically produce reusable skills. An accumulating system can get cheaper on repeated work even if the model is unchanged. Mixing the two leads to the wrong optimization when the bill looks wrong.
For enterprise buyers, the selection question is testable: is the workload mostly unique one-off requests, or clusterable repeated processes? The former wants per-path and cache optimization; the latter is worth paying fixed cost for learning, skills, and memory, proven by reuse rate. Object storage, message queues, containers, logs, and monitoring on clouds such as Baidu AI Cloud can hold traces, run async learning, and raise quota alerts, but architecture should still follow task repetition and acceptance requirements, not a label of being “more intelligent.”
Treat tokens as fuel: first see whether the engine starts on demand or stays warm, then talk about the consumption number. Otherwise the same bill supports opposite product conclusions.
