What Is an AI Agent, Really? Brain, Memory, Tools, and Why the Model Lives Outside the Harness

What Is an AI Agent, Really? Brain, Memory, Tools, and Why the Model Lives Outside the Harness
Get in touch or AI consulting Join the AI Community & Comprehensive Online Courses for All Levels

Before you build an agent in code, you need the words. This is the full background lesson of Ariel’s LangChain agent course: about 38 minutes of technical foundations, built from the bottom up, so that when the real course starts, the terms are already clear. Two parts of it already got their own posts here: the opening on machines, sandboxes and Python virtual environments, and the closing whiteboard on what one AI agent turn looks like. This post covers the whole lesson, and spends most of its time on the part in the middle: what an agent actually is, and where its brain really runs.

Why build your own agent at all

Everyone already uses agents. So why learn to build one in code? Because sometimes you need something tailor-made: your own voice response system, or a custom project for a client with very specific needs. Ariel’s experience is that a lot of clients in Israel ask for exactly that. Technically they could have done it with one of a thousand existing tools, but they don’t want to. LangChain is an infrastructure for building agents at the code level, and this lesson gives you the concepts you need before touching it.

The foundations: machines and sandboxes

The lesson opens with machines. Laptop, phone, server, tablet: in professional terms they’re all machines, anything with a CPU, memory and a hard drive that can run code. Some are physical, some are virtual (a VM or VPS), and servers are usually “headless”: no desktop, just a black terminal you reach over SSH. Then comes the family of virtual environments: a whole virtual machine, a Docker container inside a machine, or even a locked-down folder. The real value of all of them is the sandbox: an independent cube that the outside can’t harm and that can’t harm the outside. Ariel’s analogy is splitting an apartment into three. It only works if every unit gets its own heavy locked door. The full breakdown, including what happens when a virus breaks out of a container, is in the dedicated post.

For this course, the sandbox is a Python virtual environment. The course’s material uses a Python tool that Ariel admits he didn’t know before. It installs its own Python and all the packages this project needs, so two versions of the same package never collide and your main system stays clean. You create it once with python -m venv, and from then on you just go to the right folder and enter it. If the step-by-step install lessons bore you, he says, hand the page to Claude and let it do it. LangChain itself was built for Python and TypeScript. For other needs there are projects like CrewAI, built for multi-agent setups, which he may get to later.

So what is an agent?

Claude Code, OpenCode, Google AI Studio, NotebookLM, Antigravity: all of these are agents. DeepSeek, on the other hand, is a model. Ariel asks the class for the definition and warns them: he’s said it so many times that if they can’t recite it by heart, he’ll choose to be offended. The answer: an agent is a brain, memory, and tools. The brain is the language model (the LLM) along with its settings. MCP isn’t a separate category, it’s just a way of adding more tools, more tool calls to be precise.

Take those three, add a definition that tells the model “this is where you live, these are your capabilities, this is your role,” and package it all into one piece of software. That software is the harness. Claude Code is software. Brain, memory and tools are programming things. The harness is the final program that represents the agent.

  • Memory can be SQL, a text file, a markdown file, and so on. You can keep it inside the system or outside it: a hosted service like Supabase, or locally in Postgres or plain files.
  • Tools are usually reading, writing, searching, or running commands on the machine. Ariel points at an automation builder where you click the plus sign and get tons of possible steps. Programs, logic steps, data steps: in the end they’re all tools.

The model always runs outside the harness

This is the core point of the lesson. Memory and tools can be part of the harness. The model never is. The call to the model always goes out of the system, because running AI and running software with memory and tools are two different worlds.

That’s true even when the AI is on your own machine. There’s a long list of local runners: Ollama, LM Studio, Jan, GPT4All, LocalAI, vLLM, llama.cpp. They run the model on your GPU. The trade-off, in Ariel’s words, is that you pay less money but get much less intelligence. The other option is an API. You can go to the direct providers (OpenAI runs GPT, Anthropic runs Claude, Google runs Gemini), or to providers that run many models for you, like Together, Amazon Bedrock, or Microsoft’s Azure.

