YouTube2Text

API vs RAG vs MCP vs A2A Explained in 19 Minutes. — Transcript

by Codist · 3,094 words · 521 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Right now, three acronyms are changing
  2. 0:02how real-world AI products are built:
  3. 0:05RAG, MCP, and A2A protocols.
  4. 0:09Most developers understand at least one
  5. 0:11of them, but far fewer can explain where
  6. 0:14one stops and the next begins. And that
  7. 0:16gap is why an agent can look magical in
  8. 0:18a demo, then become slow, confused, or
  9. 0:21genuinely unsafe in production. So,
  10. 0:23let's connect the pieces. We'll follow
  11. 0:25one agent, Atlas, and build it layer by
  12. 0:28layer. We'll start with plain English,
  13. 0:30then add the technical details, and show
  14. 0:32how everything works together. Every
  15. 0:34time the agent hits a wall, we will
  16. 0:36introduce the exact piece of the stack
  17. 0:38that solves that problem. By the end,
  18. 0:40you will understand how these systems
  19. 0:42actually fit together. Let's get into
  20. 0:44it. First, to see where AI software is
  21. 0:46going, we first need to understand how
  22. 0:48software has communicated for decades,
  23. 0:51and that story starts with the API. An
  24. 0:53API is a contract between two programs.
  25. 0:56It defines what you can request, how
  26. 0:58that request must be formatted, and what
  27. 1:00comes back. If you send the expected
  28. 1:03input to the expected endpoint, then you
  29. 1:05get a predictable response. That
  30. 1:07predictability is the whole point of an
  31. 1:09API.
  32. 1:10Much of the modern internet runs on API.
  33. 1:13A weather app asks for a forecast, or an
  34. 1:16online store processes a payment. Even a
  35. 1:18messaging service sends a notification.
  36. 1:21All of this is work of an API.
  37. 1:24Traditional software handles these tasks
  38. 1:26reliably because the developer plans the
  39. 1:28sequence in advance.
  40. 1:30Then we placed a large language model
  41. 1:33inside that carefully scripted system.
  42. 1:35The input was no longer a neat form.
  43. 1:37Someone might say, "Find me a good
  44. 1:39flight, avoid overnight layovers, and
  45. 1:41make sure I do not miss Monday's
  46. 1:43meeting." Now the system has to
  47. 1:45understand the request, check several
  48. 1:47services, ask follow-up questions, and
  49. 1:49adjust its plan.
  50. 1:51The model may understand the goal, but
  51. 1:53the API still needs exact instructions,
  52. 1:56which endpoint to call, which fields and
  53. 1:58data types to send, which credentials to
  54. 2:00use, and what to do when something goes
  55. 2:02wrong.
  56. 2:04It is like giving a talented new
  57. 2:05employee a room full of control panels
  58. 2:07with no labels. Intelligence does not
  59. 2:09automatically create an interface.
  60. 2:12Our first workaround for this problem
  61. 2:14was brute force. We describe every
  62. 2:16function to the model. For example, when
  63. 2:18the user asks for flights, call this
  64. 2:20function, provide these fields, and
  65. 2:22expect this shape back. That works at
  66. 2:24small scale, but add 10 tools and the
  67. 2:26instructions swell.
  68. 2:28Whenever you tend to change a schema,
  69. 2:30something can fail silently. In this
  70. 2:32case, we were attaching a flexible
  71. 2:34reasoning layer to a collection of rigid
  72. 2:35integrations, one custom connector at a
  73. 2:38time.
  74. 2:40There had to be a cleaner way, but
  75. 2:42before we reach it, we need an agent
  76. 2:43with a real job. For the rest of this
  77. 2:45video, we are going to build an
  78. 2:46imaginary AI agent together. Say hello
  79. 2:49to Atlas. Atlas has one job, be the
  80. 2:52ultimate personal travel assistant.
  81. 2:54You tell Atlas, "Plan my trip to Tokyo
  82. 2:57in March."
  83. 2:58Atlas should understand your
  84. 2:59preferences, check your schedule, find
  85. 3:01flights and hotels, request approval
  86. 3:03when necessary, and help you complete
  87. 3:05the booking. That sounds like one
  88. 3:07request. Architecturally, it is a pile
  89. 3:09of different problems, and Atlas hits
  90. 3:12the first one immediately.
  91. 3:13You see, Atlas is powered by a large
  92. 3:15language model. The model may know a lot
  93. 3:18about Tokyo, like the neighborhoods,
  94. 3:19food, train lines, and the usual travel
  95. 3:22advice, but it does not know your
  96. 3:24passport is going to expire in April, or
  97. 3:26you have airline points, as well as your
  98. 3:28company caps reimbursable flights at
  99. 3:30$800.
  100. 3:32These facts are private, specific to
  101. 3:34you, and likely to change. They were
  102. 3:36never part of the model's training data,
  103. 3:38and when a model can sound confident,
  104. 3:40even when it does not know the answer,
  105. 3:42it may fill the gap with something
  106. 3:43plausible, but false.
  107. 3:45That is a hallucination.
  108. 3:47Right now, the obvious response of yours
  109. 3:49is, "Why not train the model on my data?
  110. 3:52Well, fine-tuning Atlas can teach
  111. 3:54behavior, tone, and repeated workflows.
  112. 3:57But, it is not a reliable database for
  113. 3:59facts that change often.
  114. 4:01When you renew a passport or spend some
  115. 4:03points, the model's stored knowledge can
  116. 4:05become outdated. The smarter move is
  117. 4:08simple. Do not force the model to
  118. 4:09memorize changing facts. Let the
  119. 4:11application retrieve the relevant facts
  120. 4:13when they are needed. That is RAG, which
  121. 4:15stands for retrieval augmented
  122. 4:17generation. Think of it as an open-book
  123. 4:19answer. The model still reasons, but
  124. 4:22first it receives a small evidence
  125. 4:23packet containing the information most
  126. 4:26relevant to the current question.
  127. 4:28Here is the basic pipeline. You ingest
  128. 4:30documents such as travel policies,
  129. 4:32preferences, and trip notes. You split
  130. 4:35them into useful chunks and index them.
  131. 4:38That index might use keyword search,
  132. 4:40semantic embeddings, or a hybrid of
  133. 4:42both.
  134. 4:43When a request arrives, the system
  135. 4:45applies the user's permissions,
  136. 4:47retrieves the strongest matches, and
  137. 4:50places those passages in the model's
  138. 4:52context before generation begins.
  139. 4:55So, Atlas is not remembering your
  140. 4:56passport record. It is reading an
  141. 4:58authorized copy at the moment it needs
  142. 5:00it. That makes the answer fresher and
  143. 5:02easier to verify.
  144. 5:04That is why RAG appears in so many
  145. 5:06document assistants, support bots,
  146. 5:08enterprise search tools, and coding
  147. 5:10products. RAG is a system pattern where
  148. 5:13it retrieves useful evidence, then
  149. 5:15generates evidence in context. Okay,
  150. 5:18Atlas can now find your specific data.
  151. 5:20But, if your gate changes while you're
  152. 5:22grabbing coffee, an answer inside a chat
  153. 5:24is useless. Atlas actually has to reach
  154. 5:27you. And that feature you can integrate
  155. 5:29to your agents by using today's sponsor,
  156. 5:31Send.
  157. 5:33Send gives developers one messaging API
  158. 5:36for SMS, WhatsApp, and RCS.
  159. 5:40Now, it connects to MCP capable tools
  160. 5:43like Claude Code, Cursor, and VS Code.
  161. 5:46An assistant can send messages, manage
  162. 5:48contacts and templates, as well as check
  163. 5:50delivery. Setup is very convenient. Copy
  164. 5:53the configuration from MCP Docs and
  165. 5:55approve access on first use. You choose
  166. 5:58the organization and sender profile.
  167. 6:00Give Send to a phone number and a
  168. 6:02message. It chooses between SMS,
  169. 6:04WhatsApp based on availability, the
  170. 6:06recipient's usual response, and cost.
  171. 6:10Send takes care of routing, formatting
  172. 6:12fallback channels, and compliance rules
  173. 6:14on its own. Your application sends one
  174. 6:16standard request instead of maintaining
  175. 6:18separate code for every channel. And the
  176. 6:21pricing is the part I like most. Almost
  177. 6:23every messaging API charges per message,
  178. 6:26so every single send becomes a tiny cost
  179. 6:28decision. Send charges per contact
  180. 6:31instead. One and a half cents per
  181. 6:33contact per month, and you can message
  182. 6:34that person as much as you want on any
  183. 6:37channel. So, when your agent starts
  184. 6:39sending more, the pricing does not
  185. 6:40punish you for it.
  186. 6:42Sign up using the link in the
  187. 6:43description, and $5 of free credit lands
  188. 6:46automatically, which is more than enough
  189. 6:48to properly test the API in your agent.
  190. 6:51Thank you, Send, for sponsoring this
  191. 6:53video.
  192. 6:54Back to Atlas. At this point, we have
  193. 6:56added RAG to Atlas, and now we can look
  194. 6:58up the current passport expiry, points
  195. 7:00balance, travel policy, and seat
  196. 7:03preference whenever the request requires
  197. 7:05them.
  198. 7:06In a real system, different kinds of
  199. 7:08information belong in different places.
  200. 7:10Precise facts, such as a passport's
  201. 7:12expiry date or your points balance,
  202. 7:14should come from a protected source of
  203. 7:16truth with strict access controls.
  204. 7:19Whereas less structured content, such as
  205. 7:21travel policies and trip notes, is
  206. 7:23better suited to semantic search, which
  207. 7:25finds information by meaning rather than
  208. 7:27exact wording.
  209. 7:29The methods may differ, but the goal is
  210. 7:31the same. Give the model fresh,
  211. 7:33authorized evidence at the moment it
  212. 7:34needs it.
  213. 7:36So, you might think the problem is
  214. 7:37solved, right? Not yet. At this point,
  215. 7:40RAG gives Atlas context, but not
  216. 7:42capability or authority. It can tell
  217. 7:44Atlas what a policy says, but it does
  218. 7:46not let Atlas change a booking or
  219. 7:48approve a payment. The retrieve material
  220. 7:50also needs to be treated carefully. An
  221. 7:53outdated policy can mislead the model. A
  222. 7:55malicious document can contain
  223. 7:57instructions designed to hijack it. And
  224. 8:00a passport record may reveal far more
  225. 8:02personal information than this task
  226. 8:04requires.
  227. 8:06Atlas can now produce a better grounded
  228. 8:08recommendation, but a document index
  229. 8:10does not check a live fare, place a
  230. 8:12hold, or update your calendar.
  231. 8:15Retrieval answers what Atlas needs to
  232. 8:17know, but it does not answer what Atlas
  233. 8:19can do. We gave Atlas a trustworthy
  234. 8:21folder of instructions, but left it out
  235. 8:23of reach behind a desk. It knows what to
  236. 8:26do, yet it cannot do anything. Knowledge
  237. 8:28without action. That is Atlas's second
  238. 8:30wall. It needs tools.
  239. 8:32The obvious next step is to connect its
  240. 8:34host to a flight API, a calendar API,
  241. 8:37and an email API.
  242. 8:39Function calling gives Atlas a
  243. 8:41structured way to request an action. It
  244. 8:43might propose search flights along with
  245. 8:45an origin, destination, and travel
  246. 8:47dates.
  247. 8:49The host checks the request, runs the
  248. 8:51code, and sends the result back to
  249. 8:53Atlas.
  250. 8:54Atlas then decides what to do next. This
  251. 8:56repeating loop where the model makes a
  252. 8:58request, the host checks it, the tool
  253. 9:01performs the task, and the result comes
  254. 9:03back. This is the basic engine behind
  255. 9:05most useful AI agents.
  256. 9:08It produces a structured request. Your
  257. 9:10application decides whether the request
  258. 9:12is valid or not. Function calling is
  259. 9:15helpful, but it is not a magic connect
  260. 9:17button. For every service, a developer
  261. 9:19still has to do some setup. They need to
  262. 9:22read the service's API instructions,
  263. 9:24match its data format when coding, and
  264. 9:26decide exactly what the model is allowed
  265. 9:28to see and do. Then the team repeats
  266. 9:31that work for hotels, calendars, email,
  267. 9:33payments, and internal databases.
  268. 9:36Other teams build their own versions of
  269. 9:38the same connectors. The result is a
  270. 9:40growing pile of custom code that holds
  271. 9:42everything together. And whenever a
  272. 9:44service changes the format of its data,
  273. 9:47a developer has to update and maintain
  274. 9:49that code.
  275. 9:50The industry kept solving the same
  276. 9:52connection problem in slightly different
  277. 9:54ways.
  278. 9:55This is the point where MCP enters the
  279. 9:57story. MCP stands for Model Context
  280. 10:00Protocol. Anthropic introduced it in
  281. 10:02November 2024 as an open standard. So
  282. 10:05different companies could use the same
  283. 10:07approach. Since then, many AI products
  284. 10:10and developer tools have adopted it. One
  285. 10:13reason it spread is because almost every
  286. 10:15AI agent needs the same thing, which is
  287. 10:18a clear way for its main application to
  288. 10:20connect to outside tools and services.
  289. 10:23MCP provides that shared connection
  290. 10:25point.
  291. 10:26The popular shorthand is USB-C for AI
  292. 10:30applications.
  293. 10:31That analogy is useful as long as we
  294. 10:34understand what it does and does not
  295. 10:36promise.
  296. 10:37USB-C gives devices a common way to
  297. 10:39communicate about a connection. But
  298. 10:42using a USB-C accessory does not
  299. 10:44automatically mean it is safe, approved,
  300. 10:46or compatible with every feature.
  301. 10:49MCP works in a similar way. It
  302. 10:51standardizes how an AI application talks
  303. 10:54to an outside tool or service. But it
  304. 10:57does not handle everything for you. You
  305. 10:59still need login checks, permissions,
  306. 11:01data validation, and the application's
  307. 11:03own rules.
  308. 11:05Suppose a calendar service runs an MCP
  309. 11:08server. That server can advertise a tool
  310. 11:10named find open time, explain what it
  311. 11:12does, and publish a machine-readable
  312. 11:15input schema. A flight service could
  313. 11:17offer tools such as search fares and
  314. 11:20hold itinerary in the same way.
  315. 11:23Because both services use MCP, every AI
  316. 11:26application receives the tool
  317. 11:28descriptions and input requirements in
  318. 11:31the same format.
  319. 11:32Developers do not need to create a
  320. 11:34different connection format for every AI
  321. 11:36application. On the other side, the
  322. 11:38application running Atlas is the MCP
  323. 11:41host. It connects to each MCP server
  324. 11:44through its own MCP client. When a
  325. 11:46connection starts, the client and server
  326. 11:49introduce themselves and agree on what
  327. 11:51each one supports.
  328. 11:53The client then asks the server which
  329. 11:55tools are available. It gives the model
  330. 11:57the relevant tool descriptions. When the
  331. 11:59model suggests using a tool, the client
  332. 12:01checks the request and sends it to the
  333. 12:03correct server. Under the hood, these
  334. 12:05messages use an updated version of
  335. 12:07JSON-RPC.
  336. 12:09Local servers usually communicate
  337. 12:11through standard input and output.
  338. 12:13Remote servers usually communicate over
  339. 12:15streamable HTTP.
  340. 12:19Those technical details matter when you
  341. 12:20build the system, but the main idea is
  342. 12:22simple. Every compatible connection
  343. 12:25follows the same conversational grammar.
  344. 12:28That is the real change.
  345. 12:30Atlas's host no longer needs a custom
  346. 12:32way to discover every integration.
  347. 12:35Each connected service can describe what
  348. 12:37it can do in the same standard format.
  349. 12:39In effect, the calendar service can
  350. 12:41introduce itself and explain which tools
  351. 12:44it offers.
  352. 12:45Before we go further, there are two
  353. 12:47important points to clarify. Marketing
  354. 12:49explanations can sometimes make the
  355. 12:51architecture sound more magical than it
  356. 12:53really is.
  357. 12:55First, MCP does not replace API. An MCP
  358. 12:58server might sit on top of an existing
  359. 13:01REST API.
  360. 13:02The API is still the underlying set of
  361. 13:04rules for using the service. MCP simply
  362. 13:07gives an AI application a standard way
  363. 13:09to discover and use that service. So,
  364. 13:12the choice is not MCP versus API.
  365. 13:15In many real systems, MCP works on top
  366. 13:17of API.
  367. 13:19Second, MCP servers can offer more than
  368. 13:21actions. They can also provide
  369. 13:23resources, such as files or database
  370. 13:25records, and prompts, which are reusable
  371. 13:28templates for starting an interaction.
  372. 13:30For example, the documents in our
  373. 13:32retrieval-augmented generation, or RAG
  374. 13:35pipeline, could be exposed as MCP
  375. 13:38resources.
  376. 13:39But MCP does not search those documents
  377. 13:42or generate answers for us. It simply
  378. 13:44gives the application a standard way to
  379. 13:46access the source material.
  380. 13:48Our application still has to search the
  381. 13:50documents, sort the results by
  382. 13:52relevance, check who is allowed to see
  383. 13:54them, and pass the supporting evidence
  384. 13:56into the model's context.
  385. 13:58At this point, Atlas is much more
  386. 14:00capable. It's host is connected to a
  387. 14:02calendar server, a flight search server,
  388. 14:04and an email server. Atlas can now check
  389. 14:07for scheduling conflicts, place a
  390. 14:09temporary hold, as well as draft a
  391. 14:10confirmation email.
  392. 14:12Notice the careful wording: search,
  393. 14:14hold, and draft. We have not given Atlas
  394. 14:17permission to spend money on its own.
  395. 14:19The host still needs guardrails. It
  396. 14:21should allow only trusted servers, give
  397. 14:23each server the minimum credentials it
  398. 14:25needs.
  399. 14:26Atlas can now retrieve the information
  400. 14:28it needs, and ask for the tools it needs
  401. 14:30to use.
  402. 14:32Surely that means we are finished. And
  403. 14:34this is where many agent diagrams stop.
  404. 14:36In a real organization, though, Atlas
  405. 14:38soon runs into a third wall.
  406. 14:41The challenge is no longer simply
  407. 14:42accessing a tool.
  408. 14:44Atlas now has to coordinate work with
  409. 14:46another independent system, one with its
  410. 14:48own rules and responsibilities.
  411. 14:50The more options we give it, the more
  412. 14:52likely it is to choose the wrong tool,
  413. 14:54keep track of too much information, or
  414. 14:55fail in unexpected ways.
  415. 14:58Real organizations do not give one
  416. 15:00employee every responsibility.
  417. 15:03They use specialists, where each
  418. 15:04specialist owns a smaller task, and
  419. 15:06hands work to the others.
  420. 15:08Agent systems can use the same pattern.
  421. 15:10Atlas can handle travel, while finance
  422. 15:13and airline agents handle their own
  423. 15:15areas. This separates responsibilities
  424. 15:18and permissions, but it also adds
  425. 15:20delays, coordination problems, and
  426. 15:22security risks. However, these agents
  427. 15:25still need a way to talk to one another,
  428. 15:27especially when they are built
  429. 15:28differently or owned by different
  430. 15:31companies. If both agents live inside
  431. 15:33the same application, the application
  432. 15:35can usually coordinate them directly.
  433. 15:38Agent-to-agent communication, or A2A,
  434. 15:41becomes useful when the agents belong to
  435. 15:43different teams or companies and need a
  436. 15:45shared way to work together. Google
  437. 15:47introduced A2A in April 2025 with
  438. 15:50support from many technology companies.
  439. 15:52Its goal is simple: help independent AI
  440. 15:55agents work together, even when
  441. 15:57different teams or companies build them
  442. 15:59using different technologies. A2A gives
  443. 16:02agents a shared way to discover what
  444. 16:04each one can do, exchange messages,
  445. 16:06manage tasks, so on and so forth, and
  446. 16:09finally give the final results.
  447. 16:12One important part of A2A is the agent
  448. 16:14card. It is a machine-readable
  449. 16:16information sheet that tells other
  450. 16:18systems how to work with an agent. The
  451. 16:21card can include the agent's name, where
  452. 16:23to contact it, what it can do, which
  453. 16:25data formats it accepts and returns, and
  454. 16:27how users must sign in.
  455. 16:29Think of it as a service card, not a
  456. 16:31social profile. It tells you what the
  457. 16:33agent claims it can do, but it does not
  458. 16:35prove the agent is safe or trustworthy.
  459. 16:38That distinction is important. Atlas
  460. 16:40should find the finance agent only
  461. 16:42through a trusted source, such as the
  462. 16:43company's official domain, a direct
  463. 16:46setup, or an approved directory.
  464. 16:48Next, Atlas proves its identity using
  465. 16:50the required sign-in method. Finally,
  466. 16:53the finance service decides what Atlas
  467. 16:55is allowed to do.
  468. 16:57Simply finding an agent card does not
  469. 16:59give Atlas permission to share company
  470. 17:01data or approve a purchase.
  471. 17:03Once connected, Atlas can ask the
  472. 17:05finance agent to approve a specific
  473. 17:07travel plan. If the review takes time,
  474. 17:10the finance agent can create a task,
  475. 17:12share updates such as submitted or in
  476. 17:15progress, ask for missing information,
  477. 17:17and return a final approval record.
  478. 17:20Here is the simplest way to understand
  479. 17:22the difference.
  480. 17:24MCP helps an AI application use tools
  481. 17:27from another system. A2A helps
  482. 17:29independent AI agents work together on a
  483. 17:31task.
  484. 17:33Finally, let's see the full journey of
  485. 17:35Atlas where it booked tickets for you
  486. 17:36from a single request. You say, "Atlas,
  487. 17:39book my Tokyo trip for the second week
  488. 17:41of March."
  489. 17:42Atlas starts with the facts. Through
  490. 17:44rag, it retrieves only what it needs.
  491. 17:46Your preferences, company policy, points
  492. 17:49balance, and passport expiry date, not
  493. 17:51the full passport scan.
  494. 17:53If something looks risky, Atlas flags it
  495. 17:56instead of guessing. Next, MCP lets
  496. 17:59Atlas check your calendar and search
  497. 18:01live fares. The host approves each tool,
  498. 18:03validates every request, and logs every
  499. 18:05action.
  500. 18:06Atlas finds a suitable flight and places
  501. 18:08it on hold.
  502. 18:10The fare exceeds your company's limit,
  503. 18:12so Atlas sends only the itinerary and
  504. 18:14price to finance through A2A.
  505. 18:16Finance returns an approval tied to that
  506. 18:18exact trip, amounts, and expiry time.
  507. 18:22Atlas still does not buy. It rechecks
  508. 18:24the price, shows you the final amounts,
  509. 18:26and waits for your confirmation. When
  510. 18:28you say yes, Atlas books without risking
  511. 18:30a duplicate purchase. It saves the
  512. 18:32receipt, updates your calendar, and
  513. 18:34sends the itinerary. One request, four
  514. 18:37clear roles. If you want to build this
  515. 18:39Atlas flow in code, comment Atlas below.
  516. 18:42And hey, if you are building an agent
  517. 18:44that reaches people, try sent, which
  518. 18:46gives you one messaging API for SMS,
  519. 18:49WhatsApp, and RCS.
  520. 18:52The link is in the description.
  521. 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.