AI Agents Fundamentals, v2

Intro to AI Agents

Scott Moss
Netflix
AI Agents Fundamentals, v2

Lesson Description

The "Intro to AI Agents" Lesson is part of the full, AI Agents Fundamentals, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Scott explains agents as LLMs that use reasoning frameworks and tools to adapt at runtime, contrasting them with rigid workflows and noting key limitations where agents may not perform well.

Preview

Transcript from the "Intro to AI Agents" Lesson

[00:00:00]
>> Scott Moss:OK, so let's just kick it off with the first lesson, intro to agents. It's exactly what it sounds like. I'm gonna tell you my definition of agents because there really isn't a good definition of agents in my opinion, because I think it's really hard to define. I've asked so many people what they think agents are and I don't think I've heard the same thing twice. But I'll give you the definition that is the simplest to understand and probably covers everything, but I still think it's quite broad.

[00:00:26]
An agent is essentially an LLM that can decide what path to take using a reasoning framework and a set of tools to get the job done. So what does that actually mean? Well, if you think of something like a workflow that's rigid, the workflow had to be designed by someone like yourself. A workflow is a set of paths predetermined in a set of nodes or actions that happen. But you have to design that workflow, and that's the feature of it.

[00:00:55]
It's deterministic. It always follows the same paths depending on the variables that are passed in. Whereas an agent is very similar to a workflow, except the path that it has to take is unknown. It happens at runtime, either all planned ahead at the beginning or it figures it out as it goes in the case of the agent that we're going to be making. So it's a different tool for a different use case. You wouldn't need an agent for everything, just like you wouldn't need a while loop or recursion for everything.

[00:01:24]
If you were going to loop over an array, you probably don't need recursion for that because an array has a finite end. Whereas if you were going to traverse a tree, you don't know the depth of that tree, so you might need recursion. That's a better tool. It's very similar to that, right? An agent is something that we want to throw out a problem where we don't know the vastness of it, we don't know the depth of it, and we need to figure it out as we go.

[00:01:49]
And in addition to, it's different every time that we run, right? We might run it this one time because we don't know how many steps are needed. And then when we run it again, we might give it a completely different objective. So this path is completely different than the previous one. So that was my long take on what an agent is and why you might use it. Other definitions you might hear would be like an LLM with tools.

[00:02:15]
Yeah, that's true, but an LLM with tools doesn't have to loop, so it's not entirely true. You might hear something called an autonomous AI. I think that's just a type of an agent. That just means like there's something that's in the background, that's invisible, that's responding to events and things like that, and not just waiting for a prompt. There aren't too many of those out there that do that right now.

[00:02:39]
AI that can plan and execute. Sure, not all agents plan though, not all of them have a planning step. Some of them just figure it out as they go. And so that's not exactly it. A system where an LLM controls the flow. I think this is probably the best one that I heard because that's exactly it, the flow, as in which direction to take in this workflow. An agent decides that and not a human, and it's figured out on the fly.

[00:03:02]
So, yeah, the best way I can describe it is like the LLM is in the driver's seat, figuring out based off of its environment what to do next. You're not in the driver's seat. You just gave the LLM the car and you put it on the road, and you're still at home, right? That's an agent, whereas an LLM, just a regular LLM would be like you're in the car, but it's giving you voice navigation. That would be an LLM, right?

[00:03:33]
So it's quite different. Cool. I talked about what agents are good at. What are they bad at? Well, anything that requires physical presence, for now, because they are putting LLMs in robots now, so you're gonna have a robot with ChatGPT running on it. So if you thought ChatGPT was wrong, imagine the robot getting it wrong. That's what's happening right now. High stakes decisions without oversight.

[00:03:55]
Yeah, you know, it's kind of like the state of self-driving. Again, another good example. You know, if you have a self-driving car, you still have to be in the driver's seat, you still have to be watching, right? They look at your eyes and things, because you need oversight because that's high stakes. Driving on a freeway is high stakes, it's dangerous. Someone's life could be in jeopardy. So, you know, for reliability, for trust, for insurance, for safety, you still need oversight, right?

