PhyseaWiki How AI actually works physea.ai →

AI stacks

What components make up an agent stack?

An agent stack is a model, a set of tools it can call (often through MCP), some memory to carry state across steps, and an orchestration loop, the harness, that runs the model, lets it act, feeds back the result, and repeats until the goal is met.

Last updated 2026-07-25 · Physea Labs

An agent is a prompted model that can act, not just talk. As a stack it has four parts: the model that reasons, the tools it can call, the memory that carries state between steps, and the harness loop that ties them together. Take away the tools and you are back to a chatbot. Take away the loop and the model gets exactly one turn instead of working toward a goal over many.

THE HARNESS LOOP Model decides what to do Tools acts on the world Memory carries the result forward
Model, tools, and memory sit inside the loop, not after it. The dashed line back to Model is what repeats, until the goal is met or a limit is hit.

The tools layer is what lets the model touch the outside world: read a file, run a search, send a message, hit an API. A model cannot do any of that on its own, so each capability is handed to it as a tool it can choose to call. Increasingly these tools arrive through the Model Context Protocol, an open standard that lets one model connect to many data sources and tools the way a single USB-C port connects many devices.[1] MCP matters to the stack because it means you wire up a tool once and any MCP-aware model can use it, instead of writing fresh glue for every model and every integration.

The harness loop is the engine that makes it an agent rather than a single call. It runs the model, reads which tool the model wants, executes that tool, feeds the result back into the context, and runs the model again, repeating until the goal is met or a limit is hit. Memory sits alongside the loop to hold what has happened so far, since the model itself starts each call fresh. You can write this loop by hand in a few dozen lines, or use a framework: LangChain, for instance, frames an agent as a model plus a harness and gives you a configurable one to start from.[2] Either way the shape is the same, and it is worth knowing the shape before you pick the tool that implements it. This page is about the parts the loop coordinates; the decide-act-observe mechanics of a single turn through that loop are covered in more depth on the agent loop.

References

  1. Introduction to Model Context Protocol — Anthropic
  2. LangChain overview — LangChain

Common questions

How is the agent stack different from the RAG stack?
RAG fetches text and the model writes one answer. An agent runs a loop: it decides, calls a tool, sees the result, and decides again. RAG can be one of the tools an agent calls, so the two setups often nest rather than compete.
Do I have to use a framework to build an agent?
No. The loop is simple enough to write by hand: call the model, run the tool it asked for, append the result, call again. Frameworks like LangChain give you that loop plus tool plumbing and memory so you do not rebuild it each time.