RAG, MCP, and A2A solve three very different problems in AI agent development—but understanding how they work together is the key to building reliable, production-ready agents.
In this video, we build an imaginary travel assistant called Atlas and follow it through the complete AI agent stack:
- How APIs provide predictable software integrations - How RAG gives agents fresh, relevant, and authorized knowledge - How MCP connects AI applications to external tools and services - How A2A enables independent agents to collaborate on complex tasks - Why permissions, validation, user consent, and security still matter - How all four layers work together in a real-world booking workflow
The simplest distinction:
RAG provides knowledge. MCP provides tools. A2A coordinates agents. APIs power the underlying services.**
By the end, you’ll understand where each technology fits, what it does—and what it does not do.
Sent provides one messaging API for SMS, WhatsApp, and RCS. Sign up through the link above to receive $5 in free credit.
Want to see the complete Atlas workflow built in code? Comment **“Atlas”** below.
Subscribe for more practical explanations of AI agents, LLM architecture, MCP, RAG, and agentic systems.
This video outlines the architectural evolution of AI agents, using a travel assistant named \"Atlas\" to demonstrate the transition from simple LLMs to action-oriented systems. It explores how the integration of RAG, the Model Context Protocol (MCP), and Agent-to-Agent (A2A) communication enables AI to handle complex, real-world workflows with reliability and security.
Right now, three acronyms are changing how real-world AI products are built.
RAG, MCP, and A2A protocols.
Most developers understand at least one of them,
but far fewer can explain where one stops and the next begins.
And that gap is why an agent can look magical in a demo,
then become slow, confused, or genuinely unsafe in production.
So let's connect the pieces.
We'll follow one agent, Atlas, and build it layer by layer.
We'll start with plain English,
then add the technical details and show how everything works together.
Every time the agent hits a wall,
we will introduce the exact piece of the stack that solves that problem.
By the end, you will understand how these systems actually fit together.
Let's get into it.
First, to see where AI software is going,
we first need to understand how software has communicated for decades.
And that story starts with the API.
An API is a contract between two programs.
It defines what you can request,
how that request must be formatted, and what comes back.
If you send the expected input to the expected endpoint,
and you get a predictable response,
that predictability is the whole point of an API.
Much of the modern internet runs on API.
A weather app asks for a forecast or an online store processes a payment.
Even a messaging service sends a notification.
All of this is work of an API.
Traditional software handles these tasks reliably
because the developer plans the sequence in advance.
Then we placed a large language model inside that carefully scripted system.
The input was no longer a neat form.
Someone might say,
find me a good flight,
avoid overnight layovers,
and make sure I do not miss Monday's meeting.
Now the system has to understand the request,
check several services,
ask follow-up questions,
and adjust its plan.
The model may understand the goal,
but the API still needs exact instructions,
which endpoint to call.
Which fields and data types to send,
which credentials to use,
and what to do when something goes wrong.
It is like giving a talented new employee a room full of control panels with no labels.
Intelligence does not automatically create an interface.
Our first workaround for this problem was brute force.
We describe every function to the model.
For example, when the user asks for flights,
call this function,
provide these fields,
and expect this shape back.
That works at small scale,
but add 10 tools and the instructions swell.
Whenever you tend to change a schema,
something can fail silently.
In this case,
we were attaching a flexible reasoning layer
to a collection of rigid integrations.
One custom connector at a time.
There had to be a cleaner way.
But before we reach it,
we need an agent with a real job.
For the rest of this video,
we are going to build an imaginary AI agent together.
Say hello to Atlas.
Atlas has one job,
be the ultimate personal travel assistant.
You tell Atlas,
plan my trip to Tokyo in March.
Atlas should understand your preferences,
check your schedule,
find flights and hotels,
request approval when necessary,
and help you complete the booking.
That sounds like one request.
Architecturally,
it is a pile of different problems.
And Atlas hits the first one immediately.
You see, Atlas is powered by a large language model.
The model may know a lot about Tokyo,
like the neighborhoods,
food,
train lines,
and the usual travel advice.
But it does not know your passport is going to expire in April,
or you have airline points,
as well as your company cap's reimbursable flights at $800.
These facts are private,
specific to you,
and likely to change.
They were never part of the model's training data.
And when a model can sound confident,
even when it does not know the answer,
it may fill the gap with something plausible but false.
That is a hallucination.
Right now,
the obvious response of yours is,
why not train the model on my data?
Well, fine-tuning Atlas can teach behavior,
tone,
and repeated workflows.
But it is not a reliable database for facts that change often.
When you renew a passport or spend some points,
the model's stored knowledge can become outdated.
The smarter move is simple.
Do not force the model to memorize changing facts.
Let the application retrieve the relevant facts when they are needed.
That is RAG,
which stands for Retrieval Augmented Generation.
Think of it as an open-book answer.
The model still reasons,
but first,
it receives a small evidence packet containing the information,
most relevant to the current question.
Here is the basic pipeline.
You ingest documents such as travel policies,
preferences,
and trip notes.
You split them into useful chunks and index them.
That index might use keyword search,
semantic embeddings,
or a hybrid of both.
When a request arrives,
the system applies the user's permissions,
retrieves the strongest matches,
and places those passages in the model's context
before generation begins.
So, Atlas is not remembering your passport record.
It is reading an authorized copy at the moment it needs it.
That makes the answer fresher and easier to verify.
That is why RAG appears in so many document assistants,
support bots,
enterprise search tools,
and coding products.
RAG is a system pattern where it retrieves useful evidence,
then generates evidence in context.
Okay,
Atlas can now find your specific data.
But if your gate changes while you're grabbing coffee,
an answer inside a chat is useless.
Atlas actually has to reach you.
And that feature you can integrate to your agents
by using today's sponsor,
Scent.
Scent gives developers one messaging API for SMS,
WhatsApp,
and RCS.
Now it connects to MCP-capable tools
like Cloud Code,
Cursor,
and VS Code.
An assistant can send messages,
manage contacts in templates,
as well as check delivery.
Setup is very convenient.
Copy the configuration from MCPDocs
and approve access on first use.
You choose the organization and sender profile.
Give Scent a phone number and a message.
It chooses between SMS,
WhatsApp based on availability,
the recipient's usual response,
and cost.
Scent takes care of routing,
formatting fallback channels,
and compliance rules on its own.
Your application sends one standard request
instead of maintaining separate code for every channel.
And the pricing is the part I like most.
Almost every messaging API charges per message,
so every single send becomes a tiny cost decision.
Scent charges per contact instead,
one and a half cents per contact per month,
and you can message that person as much as you want on any channel.
So when your agent starts sending more,
the pricing does not punish you for it.
Sign up using the link in the description
and $5 of free credit lands automatically,
which is more than enough to properly test the API
in your agent.
Thank you Scent for sponsoring this video.
Back to Atlas.
At this point,
we have added RAG to Atlas,
and now it can look up the current passport expiry,
points balance,
travel policy,
and seat preference
whenever the request requires them.
In a real system,
different kinds of information belong in different places.
Precise facts,
such as a passport's expiry date
or your points balance,
should come from a protected source of truth
with strict access controls.
Whereas less structured content,
such as travel policies and trip notes,
is better suited to semantic search,
which finds information by meaning
rather than exact wording.
The methods may differ,
but the goal is the same.
Give the model fresh,
authorized evidence at the moment it needs it.
So you might think the problem is solved,
right?
Not yet.
At this point,
RAG gives Atlas context,
but not capability or authority.
It can tell Atlas what a policy says,
but it does not let Atlas change a booking,
or approve a payment.
The retrieved material also needs to be treated carefully.
An outdated policy can mislead the model.
A malicious document can contain instructions
designed to hijack it.
And a passport record may reveal
far more personal information
than this task requires.
Atlas can now produce a better-grounded recommendation,
but a document index does not check a live fare,
place a hold,
or update your calendar.
Retrieval answers what Atlas needs to know,
but it does not answer what Atlas can do.
We gave Atlas a trustworthy folder of instructions,
but left it out of reach behind a desk.
It knows what to do,
yet it cannot do anything.
Knowledge without action.
That is Atlas's second wall.
It needs tools.
The obvious next step is to connect its host to a flight API,
a calendar API,
and an email API.
Function calling gives Atlas a structured way to request an action.
It might propose search flights along with an origin,
destination,
and travel dates.
The host checks the request,
runs the code,
and sends the result back to Atlas.
Atlas then decides what to do next.
This repeating loop where the model makes a request,
the host checks it,
the tool performs the task,
and the result comes back.
This is the basic engine behind most useful AI agents.
It produces a structured request.
Your application decides whether the request is valid or not.
Function calling is helpful,
but it is not a magic connect button.
For every service,
a developer still has to do some setup.
They need to read the service's API instructions,
match its data format when coding,
and decide exactly what the model is allowed to see and do.
Then the team repeats that work for hotels,
calendars,
email,
payments,
and internal databases.
Other teams build their own versions of the same connectors.
The result is a growing pile of custom code that holds everything together.
And whenever a service changes the format of its data,
a developer has to update and maintain that code.
The industry kept solving the same connection problem
in slightly different ways.
This is the point where MCP enters the story.
MCP stands for Model Context Protocol.
Anthropic introduced it in November 2024 as an open standard,
so different companies could use the same approach.
Since then,
many AI products and developer tools have adopted it.
One reason it's spread is because almost every AI agent needs the same thing,
which is a clear way for its main application to connect to outside tools and services.
MCP provides that shared connection point.
The popular shorthand is USBC for AI Applications.
That analogy is useful,
as long as we understand what it does and does not promise.
USBC gives devices a common way to communicate about a connection.
But using a USBC accessory does not automatically mean it is safe,
approved, or compatible with every feature.
MCP works in a similar way.
It standardizes how an AI application talks to an outside tool or service.
But it does not handle everything for you.
You still need login checks, permissions, data validation,
and the application's own rules.
Suppose a calendar service runs an MCP server.
That server can advertise a tool named Find Open Time,
explain what it does,
and publish a machine-readable input schema.
A flight service could offer tools such as search fares and hold itinerary in the same way.
Because both services use MCP,
every AI application receives the tool descriptions and input requirements in the same format.
Developers do not need to create a different connection format for every AI application.
On the other side,
the application running Atlas is the MCP host.
It connects to each MCP server through its own MCP client.
When a connection starts,
the client and server introduce themselves and agree on what each one supports.
The client then asks the server which tools are available.
It gives the model the relevant tool descriptions.
When the model suggests using a tool,
the client checks the request and sends it to the correct server.
Under the hood,
these messages use an updated version of JSON RPC.
Local servers usually communicate through standard input and output.
Remote servers usually communicate over streamable HTTP.
Those technical details matter when you build the system.
But the main idea is simple.
Every compatible connection follows the same conversational grammar.
That is the real change.
Atlas's host no longer needs a custom way to discover every integration.
Each connected service can describe what it can do in the same standard format.
In effect, the calendar service can introduce itself and explain which tools it offers.
Before we go further, there are two important points to clarify.
Marketing explanations can sometimes make the architecture sound more magical than it really is.
First, MCP does not replace API.
An MCP server might sit on top of an existing REST API.
The API is still the underlying set of rules for using the service.
MCP simply gives an AI application a standard way to discover and use that service.
So the choice is not MCP versus API.
In many real systems, MCP works on top of API.
Second, MCP servers can offer more than actions.
They can also provide resources, such as files or database records,
and prompts, which are reusable templates for starting an interaction.
For example, the documents in our Retrieval Augmented Generation,
or RAG pipeline, could be exposed as MCP resources.
But MCP does not search those documents or generate answers for us.
It simply gives the application a standard way to access the source material.
Our application still has to search the documents, sort the results by relevance,
check who is allowed to see them, and pass the supporting evidence into the model's context.
At this point, Atlas is much more capable.
Its host is connected to a calendar server, a flight search server, and an email server.
Atlas can now check for scheduling conflicts,
place a temporary hold, as well as draft a confirmation email.
Notice the careful wording, search, hold, and draft.
We have not given Atlas permission to spend money on its own.
The host still needs guardrails.
It should allow only trusted servers, give each server the minimum credentials it needs.
Atlas can now retrieve the information it needs and ask for the tools it needs to use.
Surely that means we are finished.
And this is where many agent diagrams stop.
In a real organization, though, Atlas soon runs into a third wall.
The challenge is no longer simply accessing a tool.
Atlas now has to coordinate work with another independent system,
one with its own rules and responsibilities.
The more options we give it, the more likely it is to choose the wrong tool,
keep track of too much information, or fail in unexpected ways.
Real organizations do not give one employee every responsibility.
They use specialists where each specialist owns a smaller task and hands work to the others.
Agent systems can use the same pattern.
Atlas can handle travel, while finance and airline agents handle their own areas.
This separates responsibilities and permissions,
but it also adds delays, coordination problems, and security risks.
However, these agents still need a way to talk to one another,
especially when they are built differently or owned by different companies.
If both agents live inside the same application,
the application can usually coordinate them directly.
Agent-to-agent communication, or A2A,
becomes useful when the agents belong to different teams or companies
and need a shared way to work together.
Google introduced A2A in April 2025 with support from many technology companies.
Its goal is simple – help independent AI agents work together,
even when different teams or companies build them using different technologies.
A2A gives agents a shared way to discover what each one can do,
exchange messages, manage tasks, so on and so forth, and finally give the final results.
One important part of A2A is the agent card.
It is a machine-readable information sheet that tells other systems how to work with an agent.
The card can include the agent's name, where to contact it, what it can do,
which data formats it accepts and returns, and how users must sign in.
Think of it as a service card, not a social profile.
It tells you what the agent claims it can do,
but it does not prove the agent is safe or trustworthy.
That distinction is important.
Atlas should find the finance agent only through a trusted source,
such as the company's official domain, a direct setup, or an approved directory.
Next, Atlas proves its identity using the required sign-in method.
Finally, the finance service decides what Atlas is allowed to do.
Simply finding an agent card does not give Atlas permission to share company data
or approve a purchase.
Once connected, Atlas can ask the finance agent to approve a specific travel plan.
If the review takes time, the finance agent can create a task,
share updates such as submitted or in progress,
ask for missing information, and return a final approval record.
Here is the simplest way to understand the difference.
MCP helps an AI application use tools from another system.
A 2A helps independent AI agents work together on a task.
Finally, let's see the full journey of Atlas where it books tickets for you
from a single request.
You say, Atlas, book my Tokyo trip for the second week of March.
Atlas starts with the facts.
Through RAG, it retrieves only what it needs.
Your preferences, company policy, points balance, and passport expiry date,
not the full passport scan.
If something looks risky, Atlas flags it instead of guessing.
Next, MCP lets Atlas check your calendar and search live fares.
The host approves each tool, validates every request, and logs every action.
Atlas finds a suitable flight and places it on hold.
The fare exceeds your company's limit,
so Atlas sends only the itinerary and price to finance through A2A.
Finance returns an approval tied to that exact trip, amount, and expiry time.
Atlas still does not buy.
It rechecks the price, shows you the final amount, and waits for your confirmation.
When you say yes, Atlas books without risking a duplicate purchase.
It saves the receipt, updates your calendar, and sends the itinerary.
One request, four clear roles.
If you want to build this Atlas flow in code, comment ATLAS below.
And hey, if you are building an agent that reaches people,
try SENT, which gives you one messaging API for SMS, WhatsApp, and RCS.
The link is in the description.
Thanks for watching.