KajoData / AI
Agent, harness, MCP, RAG: eight AI terms in one example
I separate the parts of an AI system: choosing steps, executing tools, finding sources, preserving progress and evaluating the whole run.

I ask AI to investigate why an online store’s margin fell in October. One person says I need an agent. Another suggests MCP, a third recommends RAG, and someone else wants a larger context window. They may all be pointing to useful components, but they are describing different things. Choosing a solution becomes difficult when we use the names interchangeably.
I want to explain eight terms through that same hypothetical task. Where does the system get information? Who executes an action? What survives the end of a session? How will I check the result? Those questions help me assess a product and identify what might be missing from a process.
An agent chooses steps; a workflow defines their order
An AI agent is a system in which a model can choose successive task steps, use tools and react to their results. For the margin question, it might first find the definition, retrieve data, compare product categories and prepare an explanation. If information is missing, that observation can influence its next action.
The important feature is the loop: select an action, execute it, receive a result and decide what follows. A long answer containing a plan does not establish that the system carried out those steps. I want to know what information it actually received and used.
A workflow can have a predetermined sequence: retrieve a file, calculate a summary, draft commentary. Anthropic distinguishes these patterns by how execution is controlled. Real systems can combine them. A fixed data pipeline might include a stage where the model selects a relevant document.
An agent does not require complete autonomy. It can prepare an analysis and pause before sending it. For our example, I would initially allow reading data and drafting findings. Permission to change source data would be a separate decision with its own conditions and responsibility.
A harness organizes the model’s working conditions
The term I find especially interesting is harness: the operational environment that supports the model’s work. There is no single mandatory inventory of its components. Here, I use it to cover tool access, instructions, working state, limits, permissions and execution controls.
A capable model alone does not provide the current definition of margin or a correctly configured data connection. Someone must make those available and determine when work should stop. If an input file is incomplete, I need a defined way for the system to report that problem.
My Polish video also uses a coding example. An agent fixing a repository needs to know how to start the project, check the result and stay within the allowed scope. Anthropic describes long-running harnesses in which later sessions read saved progress and change history. That is a concrete handover mechanism, rather than a guarantee that every agent will succeed.
When an agent loses earlier decisions, I first ask where they are stored and how the next session retrieves them. A larger model or an extra instruction will not automatically provide missing access to current state. A framework may help organize these pieces, but installing it does not establish the working rules.
Tool calling and MCP connect different parts
Tool calling, also called function calling, lets a model name a tool and supply its arguments. Suppose I expose an operation that retrieves sales for a start and end date. The model can request October’s data. The surrounding system executes the operation, as explained in the tool-use documentation.
I distinguish a requested action from its effect. A request to delete records does not by itself demonstrate that records were deleted. Available operations, argument checks and the executor’s permissions determine what happens. Similarly, a JSON response may simply be structured information; its format alone does not execute anything.
MCP, the Model Context Protocol, standardizes communication between AI applications and servers providing context and capabilities. Its architecture documentation distinguishes a host, client and server. The host is the application, a client handles communication with a server, and that server exposes capabilities. It can run locally or remotely.
A server may provide tools, resources and prompts: operations, readable content and interaction templates. It need not provide every category. Tool calling can use an MCP integration, but it can also work without one. In our example, MCP might connect the application to sales sources. I would still inspect which data and operations that particular connection actually exposes.
RAG retrieves sources; embeddings help compare meaning
RAG, retrieval-augmented generation, supplies retrieved information to a model for an answer. For the margin question, the system might find a relevant passage in company documentation, include it in context and then generate an explanation. Using this technique does not itself require changing the model’s weights.
Documents need preparation for retrieval, often involving smaller chunks and an index. Microsoft describes keyword, vector and hybrid retrieval in RAG solutions. A vector database is therefore not a mandatory component of every solution. The retrieval method should fit the information we need to find.
Embeddings are vector representations: ordered lists of numbers. They support comparisons of semantic similarity, as explained in Google’s documentation. This can help connect a document about cancelling a subscription with one discussing ending a membership, even when their wording differs.
Related meaning does not guarantee the same business rule. Two margin documents might concern different periods or organizational units. A similarity score of 0.87 is not automatically an 87% probability that an answer is true. I still need to check the source’s date, applicability and actual content.
When an answer is wrong, I also inspect retrieval. Did the system find the correct document? Did it receive the definition or merely a similar heading? Improving the wording of the final answer may accomplish little if the model keeps receiving an obsolete instruction.
The context window holds the current working material
Models process tokens, units that do not necessarily correspond to whole words. The context window limits the material available while generating an answer. It covers input and output according to the system’s rules; Claude’s documentation also explains the contribution of tools and conversation history.
I do not treat a large window as a promise of persistent memory. In a new session, earlier decisions about the margin definition must be supplied again. A saved document or another state mechanism can provide them. Their previous appearance in a conversation is not enough.
Compaction helps work continue by summarizing earlier context, which involves selecting what to preserve. For this task, I would separately retain the analysis period, metric definition, sources and unresolved questions. I would rather not reconstruct those decisions from a generic note saying the analysis is almost finished.
I use context engineering to mean deliberately selecting information for the moment it is needed. In practice, I ask whether the agent has the current document and the relevant result from an earlier step. Adding every company file to a prompt does not automatically improve that context.

Evals assess both the result and the path
Evals are structured quality checks using tasks with defined criteria. For a sales agent, I would include valid data, a missing file, conflicting definitions and a request for an unauthorized operation. Each case needs expected behavior before I inspect the response.
One successful demonstration tells me little about the remaining cases. After changing a model, instruction or tool, I want to revisit the same set. I would add failures discovered during use, so that a proposed fix can be checked against the earlier problem.
Anthropic describes evaluating agent runs and their outcomes. For our example, a correct number might not be sufficient: I also care about the appropriate source, permitted access, elapsed time and cost. An execution trace helps locate the step where the process went wrong.
A model grading another model can also make mistakes. I would use its assessment as part of a check grounded in examples reviewed by people. I discuss the broader acceptance process in my article about analyzing data with AI.
Map the terms onto one task
A system does not necessarily need all eight components. For a practical discussion, I would use this map:
- Agent: who selects the next step after seeing data?
- Harness: where are the rules, state, limits and controls?
- Tool calling: how does the model request an operation with arguments?
- MCP: does the integration use a shared protocol?
- RAG: how do we retrieve definitions and other sources?
- Embeddings: does semantic similarity help us find relevant material?
- Context window: what does the model receive for its current work?
- Evals: how do we detect failures and assess changes?
Choose one task of your own and answer these questions without naming products. A gap points to something worth clarifying. I pay particular attention to the harness because the quality of the whole working environment interests me. I want to understand what happens between a request and its result, including what happens when a step fails.
Key takeaways
How does an agent differ from a harness?
An agent describes a system in which the model helps choose successive task steps. A harness organizes its working conditions, such as tools, state, permissions and execution controls; the precise scope of the term varies.
Are MCP and tool calling the same thing?
No. Tool calling lets the model select a tool and provide arguments. MCP standardizes communication between applications and servers providing tools and context. Tool calling can work without MCP.
Does RAG require a vector database and model training?
Providing retrieved sources for an answer does not itself require training the model. Retrieval can use keyword, vector or hybrid search, so a vector database is not a mandatory part of every RAG solution.
AI was used in an automated way while working on this article. If you want to learn how to do it too, check out this project.
