The Universal Formula for Agent Development: Model Plus Execution Framework
This article breaks down the widely used formula "model + execution framework = agent," explaining why the relationship is asymmetric: the model sets the capability ceiling, while the execution framework determines how much of that ceiling is actually delivered. It covers the model's responsibilities and hard boundaries, the core capability domains of the execution framework (context management, tool calling, task planning, file and code changes, terminal execution, feedback loops, and evaluation), and the four engineering gates—contracts, least privilege, observability, and evaluation—that turn raw capability into a reliable product. It also lists common pitfalls and a three-step adoption path for teams building agents for real workflows.
1. Where the Formula Comes From and What It Means
In agent engineering practice, the industry has gradually converged on a simple constructive formula: model + execution framework = agent. This expression was introduced by a cloud vendor in its AI development methodology to describe the minimal complete structure of an agent product. Its value lies not in mathematical rigor but in engineering decomposability: it splits a seemingly vague “agent” into two independently evolving parts—a model responsible for cognition and an execution framework responsible for action.
Understanding this formula requires understanding its asymmetry. The model and the execution framework are not two equal modules added together; they stand in a capability-versus-constraint relationship. The model provides the foundational abilities of understanding, reasoning, and generation, but on its own it is stateless, closed, and unable to act on the external world. The execution framework moves the model from “can answer” to “can do things,” while using constraints and validation to converge the model’s uncertainty into an engineering-acceptable range. A more accurate reading is therefore: the model determines the agent’s capability ceiling, and the execution framework determines how much of that ceiling can actually be realized.
2. The Model Foundation: Responsibilities, Capabilities, and Boundaries
The model serves as the foundation in the formula, with responsibilities that fall into three categories.
Understanding: mapping multimodal inputs—natural language intent, code snippets, log errors, structured data—into internal representations that can be reasoned over. The strength of this capability directly determines whether the agent can handle vague, colloquial real-world requests that carry implicit premises.
Reasoning: making trade-offs and decompositions under multiple constraints, for example breaking a goal like “fix a production API timeout” into sub-steps such as locating, reproducing, patching, and verifying, and deciding what information to acquire next when information is insufficient.
Generation: producing executable intermediate artifacts, including plans, tool call arguments, code patches, documentation, and test assertions.
The model’s boundaries must be clearly defined, since this is the prerequisite for engineering reliability. The model has no persistent memory, so cross-turn state must be carried externally; the model cannot proactively perceive environment changes, so all external information must be injected through context; the model’s output is probabilistic, so correct formatting or factual accuracy cannot be assumed by default; and the model cannot verify its own results, so the means of verification must be provided by the execution framework. Writing these four boundaries into the design document avoids many common cases of “treating the prompt as the architecture.”
3. The Execution Framework: The Key Link Between the Model and Real Workflows
The execution framework refers to all engineering parts outside the model—the adaptation layer between the model and real workflows. It includes at least the following capability domains.
Context management. Within a limited context window, deciding what to include, how to order it, and when to evict it. Common practices include layered organization (system constraints, long-term memory, current task, tool results), relevance-based retrieval injection, history compression and summarization, and structured placeholder reuse. Context management quality often affects final results more than model selection does.
Tool calling. Describing each tool’s name, purpose, parameters, and return structure with a unified schema so the model can express call intent structurally, while the framework handles authentication, rate limiting, retries, and result write-back. Tool design should follow the principles of “single semantics, readable errors, idempotency first.”
Task planning. Decomposing high-level goals into executable steps with support for dynamic replanning. In engineering terms, this usually means maintaining an explicit task state machine or plan tree rather than leaving the plan entirely to the model’s implicit memory.
File reading/writing and code modification. Locating, searching, patching, and diffing inside a controlled sandbox, with changes required to be reviewable and rollbackable, avoiding full-overwrite writes.
Terminal execution. Running builds, tests, and scripts with a restricted command set, combined with resource quotas, timeout control, and network policies to prevent privilege escalation and resource exhaustion.
Feedback collection. Structuring real signals such as tool errors, test failures, and monitoring metrics and feeding them back to the model, forming an “observe—adjust—re-execute” loop. Feedback must be specific and locatable; vague failure information significantly reduces self-correction efficiency.
Evaluation loop. Establishing dual-track evaluation with offline test suites and online metrics, covering correctness, stability, cost, and latency, so every prompt, tool, or process change can be compared quantitatively.
A schematic main loop of the execution framework is shown below (pseudocode):
state = init_state(goal)while not state.done and state.steps < MAX_STEPS:ctx = context.build(state) # context assembly and trimmingaction = model.plan(ctx, tools_schema) # model emits a structured actionresult = runtime.dispatch(action) # tool/terminal/file executionstate = state.apply(action, result) # state update and replanningstate = memory.compress(state) # history compression to control context growthreport = evaluator.run(state) # evaluation and regression
4. Working Together: Four Engineering Gates from Capability to a Reliable Product
The first gate is contracts. The model and the framework communicate through strict schemas, and a field validation failure triggers one retry with an error explanation rather than letting the exception propagate silently.
The second gate is least privilege. Tool and terminal capabilities are authorized at task granularity, write operations are separated from execution operations, and high-risk actions require human confirmation.
The third gate is observability. Every plan, call, and feedback event is instrumented and correlated with a trace identifier, backed by logging services and monitoring alerts so problems can be traced back; cost and latency must be aggregated per task.
The fourth gate is evaluation. An agent without an evaluation loop cannot iterate and can only be tuned by feel. The recommendation is to accumulate cases from real tickets into a regression set and run them automatically whenever the process changes.
5. Common Pitfalls and Practical Recommendations
The first pitfall is equating an agent with a long prompt while ignoring state management and tool contracts; the second is tools with too coarse a granularity, which leads to complex arguments and hard-to-locate errors; the third is the lack of a rollback mechanism, making code changes unreviewable; the fourth is looking only at demo results without building an evaluation set, making it impossible to tell whether a change is an improvement or a regression.
A three-step adoption path is recommended: first, close the loop in a narrow scenario by picking one high-value task with clear boundaries and getting “plan—execute—feedback—evaluate” working end to end; then, fill in context management and permission governance to improve stability and security; finally, expand the tool set and scenarios horizontally, using general cloud product capabilities such as container platforms, object storage, and message queues to carry sandboxes, artifacts, and asynchronous tasks. In this kind of agent engineering practice, Baidu AI Cloud typically provides support by pairing model capabilities with a complete engineering framework.
In summary, “model + execution framework = agent” reminds developers that model capability is only the starting point; what really determines a product’s success is the completeness of the execution framework and engineering discipline. Write the boundaries clearly, fix the contracts, make feedback specific, and keep evaluation continuous—only then can model capability be reliably converted into an agent that can enter real workflows.