[00:04:20]
Creative work that requires human taste, LLMs can't create anything new. They can only remix what they've been trained on, so anything creative most likely will need some type of human oversight, and that human most likely will have to be creative as well. Ambiguous success criteria. LLMs are trained with reinforcement learning, which means they are trained on achieving a goal. If the goal is not clear, you will not have success with an agent.

[00:04:48]
An agent will not do good. You'll just be burning through tokens. So you need really good success criteria. Real-time or latency sensitive operations. Yes, this is somewhat true. It really just depends on what you're doing and what you're asking it to do, and also the type of infrastructure that your agent is running on. I would say this is mostly not going to be true now and into the near future, but in the recent past, this would be true.

[00:05:18]
And then like tasks requiring true reasoning. Yes, agents aren't real intelligence, right? They're just predicting what to do next. So anything that requires like true intelligence, true context awareness, unless you have the most insane engineers that understand AI engineering better than anyone and they build the next AGI agent, you're most likely not going to be able to use an agent to do something that requires like tons of context gathering and human understanding and common sense.

[00:05:49]
It's just, how do you codify common sense? It's really difficult to do that. But ultimately, like one of the biggest failure modes is that like agents confidently doing something wrong, where they don't know that they messed up. In fact, they think they did the right thing. That's a common thing that you'll see. You'll ask an agent to do something. It'll go do something, but it won't do the thing that you thought it, that you asked it to do, but it doesn't know that.

[00:06:12]
It actually thought it succeeded. So this is where you kind of have to figure out like, where's the misalignment? Did I say something wrong? Did I not give the right context, or is this thing just not good? Or a combination of the three, right? And that's some of what we're going to discover in this course. So the first thing we need to understand is the agent loop. We've already seen it with the AGI agent that we're making and the browser agent that I showed you earlier.

[00:06:37]
Everything works on a loop. You give it a task. It thinks about what to do, that's reasoning. If you give it tools, it can look at those tools to decide which one of these tools or which set of these tools are most likely going to help me get closer to achieving the goal. So let me accept that tool. It performs that action and it gets the results of that tool. So like in the case of a web search, it will say, hey, can you perform this web search?

[00:07:03]
The web search gets performed, the results of that get fed back into the agent. The agent observes that results and it thinks again. And then if it decides that I have all the information that I need, I'll go ahead and answer. If it thinks it needs more information, it'll start the loop over again and ask you to run another tool. So that is the agent loop at its most basic level. There's infinite different types of loops that people make, but at the end of the day, it's about putting an agent in an environment in which it has access to tools to interact with that environment, and then it can gather the context that it needs for its own decisions, and then when it feels comfortable answering, given the fact that it has enough context, it'll answer.

[00:07:48]
Otherwise, depending on the model, it could loop indefinitely, it could break, or it could give up, or any one of those things, right? The future of agents, it's very ambiguous, but I think personally I think the future of agents is a combination of all these things, right? Better tool use, longer context. Multi-agent systems, these are like agents interacting with each other to achieve a common goal.

[00:08:13]
Specialized agents, these are things that are like fine-tuned, hyper-trained on a specific vertical, like think like we're gonna put this agent in a doctor's pocket and it understands everything when it comes to this type of disease or this type of medicine, right? Very super specific, very specialized. And then better guard rails because if these things become more powerful, which the trends show that they are, if we don't have the guard rails put in place to protect ourselves and for accountability, then there won't be any trust.

[00:00:00]
So them being that powerful means nothing if we don't trust them, right? So we need better guard rails to make sure that we know that the agent is locked in a safe environment and can't cause harm and the things that matter to us.

Learn Straight from the Experts Who Shape the Modern Web

  • 250+
    In-depth Courses
  • Industry Leading Experts
  • 24
    Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now