This is a set of notes on agent architecture that I put together for myself. I am also sharing it with anyone interested in the topic who wants a clearer picture of the overall structure.
When I return to it later, I want to be able to follow how the whole system works: what the model does, where tools, context, and memory belong, and how the program organizes successive calls into a task that keeps running.
The article starts with two overview diagrams: one maps the logical components, and the other maps the engineering layers. It then works through the components in those diagrams. Framework comparisons come later, once the overall structure is clear enough to examine what each project provides.
If you are working through these concepts too, I hope you will read along. Different interpretations and practical experiences are welcome.
1 Overall architecture: from logical relationships to engineering layers
The logical view: how an LLM and a Harness form an agent
A tool-using LLM agent can be summarized as follows: the LLM provides reasoning and decision-making capabilities, while the Harness organizes and executes the overall task process.
The LLM interprets the goal from its input, analyzes the information available, and produces an answer, a plan, or tool-call requests. The Harness prepares model inputs, initiates inference, dispatches tool calls, collects execution results, maintains state, and decides whether to continue running or return control to the user. The current LangChain Agents documentation uses the expression “Model + Harness”; OpenAI's explanation of the Codex agent loop describes this division through an actual execution process.
This article uses Harness in a broad sense: the runtime system around a model that enables it to carry out tasks. It includes tool integration, context organization, memory reads and writes, task orchestration, and the execution loop. An implementation can be small, or it can gradually grow into a complete environment for sessions, storage, and execution.

Logical composition: an agent contains an LLM and a Harness. The Harness lists Tools/MCP, Context, Memory, and Orchestrator, along with the four functions of the Agentic Loop: perception, decision, action, and reflection. Nested boxes indicate composition; the execution process is explained later.
From this diagram, the Harness can be understood as four groups of responsibilities:
| Component | Main question it answers | Relationship to the model |
|---|---|---|
| Tools / MCP | What can the system read or execute, and how does it connect to external capabilities? | The model requests a call; the executor performs the operation and returns the result |
| Context | What information should be supplied for this inference call? | Directly forms the model's current input |
| Memory | What information should be retained, and how can it be retrieved later? | Selected memories can participate in the current inference only after they re-enter the context |
| Orchestrator / Runner | What step runs now, and how are calls, collaboration, and termination arranged? | Coordinates the model, tools, and state to advance the Agentic Loop |
The capabilities of the LLM and the Harness affect one another. The model needs adequate reasoning and tool-use capabilities; the Harness needs to supply the right information and available actions. If tool results are not fed back or task constraints are left out of the context, subsequent decisions lack the information they need.
In LLM Powered Autonomous Agents, Lilian Weng organizes the main capabilities of an agent around Planning, Memory, and Tool Use. Simon Willison describes its basic operating form as using tools in a loop to achieve a goal. The former helps build a component map; the latter helps identify the main execution path. Together, they help explain this logical view.
The engineering view: Application, Framework, Runtime, and Foundation
Logical components describe the capabilities a system needs. Engineering layers go further by describing how software implements them. The system can be organized into four layers:

Engineering layers: the upper layers define the application and its control structure; the lower layers provide execution mechanisms and foundational resources. This is a map of responsibilities. A single project can cover several layers, and their code can run in the same process.
Application Layer: the business application.
This layer addresses actual users and use cases, such as assistants, coding assistants, and business automation. It defines task entry points, domain rules, interaction methods, and completion criteria. Chat interfaces, task panels, and integrations with business systems appear here.
The application layer decides what work the agent should do and for whom. Even with the same model and tools, different business rules and delivery requirements produce different applications.
Agent Framework: the development framework.
A framework provides abstractions and interfaces for developers to organize agents. These commonly include:
- Agent Definition: roles, instructions, and model and tool configuration.
- Tool Integration: local tools, MCP connections, and the integration of task guidance such as Skills.
- Orchestration: workflows, conditional routing, task decomposition, and agent collaboration.
- Memory Abstraction: interfaces for accessing messages, context, sessions, and memory.
LangGraph, the OpenAI Agents SDK, and Google ADK all appear among development choices at this layer, but they offer different abstractions and default execution models. Their shared purpose is to let developers express task structure without rebuilding it from raw model API requests each time.
Agent Runtime: runtime execution.
The Runtime puts configurations and workflows into operation. A Runner initiates model calls, executes tools, and processes results. State management maintains the current task and Session; a Scheduler arranges tasks and concurrency; Checkpoints support persistence and recovery; permissions, approvals, and sandboxes constrain actual execution.
Framework and Runtime are particularly easy to confuse. A useful distinction is definition versus execution: the framework describes the nodes, tools, and routes, while the runtime advances those nodes, saves state, and handles pauses, resumption, and termination. Many SDKs provide both, so this separation does not require choosing two independent products.
Foundation Layer: foundational capabilities.
The bottom layer supplies model inference services, Tools / APIs, databases, file systems, and knowledge-retrieval capabilities. Upper layers access these resources through interfaces. Database / RAG appears here as a knowledge capability the system can connect to; the complete RAG processing workflow may still be organized by the application and framework.
Relating the views: how a component fits into the engineering structure
The logical and engineering diagrams do not map onto one another block by block. A logical responsibility is often implemented across several layers:
| Logical element | Main implementation locations |
|---|---|
| LLM | Foundation supplies inference; Framework wraps the model interface; Runtime initiates calls |
| Tools / MCP | Framework registers and adapts capabilities; Runtime dispatches execution; foundational services perform the actual operations |
| Context | Application supplies domain constraints; frameworks or middleware organize information; Runtime adds current state and results |
| Memory | Upper layers choose retention and retrieval policies; frameworks provide interfaces; underlying files or databases store the data |
| Orchestrator / Agentic Loop | The framework expresses the control structure; Runtime advances execution; the application defines the goal and completion criteria |
When reading an agent project, it therefore helps to locate the model entry point, tool entry point, state, and control loop first, then examine how the project packages those responsibilities into modules. Projects with similar names can perform quite different work internally.
2 Core components: Tools, Context, Memory, and Orchestrator
Tools and MCP: bringing external capabilities into execution
A Tool is a specific capability an agent can use. It can retrieve information or change the environment: searching documents, reading files, running programs, and calling business APIs all fall within this scope.
A tool usually has three parts: a name and description, an input parameter structure, and an execution function. The model sees the first two and generates a call request. The Harness finds the corresponding implementation, passes in the arguments, obtains the result, and sends it back to the model. Function Calling supplies a structured request format; the program still performs the actual operation.
MCP addresses capability integration and communication. A host manages the model and task, connects to an MCP Server through an MCP Client, discovers the capabilities the service provides, and initiates calls. A Server can expose tools as well as resources and prompts. The roles are described in the official MCP architecture documentation.
When considering tool integration, it helps to distinguish three kinds of element:
| Element | What it provides | Position in the system |
|---|---|---|
| Tool / API | An executable or queryable capability | An action interface and the actual service |
| MCP | A protocol for discovering, accessing, and calling capabilities | The connection between a host and capability providers |
| Skill | Guidance, workflows, and related resources for a type of task | Enters context as needed to guide the use of existing capabilities |
These three can work together. A Skill describes how to approach a task, the model selects tools accordingly, and the Harness completes the calls through local functions or MCP. Grouping them under Tool Integration reflects a framework integration perspective; it does not mean they have the same technical form.
Tool design also affects decision quality. Tools with clear responsibilities, distinct parameters, and sufficiently informative results make it easier for the model to decide when to use them and how to continue. A tool that returns large amounts of irrelevant material places more filtering work on Context. Chip Huyen's Agents treats tools as an important way to extend knowledge and action capabilities, which also explains their central place in the architecture.
Context: organizing what the model can actually see in this call
Context is the effective input to the current model call. The model makes judgments from that input and its existing capabilities, rather than from every piece of data stored in the application.
Context commonly contains several kinds of information:
| Information | Purpose |
|---|---|
| System and domain instructions | Specify behavior, task scope, and output format |
| User goal | Explain what should be accomplished and any new requirements |
| Tool definitions | Tell the model which capabilities are available and how to express their arguments |
| Conversation and task state | Retain progress, known information, and unresolved issues |
| Retrieved material and memories | Supply external information relevant to the current task |
| Tool execution results | Tell the model what the previous action actually produced |
Context management continually does four things: selects relevant information, arranges the input structure, updates content as execution proceeds, and trims or compresses it when space is limited. Having a large amount of stored data does not mean it should all be sent on every call. The current goal, key constraints, and recent useful observations usually matter more than repeated history.
Tool results should also retain a structure the system can continue using. Call identifiers, sources, execution status, and necessary excerpts help the model associate results with the original request. Long files and logs can remain outside the context, with only relevant content and read locations included in the current input. Anthropic's discussion of Context Engineering examines selection, compression, and on-demand reading in detail.
Memory: retaining information across steps and sessions
Memory concerns how information persists. Context concerns what is visible now; Memory concerns what should remain and how to find it in the future.
Three scopes help distinguish different uses of memory:
| Scope | Common contents | Main purpose |
|---|---|---|
| Current task state | Goal, progress, plan, and pending work | Allow the task to continue |
| Session history | Messages, tool calls, and returned results | Restore the interaction and retain observations from the task |
| Long-term memory across sessions | Stable preferences, project knowledge, and reusable experience | Support later sessions |
This information can be stored as files, structured records, database entries, or retrievable documents. A vector database is only one retrieval option. Task IDs and structured state are often more direct when a system needs to locate a particular task; retrieval indexes are more useful when it needs to find related material by meaning.
To influence the current decision, memory must be read, selected, and brought back into Context. On the write side, the system must decide what is worth retaining, where it came from, whether it is outdated, and whether new and old information conflict. Saving every conversation preserves history, but does not automatically provide effective memory management.
LangGraph's Persistence documentation offers a concrete distinction: checkpoints save execution state within a thread, while a store shares information across threads. They serve execution continuity and information reuse respectively. When reading another framework's Memory module, it is also worth checking whether it actually stores conversations, retrieval documents, or recoverable task state.
Orchestrator: organizing tasks, routing, and collaboration
The Orchestrator is the system's orchestration and control component. It coordinates when to call the model, how to process its output, where to dispatch tool requests, and when to continue, hand off, or finish a task.
An orchestration strategy can be expressed through code, a graph, or model involvement. A fixed workflow specifies nodes and conditions in code. A dynamic agent can let the model choose the next action. A multi-agent system also needs task decomposition, result aggregation, and transfers of control.
The Agentic Loop describes how these controls recur during execution. The Orchestrator / Runner drives the loop, the LLM supplies decisions within it, and tools bring feedback from the environment. Their relationship is that of a control component and an execution process; there is no need to invent two separate services for them.
Orchestration and scheduling also have different emphases: orchestration asks what happens next and who should handle it; scheduling asks when it runs, how much concurrency is allowed, and which execution resources it uses. In a simple program, this code can live together. As the number of tasks grows, the difference in responsibilities begins to shape module design.
Collaboration also involves two different control mechanisms. When a sub-agent is called as a tool, the main agent receives its result and continues integrating the work. A handoff transfers current control to the recipient. The OpenAI Agents SDK orchestration documentation describes these separately. Whether to use multiple agents first depends on whether the task has responsibilities worth separating, rather than on the idea that more roles make a system more complete.
3 The Agentic Loop: ReAct, planning and execution, and feedback
ReAct: alternating reasoning, action, and observation
ReAct: Synergizing Reasoning and Acting in Language Models was proposed by Yao and colleagues. Its central idea is to interleave reasoning and external action: the model uses available information to form a judgment, takes an action to obtain an observation, and adjusts subsequent judgments using that observation.
It is often expressed as Thought → Action → Observation. Thought is reasoning, Action is an operation on the environment, and Observation is the information the environment returns. The next reasoning step uses this new information rather than continuing indefinitely from the initial assumptions.
This structure suits tasks in which the next step depends on environmental feedback. The model does not need to list every action at the outset, but it must maintain the goal and progress across calls. The original paper also discusses different reasoning frequencies; it does not require a long analysis before every action.
Modern structured tool calling can implement a similar loop: the model returns a tool name and arguments, Runtime executes the call and feeds back its result, and the model makes its next decision. ReAct is a paradigm for organizing reasoning and action, while Function Calling is an interface for expressing calls. A product does not need to expose a complete chain of thought to retain this action–feedback structure.
Plan-and-Execute: separating the overall plan from local execution
Plan-and-Execute organizes a task at two levels: a Planner creates a higher-level plan, and an Executor completes the current step. Execution results can be passed to a Replanner to determine whether the remaining plan should change.
This separates the question of what must be accomplished overall from how to perform the immediate step. The plan retains dependencies between goals, while the executor can receive only the context relevant to its current step. The executor can itself be a tool-using agent that runs a local loop.
LangChain's 2023 introduction connects this architecture to inspiration from BabyAGI and Plan-and-Solve. Its 2024 implementation guide further illustrates replanning after execution. The discussion here concerns a family of architectures, rather than a single implementation prescribed by a paper of the same name.

