AI Agent Execution Frameworks Explained: From Tool Calling to Plugin-Based Architecture
This article breaks down what an AI agent execution framework (also called an Agent Harness or Agent Runtime) actually does and why a model alone is not enough to complete real tasks. It explains the core perception–planning–execution–feedback loop, the context budget problem that appears when tool outputs are large, and the common engineering response of truncation, summarization, and structured references. A pseudocode skeleton illustrates the control flow, and the article closes by introducing the plugin-based idea of making everything except the kernel replaceable. Readers will come away with a clear mental model of how a framework turns model decisions into real operations on files, shells, APIs, and databases.
1. Why a “Brain-Only” Model Is Not Enough
Over the past two years, the main line of large model progress has been “better talking”: longer context, more reliable instruction following, and stronger code and text generation. But in real business work, users do not want a paragraph of text back. They want a thing to be finished — a batch of files archived according to rules, the anomalous time windows pulled out of production logs for root cause analysis, or a spreadsheet turned into a daily report and delivered to a specific location. These requests share one trait: the result has to land in an external system, not stay inside the chat window.
This is the problem an agent execution framework (commonly called an Agent Harness or Agent Runtime) is meant to solve. You can think of it as giving the model a body: the model understands intent and makes decisions, while the framework turns those decisions into real operations against the file system, the command line, network interfaces, databases, and various business systems, then feeds the result of every step back to the model to close the loop.
Worth stressing: the framework does not raise the model’s raw intelligence. What it raises is the rate at which the model converts intelligence into productivity. The same model, called nakedly with no tools, no state, and no retry mechanism, can accomplish very little. Once it is connected to a mature execution framework, the complexity of tasks it can complete differs by orders of magnitude.
2. The Core Abstraction: A Perception–Planning–Execution–Feedback Loop
A usable execution framework is essentially running the following chain in a cycle:
- Perception: collect the task context, including the user instruction, the working directory structure, the list of available tools, the history of prior steps, and the current environment state.
- Planning: the model breaks the goal into ordered or parallelizable sub-steps and picks the tool and arguments for each step.
- Execution: the framework actually invokes the tools in a controlled environment and captures standard output, error codes, returned structures, or file changes.
- Feedback: the execution result is normalized and injected back into the context, and the model uses it to decide whether to continue, correct course, or stop.
The key design point in this chain is context budget management. Tool output is often huge — a log file, an API response. If it is stuffed back into the context as-is, the window fills up after just a few rounds. The common engineering practice is truncation + summarization + structured references: keep only the fields relevant to the decision, leave the full content in external storage behind a handle, and read it back by reference when needed.
A sketch of the loop skeleton looks like this (pseudocode, control flow only):
def run(task, tools, max_steps=40):state = State(goal=task, history=[])for step in range(max_steps):decision = model.decide(state, tool_schema=tools.schema())if decision.type == "final":return decision.answerresult = tools.invoke(decision.name, decision.args, timeout=30)state.append(compress(result)) # truncate / summarize / referenceif result.failed and step_retries(state) < 2:state.hint("Last call failed. Fix the arguments or try another path.")return partial_report(state)
3. Plugin-Based Architecture: Everything Is Replaceable
The most worth-extracting point from the source material is “make everything except the kernel
