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