Execution patterns: both structures use feedback. They differ in whether the overall plan is maintained separately and how planning and local execution divide the work. A Plan-and-Execute executor can also use ReAct.
Explicit plans make it easier to allocate tasks, inspect progress, and maintain the overall structure, but also introduce work to generate and maintain those plans. Stepwise decisions incorporate new observations more directly, but every action may require another model call. The choice depends on task length, dependencies, and environmental change; there is no need to treat one as a newer replacement for the other.
The engineering loop: perception, decision, action, and reflection
The execution process can be organized into four functional parts of an Agentic Loop:

Execution loop: perception brings new information into the system, decision selects the next step, action obtains new results, and feedback with reflection checks progress. Reflection can be part of the next decision or run separately when needed.
Perception: obtaining information relevant to the current task.
Perception here includes receiving user input, reading tool results, obtaining environmental state, and supplementing it with information from memory and retrieval services. The Context component arranges this information into usable input. In an LLM agent, perception therefore often takes the form of information acquisition and context assembly.
Decision: choosing whether to act again or return a result.
The LLM uses its current input to select tools, generate arguments, adjust a plan, or produce an answer. The Orchestrator receives these outputs and enters the corresponding branch according to its control rules.
Action: using an executor to affect the external environment.
Runtime dispatches calls to local functions, command environments, or MCP services. The resulting data, errors, and status are recorded as observations available to the next iteration. The model proposes an action; the executor carries it out.
Reflection: using results to check and adjust subsequent behavior.
This includes judging whether the result meets the goal, whether the plan is still appropriate, and what information is still missing. Checks can come from rules, tests, tool feedback, or model evaluation. In a simple loop, this may be incorporated directly into the next model decision. A complex task can add a separate evaluation and correction step.
The Reflexion paper presents a more explicit design: it generates textual reflections from task feedback and saves them in episodic memory for later attempts. Language feedback influences the next decision without directly updating model weights.
“Perception, decision, action, and reflection” is a functional division in this article, intended to explain how components participate in the loop. It requires neither four separate agents nor an additional reflection-model call on every iteration.
Implementing a Runner: connecting the components into a continuing loop
Putting these responsibilities back into a program produces the following pseudocode. It illustrates the order of calls, rather than providing a directly runnable example for a particular SDK.
state = initialize_task(task)
while not state.stopped:
context = build_context(task, state, memory)
decision = llm(context, tool_schemas)
if decision.final_output is not None and not decision.tool_calls:
return finish(decision.final_output, state)
observations = execute_tools(decision.tool_calls)
state.record(decision, observations)
if should_review(state):
state.update(review_progress(task, state))In this loop, build_context corresponds to perception and input organization, llm to decision, and execute_tools to action. Recording results and reviewing them as needed support subsequent adjustments. Memory is external information the system can read; State retains the current execution process; the Runner coordinates the order of calls.
The OpenAI Agents SDK Runner documentation gives a concrete implementation: call the model, process tool requests or a handoff, and append results until a final output is obtained or an execution boundary is reached. Other frameworks can implement similar responsibilities through graphs, events, or plugins. Practical systems also need mechanisms for tool execution, state persistence, and termination conditions; these belong to Runtime.
4 Workflow and Agent: choosing an execution approach by its scope of control
The core distinction: a predefined workflow structure versus runtime-directed actions
A Workflow mainly has its nodes, dependencies, and execution paths defined by the developer. An LLM can supply generation, classification, or evaluation steps within it. An Agent gives the model more autonomy to organize subsequent actions from execution results, within its available capabilities and constraints.
The distinction is not whether a model is present, nor can it be determined solely by the presence of loops or conditional branches. Anthropic's architecture discussion includes routing, orchestrator-workers, and evaluator-optimizer among workflow patterns, all of which can also involve model judgments.
A more useful question is how much of the workflow structure is predefined and how freely the model can change the action path at runtime.
| Dimension | Common emphasis in a Workflow | Common emphasis in an Agent |
|---|---|---|
| Control structure | Predefined nodes and dependencies | Dynamic action selection based on goals and observations |
| Model responsibility | Perform a type of step or a local judgment within the workflow | Help organize the next actions, tools, and plans |
| Path changes | Advance within existing workflows and branches | Reorganize the action sequence in response to new information |
| State management | Retain workflow variables and node progress | Also maintain observations across calls, plans, and current action state |
| Debugging focus | Which step, branch, or input went wrong? | Why was this action chosen, were observations sufficient, and when should execution continue or end? |
Combining them: retaining useful autonomy within a defined workflow
Many applications combine both structures. An outer Workflow fixes the task entry point, result validation, and delivery format, while a node inside it runs an Agent for the part that needs dynamic decisions. Conversely, an Agent can call a deterministic sub-workflow, reusing stable steps as a tool.

