---
title: 'AI Agent Fundamentals'
source: 'https://youtube.com/watch?v=GScUjc-A4yE'
video_id: 'GScUjc-A4yE'
date: 2026-07-31
duration_sec: 1201
---

# AI Agent Fundamentals

> Source: [AI Agent Fundamentals](https://youtube.com/watch?v=GScUjc-A4yE)

## Summary

This video provides a practical, beginner-friendly introduction to AI agents, explaining core concepts like the combination of LLMs with tools, knowledge, and memory, the levels of agency, the ReAct loop, multi-agent systems, and multimodal capabilities. Dhaval, an AI consultant with experience at Bloomberg and Nvidia, demonstrates building agents using no-code tools (Zapier, N8N) and coding frameworks (LangChain), and covers important topics such as guardrails and evaluation.

### Key Points

- **What is an AI Agent?** [00:03] — An AI agent combines a large language model (LLM) with tools, knowledge, and memory to perform tasks autonomously. It takes input, thinks, and acts to complete a complex goal without step-by-step programming.
- **How LLMs Access Live Data** [01:14] — LLMs have a knowledge cutoff, but they can overcome this by using tools like internet search. ChatGPT shows a 'searching the web' icon when fetching live flight prices, illustrating tool use.
- **Amazon Rufus as an Agent Example** [01:58] — Rufus, Amazon's chatbot, can search for products, retrieve reviews via APIs, remember conversation context, and place orders using a checkout API — all autonomously.
- **Core Agent Architecture** [03:15] — An agent is LLM + tools + knowledge + memory. Tools are APIs like review or checkout, knowledge is data from a database, and memory stores past conversation. This enables autonomous reasoning and multi-step planning.
- **Levels of Agency** [05:05] — Agency ranges from low (ChatGPT answering questions) to medium (Zapier/N8N workflows) to high (Claude Code writing code) and very high (OpenClaw running fully autonomously). Higher agency means lower predictability.
- **The ReAct Loop** [07:42] — Agents operate in a reason-and-act loop: think, plan, take action, observe the result, then refine until the goal is achieved. This loop is central to agent autonomy.
- **Multi-Agent Systems** [08:26] — Multiple agents can collaborate, each handling a specific subtask. Example: a product search agent passes a checkout request to a checkout agent, solving problems too complex for one agent.
- **Multimodal Agents** [09:08] — Multimodal agents process text, images, audio, and video. For a health insurance use case, an agent can extract information from medical records, ID cards, prescriptions, and doctor notes.
- **Two Ways to Build Agents** [10:06] — Agents can be built with no-code tools like Zapier and N8N, or with coding frameworks like LangChain, LangGraph, Google ADK, and CrewAI. N8N allows drag-and-drop workflow automation with an AI agent node.
- **LangChain Shopping Agent Demo** [11:05] — A shopping agent built with LangChain has three tools: search product (SQLite database), get rating (reviews table), and checkout. The LLM autonomously decides which tools to call based on a system prompt, and it successfully found organic honey with a 4.62 rating and placed an order.
- **Workflows vs Agents** [12:34] — A workflow uses an LLM as one component in a fixed, programmer-defined control flow (e.g., news article summarization). An agent lets the LLM decide the control flow and call tools autonomously.
- **Guardrails for AI Agents** [13:42] — Agents are like a monkey with a gun; without guardrails they can leak PII, answer out-of-scope questions, or be jailbroken. The Air Canada chatbot lawsuit and Chipotle chatbot programming answers are examples. In LangChain, PII middleware can mask credit cards and redact emails.
- **Evaluating AI Agents** [16:20] — AI agents are probabilistic, so evaluation requires three categories: functional (correctness, faithfulness, hallucination), cost (token usage, latency), and safety (toxic output, PII leak, jailbreaks). LangSmith and Ragas are popular frameworks.
- **Comparing Models with LangSmith** [18:28] — LangSmith compares runs across models. It shows semantic similarity scores (1 = exact match), latency percentiles (P50, P99), and token cost, enabling data-driven model selection (e.g., GPT-OSS faster and cheaper than Qwen).

### Conclusion

The video demystifies AI agents by breaking down their core components, demonstrating real code examples, and emphasizing the importance of guardrails and evaluation. Viewers leave with a clear understanding of how to build and deploy agents practically.

## Transcript

Cloud Code is an example of an AI agent. When you start learning AI agents, you come across so many confusing terms that it is easy to get lost. My purpose for today's video is to teach you AI agent fundamentals in a most simple and
practical manner. I will not just talk theory, I will show you how you can build these agents yourself using no-code tools and also coding frameworks such as LangChain. [music] At the end, we have given you assignment where we
have ideas for five different AI agents that you can build after watching this video. All right, let's get started. Before we start, a little introduction on myself. I am Dhaval. I have 15-plus years of experience working for big tech
companies like Bloomberg and Nvidia. At present, I run an AI consultancy company called Ethic Technologies. We have a team of AI engineers who help our clients based in US and Middle East in terms of building AI projects. Some of
these AI projects are agentic [music] systems. Let's understand what exactly is an AI agent. When you ask this kind of question in ChatGPT asking it for a flight price, usually you will see an icon saying that searching the web and
it will tell you the latest flight prices. But if you think about the large language model which is working behind the scenes, here it is GPT 5.3, that model has a knowledge cutoff date. So then how is it getting latest flight
then how is it getting latest flight prices? Well, if you have just the pure LLM, it should not be able to give you the information on the latest event. But here, watch this. You see the searching the web icon, which means LLM has access
to internet. And with that, it can tell you things about the latest events. Another example is Amazon's Rufus or Ruffus or Ruffus, whatever. That
particular chatbot where you can say I want to buy organic honey with 4.5 rating and less than $20 price. And it will tell you uh the product information. Not only that, you can say add it to cart, place an order, and it
will do it. Folks, try it out. It actually works. So, in this case, when you ask the question on a specific product, large language model is at the core of any agent. Even Rufus AI has some kind of large language model.
some kind of large language model. And it will then look into a product database. Okay? It will also call some kind of APIs, let's say, to to get the reviews. And it will tell you, "Okay, here are the three products that I have
found." Now, when you say buy the first one for me, the LLM remembers the past conversation. So, it should have access to some kind of memory, and then it will to some kind of memory, and then it will use probably a checkout API to place an
order. So, here LLM alone is not capable of doing things, but when you give it access of tools. So, for example, review API, checkout API are the tools. Product is a database, so it is a knowledge. Memory is memory. So, when
knowledge. Memory is memory. So, when LLM is given access to tools, knowledge, LLM is given access to tools, knowledge, and memory, it can perform uh tasks for you in autonomous fashion. So, this is an agent. Whatever you are
seeing in green is an agent. It is LLM plus tool plus knowledge plus memory. It is a program that takes input, thinks, and acts to complete a task in an autonomous way using tools, memory, and knowledge. So, say there is some kind of
autonomy that you will see here. So, if you think about the steps that it performed, what it did is it found organic honey products from products database? Then it filter the ones which has less than 4.5 rating, added it to
has less than 4.5 rating, added it to card and place an order. So here it is reasoning, multi-step planning, and working on a complex goal autonomously. It is deciding whether I should call products database, review API, checkout,
etc. You have not programmed it. LLM is deciding that in autonomous fashion. deciding that in autonomous fashion. Here LLM is able to perform complex tasks because it has access to tools, knowledge, and memory. This is like as a
human, if someone asked me to put a screw in a wall with my hand, I won't be screw in a wall with my hand, I won't be able to do it. So LLM here is me, but if somebody gives me a screwdriver, a drill, then using the tools, I can put
that screw in the wall. So the tools are all these, okay? So using that, I can all these, okay? So using that, I can perform a task in a autonomous fashion. Now, pause this video and tell me two important characteristics of an AI
important characteristics of an AI agent. first one is it uses LLM as its brain, and it has some kind of autonomy.
Autonomy means an agent can read write files, it can make bank transaction, it can place an order, it can delete things, read send emails, etc. If you know about OpenClaw, OpenClaw is fully autonomous agent which
OpenClaw is fully autonomous agent which can do so many things. Now, agency can have multiple levels, okay? So you can assign assign a level of agency to an agent. So here,
if you think about ChatGPT application, it has very less agency. So you see this axis here, so ChatGPT has very less agency, which means it is answering your question, and maybe it can search internet, or maybe it can call some
other minor tool, and that's it. The second level of agency is things like Zapier and attain. These are no code tools that you can use to build agents. So, here you will define a workflow using the
the graphical user interface. Okay, you will use nodes, etc. And then you can give it a task, and it will perform that workflow for you. Here the level of agency is little bit higher because maybe it can access your Gmail,
it can send a message on Slack, it can perform a transaction, and so on based on the boundaries that you have defined. The third level is Claude code where you give it an access to your GitHub or your local repository, and you can say,
"Okay, write this code." So, it will do planning, coding, testing, review, all of it, you know. It can write 10,000 lines of code in an autonomous way. And the fourth one, which has very high level of agency, is Open Claw.
So, when you have Open Claw running in your VPS or Mac Mini, you might have given it access to 10 different tools, and it will just perform that task in a fully autonomous way. As you can see from this axis, as
the agency increases, the predictability will decrease. Right? So, if you have Open Claw running on a, you know, some tasks which you have been running for the whole night, in the morning when you wake up, you might see things that you
might not have expected. This is like you have a team, and you are a manager, and you have an employee, and you are saying that, "Okay, here is the task. Go do it. You don't need to ask me." And that person can work for 1 week, and
after 1 week they will come, and they will give you the output. You might get some surprises when you do that. The other way is you give them very less agency. So, it's like they're doing some work every 2 hours, they need to show it
to you. And then you will guide, "Okay, do this, do that." That is having less agency. In any agent, there is this react loop, reason plus act. What it means is when you give a question, for example, when you ask Claude Code to
write code, it will first think, it will plan, then it will take action, maybe it will write some code, and then it will observe, "Oh, what this code is doing?" And then it might refine it. Okay, so there is this loop, a reason and act
there is this loop, a reason and act loop. It will be in that loop until it achieves the end goal. Okay, so this is called react loop for agents. All right, now let's talk about multi-agent system. In the example that we saw, we can have
multiple agents. First one can be product search agent whose responsibility is to find products for you. And when you say, "Hey, buy this product for me," it may call another agent, which is checkout agent, with a
specific request, and that will take care of checkout. So, you can have multi-agent system where multiple AI agents collaborate, each handling a specific subtask, to solve a problem too complex for one agent alone. Okay?
One example is code agent. You know, you can have a code agent where one agent is doing planning, another one is doing writing of code, third one might be doing review of code, and fourth one might be testing it. The next concept
you should be aware about is multimodal agents. So, multimodal means an AI model can process not just text, but other kind of data formats such as image,
audio, video, etc. You might have noticed that when you're using Gemini or Claude Code, you can not only give text, you can give images as well. Because the models underneath, which is GPT, Opus, Gemini, using these LLMs, you can
build an AI system that is multimodal. For example, you are building an AI agent for a health insurance company where it can process various medical records, the ID cards, the prescriptions, the doctor notes for the
patients. It can extract the information. It can also do some text processing, document classification, etc. And that will be the example of a multimodal AI system. Let's now discuss two ways of creating AI agents. The
first one is using no-code tools such as Zapier, N8N, etc. The second way is you are using coding frameworks such as LangChain, LangGraph, Google ADK, Crew
AI, etc. I have a video on how you can build customer care AI agent using are interested in building an agent using Zapier. And here is the example of how you can build Agent AI system using tool called N8N where you can drag and
drop, you can connect different components, you can have an AI agent which is using Google's Gemini model. They have access to different tools, you know, tools, etc. You can define this if condition and define the whole control
flow to accomplish a given task. And here is the example of shopping agent similar to Rufus or Rufus, whatever that is, that we have built using LangChain. We are using Chat Grok with Gwen model here. And if you look at
agent here, it has access to these three tools. The first tool is search product, which will search the product from SQLite database. So, we have the SQLite database here. We have all these products. Right now, I have only the
products for category honey, okay? And it will find the right product for you. Once the product is found, you will get rating and then do checkout. So, here you are giving a system prompt with all the detailed instructions that, okay,
you can use search products to find these matching items. You can call get rating to retrieve the rating. The rating lives in a different table. So, rating lives in a different table. So, see here we have reviews for uh
see here we have reviews for uh different products. And LLM will call all these tools in autonomous way. You are not saying, "Okay, hey, call this tool, then process the output, then do that." You are not wiring that workflow,
okay? What you're doing is, "Hey, LLM, you have these three tools available." And it calls those tools in autonomous fashion. So, I ran this agent and I asked this question on organic honey, and it actually found organic honey,
and it actually found organic honey, which has more than 4.5 rating, 4.62, and it placed an order, okay? Look at this code in a video description. I have given a link of my GitHub. If an AI application is using LLM, it doesn't
mean it is an agent. There is another category of LLM applications, which are category of LLM applications, which are called workflows, where you use LLM just as one component for a very specific task. Take this example of news
websites. Nowadays, they have this show quick read option. It's just a summary of a news article. And the way you can design this is you can have news article pre-processing using Python, then you give it to LLM, and you will say that
generate the summary. Whatever summary you get, you will do post-processing, you will summarize and append it to an article. Here LLM is one component, which is given specific input, specific instruction, and it is producing
specific output. It is not making calls to any tools. It is not deciding, "Okay, what tool to call?" And it is not deciding the control flow. Control flow
is wired by you as a programmer, and LLM is just one component. This is called a workflow. All right, let's discuss a very important topic, guardrails.
very important topic, guardrails. An agent is like a monkey with a gun. If you don't control it, it can do a damage. It did a damage in the case of Air Canada, where it lost in a remarkable lying AI chatbot case. The
chatbot hallucinated, and it answered wrong question, and there was a lawsuit, and Air Canada had to pay money for it. This is the reason you need to put some guardrails. The guardrail can be protecting your PII information. Your
chatbot should not leak out any sensitive information to users who are not authorized for that particular information. Also, it needs to handle out-of-scope question. There was a Chipotle chatbot, where you can ask it
to reverse a linked list, and it will do that for you. It is a food ordering chatbot. It should not answer programming question. There can also be a jailbreak. You know, some smart people can get into this, and they can say,
"Okay, teach me a procedure to make napalm." By giving them this fancy story of my grandma used to work in this napalm factory, and she used to tell me the story. And guess what? If you do that,
it will actually give that information to you. This is more like you have a security guard, okay? You have put some kind of guardrail, but a hacker can do a sweet talk. They can influence this person. They can say, "Hey, I'm the
relative of this person who is in the bungalow, and they have given me this authority. You can threaten them." You You can somehow get into this. You can break this jail somehow, okay? Here is the example of how you can set up
guardrail in LangChain. We have a finance agent, which will get you customer information. Let's say you have these three customers, and here is their information, including their credit card. So, this get customer info tool is
specified as one of the tools in your agent. And the way you set up guardrail is by providing this middleware. So, you are providing PII middleware, where you're saying, "If you see a credit card, mask it. If you see email, redact
it, and so on." So, now what happens is, when you say that, "Okay, this is the question. Give me information about customer Krishna." It will give, but it will respect these guardrails. So, if it is a credit card, it will mask it. See,
credit card is masked. If it is email, it will redact it. See, this is how you set up guardrails in LangChain. The next important topic is, how do you evaluate these AI agents? Because evaluating traditional software systems is
relatively easy, because those systems are deterministic. AI agents are probabilistic. You know, they can produce different output for the same input when you call them at different times. So, to evaluate it, you have to
use a different type of approach. And there are three categories of evaluation. First one is functional evaluation, which means, is the answer evaluation, which means, is the answer correct? Is there a faithfulness? Is it
not hallucinating? And so on. Then there is cost evaluation, because your bill for your tokens again can go through the roof. So, you have to make sure your token usage is optimized, and latency is meeting your expectations. And there is
safety eval, where you are checking for toxic output, PII leak, jailbreaks, and toxic output, PII leak, jailbreaks, and so on. LangSmith and Ragas are two of many frameworks that you can use for evaluation. Here is the code example of
how do you evaluate your inventory agent, okay? So, here I'm giving the question and the expected answer, okay? So, this is the expected answer for each of the question that I'm asking. And this client is nothing but a class from
LangSmith. And I'm also defining how do you want to compare expected with actual output because expected output and actual output are going to be different. What you want to do is not the exact string
match, but you want to find out if they have a similar meaning for which you can use things like cosine similarity. So, here I have defined semantic match function. I I'm calling evaluate and eventually it will run and publish the
metric on my LangSmith dashboard. So, it did that here and here you can see that it is doing this kind of similarity match using this GPT-OSS model, okay?
So, reference output and the actual output. And here are the semantic similarity score. One means it's exact match. Not only that, it is showing you the latency. It took 0.56 to evaluate this, okay? Total token usage and so on.
Please check it out. I'm going to provide you a code. You can also compare two different models. So, I built this agent and I don't know which model is good whether I should use GPT-OSS or Qwen. Look at the tool tip here. This
one is using Qwen. This one is using GPT-OSS. And what I can do is I can compare these two different runs. So, I'm I'm experimenting and I am running I'm I'm experimenting and I am running the results. And here P50 means 50
the results. And here P50 means 50 percentile. Basically, 50% of the samples return the output in let's say average 0.38 second. P99 is 99% of the
samples return the output in 0.56 second. And A is your GPT OSS, B is your second. And A is your GPT OSS, B is your Gwen. And you can clearly see that A, which is your GPT OSS, is much better in terms of latency. It is much better in
terms of your token cost and so on. If you want to know how to build production grade AI agents and deploy them through live classes, then we have this live AI cohort which you can check it out. Also, I'm going to attach a PDF with five
sample project ideas where you can build AI agents either using no-code tools or LangChain. Please check it out. Thank you very much for watching. If you have any question, post in the comment box below.