Either way, from the harness’s point of view, the brain is a text machine. It prepares text, sends it, and gets text back. An LLM only takes in and puts out text. If you tell it to edit a file, it doesn’t touch the file: it returns text with instructions, the harness edits the file, and then the harness tells the model, “I edited the file according to your instructions.”

One turn, and why LangChain exists

A student says it’s still not clear, so Ariel draws it: “read my WhatsApp with Or and tell me if Or understood.” Human, harness, AI, tool list, tool call, tool result, a second tool call, final answer. That’s one agent turn, with anywhere from zero to infinite tool calls, and every step re-sends the whole growing stack of messages to the provider. The full whiteboard walk-through is in the agent turn post.

From there he gets to LangChain itself. Ideally, the provider request would be uniform, so swapping one model or provider for another would just work. In practice, different providers use slightly different message structures. So LangChain wraps the model, the provider request, the messages, the tools and the memory, and gives the programmer the minimum settings needed. Talking to Claude or to GPT looks the same.

Harness engineering, and an agent instead of software

With that, you can build your own harness, personalized to your needs. Ariel calls it harness engineering: big companies may not be hunting for “programmers” anymore, but they do want people who can build an agent for their specific needs. His big idea for the future: instead of selling a client software with tables, task screens and tracking views, you give them an agent. Browser, app or phone, they just ask and get answers, and behind the scenes the agent runs the tasks. If someone wants to see things, the agent can draw them the tables and graphs. And to make the agent start a turn on its own, you give it a scheduling tool, a cron: every five minutes, every hour, or calendar-style reminders.

Along the way there’s a nice side story from the class: one student’s AI coding assistant suggested blocking a one-time link after five failed attempts. The student told it the fix wasn’t needed. It agreed, and then added that without the fix, the attacker’s chance of success was two in ten thousand. Brain, memory, tools, and a little passive aggression.

๐Ÿ”ฅ Roast Corner

Ariel reserved the right to be offended if his students can’t recite the definition of an agent. Brain, memory, tools. Three words. He has repeated them so many times that by now his students are the ones with the memory problem, and he’s the one stuck in a loop. That’s not teaching anymore, Ariel, that’s a cron job with a beard.

And the universe is backing him up on why memory deserves its own slot in the definition. Meta’s new agent, Muse, reportedly started mixing up conversations across accounts, according to employees quoted by Reuters. One of them asked about the weather and the tides, and got a bonus line with someone’s Capital One and Charles Schwab balances. Brain: working. Tools: working. Memory: wired straight into a stranger’s bank account. Somewhere a harness engineer is learning that “memory can live inside or outside the system” was not meant to include “inside someone else’s.”

Then there’s the English auto-translation of this lesson, which heard Ariel and his students say “harness” and wrote down “ERNIE.” Every single time. Which really proves his point: the model only outputs text. Nobody promised it would be the right text.

๐Ÿค– AI for Humans

Here’s brain, memory and tools put to work for people who badly need it. In Bulgaria, the Stroke and Aphasia Association just presented “Aya”, an AI assistant that answers questions from stroke survivors, people living with aphasia, and their families, at any hour, by phone, email, chat or voice. The pilot is funded with โ‚ฌ15,000 from Sofia’s “Social Innovations” programme and is being tested until spring.

It’s a textbook agent. The brain only answers from a database the association curated, and it refuses to wander outside the topic of stroke. The memory grows as real users’ questions are added during the test. And its tools include something many agents forget: a human. During working hours, an operator takes any question that isn’t simple, and people with aphasia get a call back from a speech therapist. In the demo, Aya spoke more slowly, stopped when interrupted, and coped with answers of just one or two words. As the association’s leadership put it, nobody tells families what to expect after a stroke patient is discharged. Now there’s something to ask, even at night and on weekends.

Get in touch or AI consulting Join the AI Community & Comprehensive Online Courses for All Levels

๐Ÿ’ฌ Comments