Control approaches: a Workflow can contain an LLM, and an agent's autonomous loop can sit inside a larger fixed workflow. The diagram compares how the action path is determined.
This also explains why common patterns can be combined. Chaining fixes the order of steps; Routing sends inputs down an appropriate path; Parallelization processes separable tasks concurrently; Orchestrator-workers decomposes and delegates work; Evaluator-optimizer uses feedback to improve results. These are organizational methods. A real system can select a subset instead of stacking every pattern together.
Choosing a structure: task organization, feedback, and execution cost
The following sequence of questions can help determine a structure:
| Task condition | Approach worth considering first |
|---|---|
| Inputs, steps, and output format are already clear | A single model call or fixed Workflow |
| Only some steps need to choose the next action from their results | An Agent embedded in a Workflow |
| The action path is hard to enumerate in advance and requires continuing observation of the environment | A tool-using Agent loop |
| A longer goal has dependent steps and requires an overall view of progress | An explicit plan combined with an execution loop |
| Subtasks have clear boundaries and can be completed independently and combined | Delegation or multi-agent collaboration as needed |
More dynamic structures require closer observation of model choices, tool results, and state changes. Their cost also varies with the calling pattern. The basis for choosing should be the value dynamic decisions bring. Parts that an existing workflow can express clearly can remain under program control; the model can handle the parts that need to adapt to new observations.
5 Comparing frameworks: development interfaces, orchestration runtimes, and prebuilt Harnesses
Classification: identify the main layer of capability a project provides
“Agent framework” is often used as an umbrella term for different projects. To make selection easier, they can first be grouped by three emphases:
- Development framework / SDK: provides agent, tool, message, configuration, and collaboration interfaces for building applications.
- Orchestration framework / Runtime: emphasizes state, control flow, and the execution lifecycle so developers can control the execution process.
- Prebuilt Harness: combines the loop, tools, context, sessions, and other components into an execution skeleton that can be used or adapted directly.
These categories can overlap. LangGraph's official materials describe it as both a framework and a runtime. The Agents SDK and ADK provide development interfaces as well as execution loops. The purpose of this classification is to find an entry point for selection, rather than assign every project to one exclusive category.
| Project | Main positioning | Core structure supplied by default | Needs for which it is worth examining first |
|---|---|---|---|
| LangGraph | Explicit state-orchestration framework and Runtime | State, nodes, edges, checkpoints, pausing, and resumption | Precise control over paths and state |
| OpenAI Agents SDK | Lightweight agent-development SDK with a Runner | Agents, tools, handoffs, sessions, and tracing | Starting with a general tool loop and collaboration abstractions |
| Google ADK | Agent framework covering the build and execution lifecycle | Agents, workflows, Runner, tools, sessions, and development tools | Organizing agent applications with an integrated toolchain |
| Qwen-Agent | Development framework for tool-using LLM applications | Model and tool abstractions, Assistant, function calling, and RAG | Building assistants on Qwen or compatible model services |
| DeepSeek Harness / DSH | Plugin-based, preassembled Harness | Model adapters, tools, loop, sessions, and execution profiles | Starting with a ready-made execution environment, then replacing internal capabilities |
| Pi | Minimal, extensible Harness and runtime components | Agent Core, Coding Agent, sessions, and extension mechanisms | Studying a compact execution skeleton or embedding it in a product |
LangGraph: controlling execution with explicit state and graphs
LangGraph expresses a program through state, nodes, and edges. Nodes process parts of a task, state retains data shared between nodes, and edges and routing determine where execution goes next. A node can call a model or run ordinary code.
It suits systems that need control over their execution structure: which steps are fixed, which decisions belong to the model, when to pause, and where to continue after resuming. Persistence, human involvement, and streaming events are organized around this state-execution model.
LangGraph supplies the means to assemble the system. Developers still define state, nodes, and routes, then build agent behavior suited to the task. It can be used independently without first adopting LangChain's high-level agent interface.
Development SDKs: Agents SDK, Google ADK, and Qwen-Agent
OpenAI Agents SDK: organizing a tool loop with Agent and Runner.
The Agents SDK uses Agent to define instructions, the model, and tools, with Runner advancing execution. Specialist collaboration can use agents as tools or handoffs; sessions, guardrails, and tracing provide corresponding runtime support.
The full name Agents SDK matters here. The basic openai client mainly wraps the model API, while the Agents SDK builds agent execution and collaboration abstractions on top. It is a direct entry point for developers who want to connect a standard loop quickly, then add domain capabilities incrementally.
Google ADK: agent development and execution tools in one system.
Google ADK provides agents, tools, workflows, a Runner, Session, Memory, and development and debugging capabilities. It supports combinations of deterministic workflows and model-driven behavior, with supporting entry points for evaluation and deployment.
ADK suits scenarios that need an integrated system for multi-agent applications and their development lifecycle. It has many integrations with Gemini and the Google ecosystem, but is not restricted to a single model. Actual capabilities still need to be checked against the chosen model, language, and tool combination.
Qwen-Agent: building assistants around model and tool abstractions.
Qwen-Agent supplies foundational abstractions for models, tools, and agents, including Assistant, function calling, MCP, document retrieval, and Code Interpreter, along with application examples. It connects to DashScope and supports OpenAI-compatible model services.
It offers an entry point for tool assistants and document applications built on Qwen or self-hosted services. When reading it, examine what each module actually does. Its Memory module, for example, includes file management and retrieval responsibilities; the name alone does not establish that it handles complete session persistence and execution recovery.
Prebuilt Harnesses: how DSH and Pi provide an execution skeleton
DeepSeek Harness: composing runtime capabilities through plugins.
DeepSeek Harness / DSH is DeepSeek AI's official open-source project. Built on Cordis, it organizes model adapters, tool registration, session records, the Agent Loop, and other capabilities as composable plugins. Different profiles determine which capabilities start.
This design suits starting from a complete execution environment and replacing particular components inside it. It offers Web, headless, and SDK entry points, so developers need to choose a configuration for their goal. The architecture documentation shows the relationships between these modules. The project is currently marked developer preview; integrations should pin the version they use.
Pi: distinguishing reusable Agent Core from the full Coding Agent.
Here, Pi refers to the project initiated by Mario Zechner. pi-agent-core handles the model-and-tool loop, state, and events. pi-coding-agent adds tools, context handling, sessions, compaction, and extensions, forming a ready-to-use Harness and terminal application that can also be embedded in other products through an SDK.
Pi has a compact core, with many working practices supplied through extensions, Skills, and configuration. To understand it, it is useful to read both the author's original design article and the current repository: the former explains the tradeoffs, while the latter reflects present capabilities. For example, the early article described the absence of built-in MCP, but the current project provides MCP support documentation. An early default should not be treated as a permanent account of current functionality.
A selection method: work backward from what you need to control
The six projects offer different starting points. The control you need can help narrow the choices:
| Priority | Entry point worth examining first |
|---|---|
| Explicitly designing state, branches, and recovery paths | LangGraph |
| Quickly organizing a general tool loop, specialist calls, and handoffs | OpenAI Agents SDK |
| Developing, running, and evaluating agents in an integrated toolchain | Google ADK |
| Building tool and document assistants around Qwen or compatible services | Qwen-Agent |
| Adapting a complete, plugin-based execution profile | DSH |
| Reading or reusing a compact Agent Core and Coding Harness | Pi |
After choosing an entry point, check model compatibility, tool integration, state persistence, collaboration mechanisms, and deployment requirements. An application can also combine capabilities from different layers. The responsibilities that need to align are logical ones: what input the model receives, who decides the next step, where tools run, how state persists, and how the task ends.
References: official documentation, papers, and authors' articles
The architecture diagrams are illustrations organized around the responsibilities described above. Framework capabilities reflect the official documentation and source code consulted; this article does not provide a performance ranking from its own tests.
Architecture and engineering: building an overall understanding
- Anthropic: Building effective agents. Understanding Workflows, Agents, and common organizational patterns.
- OpenAI: Unrolling the Codex agent loop. Examining how an actual Harness calls models, executes tools, and organizes context.
- LangChain: Agents. The current Model + Harness explanation.
- LangChain: Runtimes, frameworks, and harnesses. Understanding product layers in this technology stack.
- Lilian Weng: LLM Powered Autonomous Agents. A foundational component map of Planning, Memory, and Tool Use.
- Chip Huyen: Agents. Understanding system design through tools, planning granularity, and reflection.
- Simon Willison: A useful definition of agents. An engineering mental model of using tools in a loop to achieve a goal.
Execution mechanisms: understanding components and loops
- Yao et al.: ReAct. The original paper on interleaving reasoning and action.
- LangChain: Plan-and-Execute Agents, 2023. An early implementation of separating planning from execution and its sources of inspiration.
- LangChain: Plan-and-Execute Agents, 2024. Execution, feedback, and replanning structures.
- Shinn et al.: Reflexion. A specific design for language feedback, reflection, and episodic memory.
- MCP: Architecture overview. Hosts, Clients, Servers, and capability connections.
- Anthropic: Effective context engineering for AI agents. Context selection, compression, and on-demand reading.
- LangGraph: Persistence. The different purposes of checkpoints and a cross-thread store.
- OpenAI Agents SDK: Running agents. The Runner's execution process.
- OpenAI Agents SDK: Agent orchestration. The difference between agents as tools and handoffs.

