Ask a language model to book you a table for six this Thursday and it will do something quietly maddening. It will explain, fluently and with total confidence, exactly how one might book a table for six this Thursday. Then it will stop. Articulate, helpful, and unable to lift a finger.
That gap between knowing and doing is the whole difference between a chatbot and an agent. And the reason for the gap is blunt: a language model can only ever produce text. It cannot click a button, run a program, remember yesterday, or wait for your approval. So an agent is not a smarter model. It's a model surrounded by parts that cover what it can't do — and, just as importantly, a framework that wires those parts together and runs them.
That second half is the part most explanations skip. You can read ten articles listing "the components of an agent" and still have no idea how they actually connect. So here's the plan: meet the five parts, then meet the thing that binds them. If the parts are organs, the framework — LangChain being the best-known — is the nervous system that turns a pile of organs into a body that can act.
At the center sits a large language model, the same family of technology behind ChatGPT and Claude. This is where understanding and judgment live. It reads the request, thinks it through, and decides what should happen next. By a wide margin, it is the smartest thing in the room.
It also cannot do a thing. Left alone, the model — whether it's OpenAI's GPT, Anthropic's Claude, Google's Gemini, Meta's Llama, or Mistral — is the brilliant colleague locked in a room with no phone. On each turn it does exactly one thing: it's handed the story so far as text and asked "what next?", and it replies with either a finished answer or a request to use a tool. It never acts. It only decides and describes. Everything else in this article exists to carry those decisions out into the world and bring the results back — and the framework is what does the carrying.
Tools are the specific abilities you bolt onto the model: search the web, run code, send an email, query a database. Each is a door from thinking into doing.
But notice the problem — the model can't open a door, only ask for one. This is the first thing the framework does for you. You write an ordinary function and describe it in plain language; the framework advertises that description to the model as an available tool, and when the model replies "call search_web with query: ramen near Shibuya," it's the framework, not the model, that runs the real function and feeds the result back. Your tools sit on one side; the model only ever names them; the framework is the hand that reaches between. The reach of an agent is whatever is on that menu — for a sense of how much can be, browse a collection like this catalog of AI agent tools.
Here's a fact that surprises people: the model remembers nothing between turns. Each call starts cold. So the "story so far" it reads every turn has to be handed to it, fresh, every single time — and holding that story is another of the framework's jobs.
The framework keeps a running transcript of the task: your request, each tool the model called, each result that came back. Before every turn it re-injects that transcript so the model can pick up where it left off. That's short-term memory, and it's why an agent's second step can build on its first instead of forgetting it. Long-term memory is the same idea stretched across tasks — facts worth keeping, like your preferences, stored outside the conversation and pulled back in when relevant. When an agent "knows" a teammate is vegetarian, the framework fetched that fact and dropped it into the transcript so the model sees it as if it always knew. Without this thread, every turn is déjà vu.
Give a capable person a shapeless goal and the thing standing between them and paralysis is a plan. Planning turns "organize the team offsite" into a sequence: find venues, check dates, draft an invite, send it once you've approved.
In an agent, planning isn't a separate box that fires once. It's that "what next?" decision, made again on every turn — reason a little, pick a tool, read the result, reason again. (You'll see this pattern named ReAct, for reason and act.) And the reason it can happen repeatedly is the framework: it's the framework that loops back to the model after every tool result and asks "what next?" once more, so the model can adjust — rerouting when the first restaurant turns out to be fully booked, because nothing is hard-coded and the next move is decided fresh each pass. Planning is what turns a pile of tools into a route; the framework is what lets the route be drawn one step at a time.
The last part is the one most often left off the diagram, and the one you'd miss the most: you.
Its place in the machine is exact. Remember the hand-off — when the model asks for a tool, the framework runs it. Human-in-the-loop is a checkpoint the framework enforces on that step. For anything cheap and reversible, like a search, it runs the tool and moves on. For anything that spends money or can't be undone, like book_venue, the framework s before executing, surfaces the pending call — "ready to book the $1,200 venue for Thursday, shall I go ahead?" — and waits. Approve and it runs; decline or edit and your reply becomes the next line in the transcript, which the model reads and adapts to. You're not watching from outside. You're a conditional step the framework fires only on the moves that carry weight.
Line the five parts up and you still don't have an agent. They don't touch. A model can't run a tool; a tool can't recall the transcript; the transcript can't decide what to do next; you can't approve a call nobody surfaced to you. Something has to connect them — pass each part's output to the next, and keep the whole thing moving. That something is the framework, and its role comes down to five concrete jobs:
In practice you declare the parts and let the framework run the loop. In LangChain-flavored pseudocode, assembling an agent looks about like this — recognizable whether you end up using LangChain, LlamaIndex, or CrewAI, because they're all doing the same thing:
llm = ChatModel("claude") # swap for gpt / llama; nothing else changes
@tool
def search_restaurants(area: str) -> list: ...
@tool
def check_calendar(people: list) -> dict: ...
@tool
def book_table(place: str, time: str) -> str: ...
tools = [search_restaurants, check_calendar, book_table]
memory = ConversationMemory()
agent = create_agent(
llm, tools, memory,
require_approval=[book_table], # human gate on the irreversible tool
)
agent.run("Organize a team lunch for six of us next week.")
Look at what you didn't write: the loop. You never wrote "call the model, parse its reply, run the tool it named, save the result, ask again." That loop is precisely what create_agent builds and agent.run executes — the framework's core job. Underneath, it's this small:
history = memory.load() # the notebook
while True:
reply = llm(history, tools) # brain + strategist: decide
if reply.is_answer:
return reply.text # nothing left to do — stop
if reply.tool_call in require_approval:
wait_for_human(reply.tool_call) # co-pilot: the gate
result = run(reply.tool_call) # hands: the framework runs it
history += [reply.tool_call, result] # notebook: remember both
memory.save(history)
Now watch the team lunch flow through it, with the framework as the thing doing the connecting. You hand it the goal; it starts the transcript. It calls the model, which — reading the goal — asks for search_restaurants; the framework runs that function and appends the options. It calls the model again with the longer transcript; now the model asks for check_calendar, and while wiring the result back in, memory adds that Priya can't do Mondays, so the model narrows to a workable day. The model settles on a place and asks for book_table — but that tool is gated, so the framework stops and asks you first. You say yes; it runs the booking, appends the success, and calls the model one last time. This turn the model returns not a tool call but an answer: booked, Thursday 12:30, vegetarian options sorted. Every arrow in that story was the framework taking one part's output and handing it to the next.
LangChain is the common entry point, but the same shape shows up everywhere. LangGraph (its graph-based sibling) models the loop as an inspectable, resumable state machine; LlamaIndex leans toward retrieval and memory; CrewAI orchestrates crews of cooperating agents; and the model-makers ship their own kits — OpenAI's function calling, Anthropic's tool use — that give you the tool hand-off directly. They differ in flavor and ambition, but under the branding each is doing the five jobs above.
Which means a new framework stops being intimidating. You can size any of them up with three questions: where does it keep the transcript, how does it describe tools to the model, and where does it let a human step in? Answer those and you know how it connects the parts.
Nothing here asks the model to be magic. It only produces text — it decides and describes, one turn at a time. Everything that makes an agent feel like it's doing things is the framework wrapped around that text: advertising tools and running them, carrying the transcript in and out, looping back for the next decision, and pausing at the gates that matter. The model is the engine; the framework is the rest of the car, and the five parts are what it connects.
So the next agent you meet gets much easier to read. The question stops being "how does the model work" and becomes sharper and more practical: what's on its tool menu, what's in its transcript, and where does it stop to ask?
If you've built or leaned on one of these, I'm curious which part you think most frameworks get wrong. My money is on the last one.