Now Playing

CodePath: Build Your First AI Agent

AI at CodePath CodePath Applied AI Engineering
Details
Length
1:31:16
Views
1,090
Featuring
Workshop
Featured Company
CodePath
Published
Nov 26, 2025
Find Your Path Forward

Ready to build your tech career?

AI-native engineering courses taught by senior engineers from the companies you want to work at. CS students and CodePath alumni enroll at no cost.

About this video

Curious about building with LLMs and real-world AI tools but not sure where to begin? In this hands-on workshop, the CodePath team guides you step-by-step through building your very first AI agent using LangGraph, one of today’s most exciting frameworks for AI development.

You’ll learn how to:

Build a chatbot powered by the Gemini 2 API

Connect your agent to databases and external services

Use AI “tools” and function calling

Optimize prompts and responses for smarter interactions

Add conversational memory for more natural behavior

Apply human-in-the-loop controls for complex tasks

Explore advanced LangGraph features for real-world use cases

By the end, you’ll walk away with a working AI agent and a strong understanding of how modern intelligent systems are built.

Transcript

Hey, hey everyone. Can y’all give me a little Zoom reaction wave and stuff? You know what I’m saying?

Let’s see. Let’s see what’s going on with y’all. Good people.

Welcome. Welcome. Oh, the reacts are lighting up the chat.

Oh man, I appreciate y’all so much. Laura, what’s going on, sis? I see you in there.

Seeing all the homies popping up. Nice to see everybody. Thanks to the folks that came with their cameras on.

I appreciate that. I appreciate that. Awesome.

So I’ll give it like a minute or so before we kick start. But you can go ahead join the Slido link. Appreciate y’all being here and yeah.

Excited to exciting time. Exciting time. I had to put the afro beats on.

Y’all know it’s just like got to got to put a little movement into the whole presentation. Yeah, I see the smile. Shine by shine by.

Yeah, you know, I see my boy right there. You see me? See what I’m trying to do here, you know.

All right, y’all. Say I’ll give it one more minute cuz I like being on time. Y’all came on time.

I appreciate y’all being here. Maybe let’s drop in the chat where y’all calling in from, what part of the country are you in? And also I’d love to know what year of school are you a freshman, sophomore, junior year, senior.

Okay. Sh. Okay.

New York. I see my New York people. Oh man.

Damn it. Thank you. Appreciate the cultured man.

Yeah. You know, I’m out here out here trying to do the good work. That’s it.

All right, cool. Let me just pause my collective vibes right quick. Thank y’all so much for being here, y’all.

It is a pleasure to honestly do this work. So much going on in the world, but y’all chose to be here today, which means a lot to me. And you can go ahead and join the Slido link just for a couple interactive portions of the presentation.

I appreciate y’all’s time and your patience. So, we’re going to jump right in with the first, question here. If the folks on the, side can make sure that we drop the link to the slido in the chat in case folks miss it.

Would love to know why did you join this session today? Why would I start talking about myself without asking y’all why you are even here? So, talk to me, fam.

What did you what made you come to get good? Oh, wow. Yeah, you know, that’s fire.

Get my feet wet with AI. Learn how to build agents. Just curious.

Learn about agents. Learn a new skill. Okay, awesome.

Everybody’s like, "We want to learn about agents, Cam." The whole session said, "Learn about agents." And if you don’t teach me about an agent by the end of this session, it’s not a good session. Okay. Got y’all.

Pressure is on. Awesome. Recent grad.

I want to become a Pokemon master. I want to become a stronger applicant. Fire.

That’s awesome. I also inspired to become a Pokemon master. Learn about agentic AI.

Building agents knowledge, learn something new. I love how the slide was given these things at the top like agent AI, right? Y’all trying to learn skills right now.

And what’s cool about this is you’re here because of interest, curiosity, and the desire to get knowledge. Be a go to software engineer. I hear you.

Not to get replaced by AI. Oh, do a hands-on project. Okay, cool.

Well, grateful to everyone for being here. Honestly, like I said, it means it means a whole lot to have y’all be present. And we’re going to just kick this kick this off real quick.

Cuz the time we want to has have as much time to hack as we can. So, appreciate y’all. So, let’s say next next.

Who am I? Right. So, you told me why you’re here and now I got to tell you why I’m here.

So, my name is Cam. I am I do a lot of different things, but I’m very excited to be a facilitator today and support y’all in the process of getting started with building your first AI agents. I think I some folks joined prior to the title slide, but here you go.

Right. If you’re here to build your first AI agent with the CodePath community, you’re in the right place. So, hearts in the chat.

Come on, let’s spam it with some love because that’s what we all here to do today. It’s a collective effort. So, I appreciate y’all being here.

And yeah, so a little bit more about myself. My name is Cam. I am an entrepreneur, a tech entrepreneur.

I’ve started several technology- based companies. I love building software as a service solutions. Started a innovation lab in New York, seven years ago, right after I graduated from school with a CS degree.

My degree was actually interdisciplinary studies. I actually created my own major at school. So I say CS degree but I created my own degree.

It included computer science, sociolinguistics, art, music and entrepreneurship. Funny enough, right? But building technology and learning how to build technology companies was the thing that motivated me the most.

But I also care a lot about education. And so part of my journey, I would not be here today if it wasn’t for my journey as a CS student. Learning like the ropes, right?

Shout outs to any any student here that went to Tus University. I graduated from Tus University, class of 2016. And yeah, I had a I had a very wild ride as an engineer learning for the first time.

I’m from Chicago, Illinois, inner city, and nobody in my family was a computer science person, right? I remember getting our first computer at the crib and I fell in love obviously with the idea of being on the computer, being digital. I was one of those kids that grew up with a lot of gaming consoles.

So, shout outs to you if you were to the child of immigrants that became the go de facto computer person and also grew up with a culture of video games, video games, anime, the Neopet era, MySpace era. Oh, I’m dating myself, but y’all know the vibes. Those are the things I grew up in.

And what what motivated me beyond my time learning computer science at TUS to do this work was really just re recognizing that computer science requires all of us to contribute conversation, right? And I had a really rough time as a computer science student. I’m not even going to lie to y’all.

It wasn’t as easy as I thought it may have been to get into tech. And you know, y’all aren’t here for my life story. If you want to know my life story and ask me those types of questions, you could definitely scan this QR code.

But the long and short of it was I I can vividly remember being in y’all’s shoes as computer science students. And and I remember wishing that I had people who could support me with the right resources and the right knowledge and language to better understand all of the things I was learning. Now just learning computer science was hard.

Imagine trying to get a job as a engineer, right? As many of y’all are doing as well. So, all of that passion, right, for seeing the problem of being a student and being a career seeker and wanting to build things but not knowing how to start, right, all of that led to me wanting to be an educator.

And so, I spent a lot of time after school educating. I’ve led several large boot camps from I don’t want to name all of them, but led several large boot camps in New York. Helped build curriculum for several others.

Spent a lot of time running my own program. So, shout outs to y’all if any of the if anybody here is a former student of mine. You know, you got a special place in my heart.

And you already know that we do this work from a place of authenticity. And last but not least, obviously I’m an engineer. You know, I love hacking.

I love tinkering and I love working with code. But perhaps probably the the reason y’all are here is and I didn’t put this on the slide, but I think the reason y’all are here is because I am also here comes the big the big lightning strike. Probably the the worst AI engineer you know.

I’m going to tell you that right now. I’m going to tell you that up front. I’m be like I’m probably the worst AI engineer you know.

And you probably like why would this person start a presentation about building AI telling me he’s the worst AI person I know? Well, that’s because I believe that now is a good time to be a bad AI engineer. What do y’all think I mean by that?

That’s like, so my like, what is he talking about? Like, what is he talking about? What do y’all think I mean by this?

Now’s a good time to be a bad AI engineer. Mohamad said, "What’s up?" Go ahead, fam. Let me go ahead.

Talk to us. What do you think I mean by that? Best way to learn is to make mistakes.

Can you hear me right? The best way to learn is to make best way to learn make mistakes and the best way to know how to use AI is to use it for the wrong reasons. So now you know what’s the best reasons to use it.

I love that. Maybe not the not maybe not use AI for the for the worst reasons, but I got what you meant. Like we now is a great time to be playing and experimenting with AI, right?

And what I mean by being a bad AI engineer means I’m learning. I’m still learning. A lot of this technology is developing right in front of us, right?

So obviously it’s the best time to be a great AI engineer, right? And that’s our goal is to in motivate everybody to learn as much as they can and get the skills they need to be leading engineers in your own right, right? But at the same time to get become a great engineer, you have to be willing to be a bad engineer for as much as you can and to continue growing and learning as you go.

Y’all agree with me? Hearts in the chat, thumbs up. I see some nods.

Folks like, "Yeah, he’s spitting." You know what I’m saying? I had to say I had to say the real talk first. So that’s exactly it.

Nia, what’s up, bro? I see my peoples in the chat. I love y’all, man.

Thank y’all for being here. Cool. So, with that out of the way.

Let’s talk a little bit about what my agenda is for us today. So, first things first, I want to talk a little bit more about this whole conversation about LLMs. I’m sure many of y’all have heard about LLMs.

And so we want to have a conversation about them. What are they? How do they work for us?

What are some of the limitations that we’ve seen even just working with them ourselves? Then I want to transition to what is lang chain and like why use it, right? And then obviously in order to do that, we want to build some stuff.

So I have some code prepared to help us build our own version of ChatGPT and learn a little bit of that as we go. And then I have some other code that’s going to help us learn how to build our own our first agent. It’ll be a very simple one, but the goal will be for us to get the concepts and hopefully you walk away knowing a little bit more about all of these things.

So, if you’re here to learn and you’re ready to rock with your boy Cam, can I just get some thumbs up? I’m a reactionoriented person. You know what I’m saying?

I’m a call and response type culture. That’s that’s the culture we come from. So, I appreciate y’all lighting up the chat with your love and and the thumbs ups and everything like that.

Cool. So again, before I dive too deep talking to y’all and talking at y’all as professors typically do, what do you know about large language models? What what are y’all already in the loop about?

Talk to me. What what are some of the things that come to mind when you think about large language models or how they work or you know what’s interesting about them? Probability based awesome neural networks tokens to determine the next word.

They’re not always correct. I love that hallucination. I’m new to this.

I love that, too. You see, I put y’all I put y’all’s things anonymous for a reason. So, you could be cool and share what you want to share.

They’re trained on our text and responses. Bad input equals bad output. Enough to be dangerous.

Okay, cool. I love that. Machine learning sophisticated mathematical function that predicts the next word for any given piece of text instead of predicting a single word with certainty.

Oh, man. I lost it. Instead of predicting a single piece of word with certainty, it assigns probability to all possible next words.

These predictions are based on analyzing vast amounts of text from the internet. Man, that was that was so good. I’m like, did the AI write that or did you write that?

That was that the was that the Chad GBT synopsis or was that your synopsis? Whoever wrote that, y’all, you was going off. Pop off.

I love that JSON structure prompting is important. It can be trained. So take a look at what’s coming up on the top.

Y’all can see my screen, right? You can see the like the responses and everything. So, look at what’s coming up at the top.

Data is one of the top words. Word, probability, text, token, prediction, neural networks, neural networks, training, language, data sets, database, models, and algorithms. That’s awesome.

It’s so interesting that the first thing that everyone is thinking about obviously is data. Because the the reality is that without the data none of this stuff would make much sense. So for those of y’all who maybe are new to this, like I’m new to this and still learning, right?

Let’s talk a little bit about large language models at at a high level, right? So much like your colleague said, shout outs to y’all. Right?

Large language models in essence are mathematical pattern recognizers. What that means is a lot of what our colleagues were saying right there’s statistical mathematical know prediction algorithms that allow for us to to mathematically create these these tools that we’re using every day for chatpt how they work in in essence is they take pieces of text that they’ve been trained on and turn them into mathematical representations in what’s called a vector. Vector.

And those mathematical representations are used to run these mathematical formulas to assess proximity or distance in terms of likelihood of correlation for lack of better words. My mathematics people, am I saying that correct? Y’all y’all saw some nods.

Y’all like, he kind of got that. He kind of he kind of hit that, right? So these tools don’t actually know anything, right?

They are inferring things based on the context of what you’re prompting. And I really want to emphasize that word context because it is a hugely important word when it comes to working with this working in this space. How many of y’all the word context you’re like, "Yeah, I know what you’re talking about." you know, y’all ever have that experience where you’re trying to prompt ChatGPT or something to that effect and you’re like, man, I wish that this thing could help me with something and what do you do?

You give it your whole life story. You’re like, Chad, my car broke down on the street and I tried to walk back to the school and I didn’t make it, but then my professor gave me this math problem and it didn’t it ended up working. I tried to do this, this, and this.

You you’ll be telling your whole life story to chat GBT. Y’all know y’all y’all know y’all ain’t Yeah, he’s at that part. That’s literally me.

I’m trying I’m crying. I already know. I And And why do we do that though?

To give it more context, right? At the end of the day, the more you give Chad GPT, the more context it has. The more context it has, the better able it is to formulate a response.

But in the context of what we’re talking about scientifically, the context we’re giving it is also helping it make that pattern recognization even stronger. And it uses these things called tokens to understand the meaning of those things and do that in in that capacity. So let’s break that down in even more terms, right?

So here’s a crazy little graphic that I made. And shout outs to one of my professors, Professor Grider. Really help help my help me in my understanding of all of this and a lot of my knowledge and hopefully the con the conversation of this is easy to follow because I really want the folks that don’t understand this to really follow.

So let’s start with like how do these LLMs work for us. So we’re going to start at top left, right? So imagine you’re an AI engineers.

Your first day on the job, you’re building building your own ChatGPT, right? First of all, you need a model, right? You need these models that are going to be the statistical backbone for what’s going to happen with work with the users that you’re working with, right?

So you’re going to be passing training text after training text after training text into a algorithm to train it to start recognizing certain text in certain capacities, right? And build that that statistic engine of what text is related to what and how do I how can I correlate certain other pieces of text to that text. But it all starts with training.

A bunch of y’all have mentioned training earlier as a key frame key frame when we were talking about what are LLMs. So hopefully training makes sense and y’all have heard of the pro the thought or process about training a model. So someone’s training these models that we’re going to end up working with.

What happens next is that model parses the text that the person’s training it in and breaks the text down into what we call chunks. The chunks essentially are the pieces of is essentially smaller pieces of of data that are going to be be utilized within the mathematical formula of pattern recognition. Those chunks of data that we are that we’re talking about are called embeddings.

So we embed we create embeddings off of these larger pieces of text in order to essentially store them in a database. The database is creating a large storage of all of the broken up text chunks that we’ve saved and later the model is going to wait for input to reference from someone like you. Right?

So you’re going to be sending in prompts text after text telling chat GBT your life business. And after you’ve done that, right, you’re going to it’s going to find that model is going to work to find the most relevant chunks based on what you’ve typed in. It kind of does this vector analysis for anybody that’s interested in mathematics, right?

The mathematics behind AI and AI models, vector analysis, comparing these these vector spaces and in order to find the most relevant chunk. After it finds the most relevant chunk, it then sends that prompt that you sent to it plus that chunk into another prompt that it gives back to something like ChatGPT, which is the interface that you were probably working with and sending your input the first time. What we’re basically doing is passing a note to the AI model from the AI model to Chad GBT that says, "Hey, here was the person’s prompt and here’s the answer to their prompt.

Share it with them." And then chat GBT tells you everything you need to know about whatever you prompted with a ton of M dashes because that is just characteristic ChatGPT right there. Y’all know what I’m talking about. The all the M dashes that Chad GBT just throws in there.

Chad GBT is like here’s your output with a bunch of M dashes. So this is a pretty highlevel overview of like the entire life cycle of like, okay, well, we start by training this data on all of this text and then breaking that text down into representations that we can use in order to mathematically correlate between the text you’re telling me and the text I’m receiving. What is the relationship between these things in order to then give back the most relevant piece of data to the prompt?

Let me take a look at the chat. Can’t find a response to this right now. Will this workshop be recorded?

Yes, for everybody is asking. The workshop is being recorded and I’m glad that y’all are here. Splitting the data is the correct term.

Yes, Courtney, look at you, sis. I see you. Courtney was like, I got to just post it so Cam knows I’m here.

Yep. And you paying attention. We love to see it.

So yeah. And in a lot of capacities, right? What we’re doing here is mathematically representing an awareness of these pieces of text.

So, that’s what’s happening at a high level. Now, how many of y’all you aspiring to be an engineer that can do all of this stuff, right? You could be you could be honest.

You could raise your hand. You know what I’m saying? Some of y’all smiling like, "Nah, I ain’t trying to do all of that." But some of y’all are, and that’s awesome to see.

So there’s a lot of different parts that go into being an AI engineer. That’s one of the points I wanted to make today. And there’s a lot of room for all of y’all to be AI engineers.

Because as you can see, there’s a lot of mathematics. There’s a lot of predictive analysis. There’s UIUX and the and how we’re creating the structures that we’re are going to take input from a user and pass it to a model.

There’s development and the applications that will basically run the databases and run the servers and run all the systems that are working under the hood for the infrastructure. There’s a lot of different ways u to be an AI engineer. So grateful to see everybody that that’s here and and wanting to make that a part of their journey.

Awesome. So cool cool. All right.

Just making sure I don’t miss anything in the chat. So next things next. Let’s see.

I think right now I wanted to give this context because I want us to understand how much goes into the process of building out these AI systems, right? And so I want to introduce us to a framework that’s going to make your life a lot easier as you’re trying to be a developer in this space. And that framework is called Whoops.

It’s called Langchain. And lang chain is allows us to basically it creates pre-built architecture and integrations to all of the large language models that you probably are familiar with to help you get started quickly and seamlessly incorporating LLMs into your agents into your applications. So how many of y’all have ever like worked with like a AI API like you’ve built you put ChatGPT into an application that you worked on or you know something to that effect?

Anybody in the chat? What was the thing you built? Yeah.

Cool. I use link chain for an AI summary generator. Remember, come on.

What’s up? What’s happening? Focus app.

Yeah, love it. Yeah, I built AI rag application. This, that, and the third.

Yep. So, Daria, great question. So, I’ll address that real quick.

So, one of the questions Daria just asked was, "You said sends to Chad GPT, but isn’t Chad GPT an LLM? It sends the user an input to itself." ChatGpt is an interface allowing us to work with the the large language models that Open AI have created. So, it’s a it’s an interface that allows us to work with their models.

It itself isn’t the model if that makes sense. But, Sajid said that in the chat, man. Shout outs to Sajid and everybody in the in the chat right now.

Cool. So, if you are interested in building AI applications, one of the most important tools and frameworks to learn is going to be Langchain. It’s going to make your development process that much simpler and that much easier because of the fact that it handles all of the things that you’re hoping to do with your with your applications.

I realized one of my slides is out of order. So, I’m going to skip to the one that I need you to see for the sake of for the sake of this, which is this one. Right?

So, all those things that I just showed you about what we have to do, right? Lang chain does a lot of this stuff for us. So, you don’t have to build it from scratch.

And I think that’s really amazing because it makes your life a lot easier as an engineer. You can focus on the pieces of the AI integration that you want to focus on whether it’s training your own model or you want to focus on the application layer or you want to focus on the agentic layer which are some of the things that we’re going to talk about in the next few minutes. So that said I want to start off with our first little collab.

I got to stop sharing for a second to switch it over but actually let me present it and then so y’all can get the QR code. So, I realize now everybody’s on their computer, so QR code is not going to work. Let me send the link to y’all in the chat, to a Google Collab that we’ll use to work walk through building our own little version of ChatGPT if that sounds cool to y’all.

Cool. So, let me do this and I’ll stop sharing so you can see my lovely face in HD real quick. And we are going to get this link here.

Sorry about that. I was like, I don’t know why I expected everyone to be able to get the QR code. That’s funny.

Come on, Cam. What you thinking? Okay, cool.

So, I’m going to drop the link here in the chat. Oh, you know why I did it? Cuz there’s some folks that are on watching the stream and things like that.

You pulled your phone out. You should keep the link. That’s true, right?

And we’ll send the links over as resources for everybody that registered and registers with some calls to action later in the program. But there you go. There’s the link.

And if the ops team homies can take note of that and hold on to it for me, that would be great in case folks ask for it. When you go to that link, it should take you to a Google Collab that should look a little something like this. You should have viewer access, so you can make your own copy.

That’s what I would do if I was you. And, I’ll walk you through this. That’s what we’re going to spend a good amount of our time today on is walking through this little tutorial I built and answer questions and kind of trying to go go at it a little bit together.

So, quick logistics check from y’all’s side. Are you able to make a copy of the Google Collab? Thumbs up, thumbs down.

Okay, I see some thumbs up. That’s fire. That’s all I need to see.

Anybody having some trouble? So cool, Jessica. So, the reasons that I’m giving us this collab is to avoid having to do instructions in Windows or Mac.

So, we can do it in one place and it’ll run and we don’t got to think too much about operating systems. But, just so you know, we’re going to be working with some Python code. Using what’s called a Jupyter notebook.

And Jupyter notebooks are just a gives us the ability to run blocks of our Python code in a more structured document-like structure. I didn’t even tell y’all this. I’m a webdev by trade.

So learning all this AI stuff is real fun because it requires you to learn so many do new things. I I knew a little bit of Python. I love working with Python on small automation scripts and stuff like that.

But for learning AI learning and working with Langchain just for folks to know it their libraries that they have are structured in Python as well as in JavaScript and TypeScript for any JavaScript devs out there too. Cool. Reme, thank you so much.

Just click copy to drive. Yes, webde for the win. You built different like a webdev.

A air, you know what I’m saying, bro. I just do what I got to do. Yes, please make a copy in your own drive.

You can put it in GitHub if you want to later, but it’s up to you. Can you get a free Open AI API? Hey, not from me, but from somebody.

All right, cool, y’all. So, here’s what we’re gonna do. Let me give you a high level for those of y’all who are like, Cam, you know, just give me your Jupyter notebook.

I’m going to run it up. Go ahead. You can run it up.

But for th those that really need to understand every aspect of how this is going to work because this is your first time, right? This is also for first timers as well. What we’re going to be doing is building our an essentially a chatbot.

You could think of it kind of like chat GBT. We’ll have an interface that will allow us to pass in some prompts and we’ll also use that same interface in order to in order to send back responses from an AI from a model a LLM. So, that said y’all are probably familiar with all of the different varieties of LLMs that are out there.

I’m going to stop sharing real quick and I’ll come back. Y’all are probably really familiar with all the different models out there. What is your favorite one right now?

Just drop in the chat. What’s your favorite AI model LLM that you’re using? I see some claws.

So, hey, we’re seeing Claude just Hey, where word to our future sponsors? See a lot of Claude. Seeing a lot seeing a lot of co-pilots.

Seeing a lot of cursors. Gemini, Gemini, Gemini, GPT, GPT, GPT. We got everybody.

So, word to our sponsors. We got everybody. You know what I’m saying?

We got everybody out here. Claus King. That’s funny.

Perplexity. I love it. So, there’s a wide spectrum of different AI providers that you can work with.

And I think it’s cool to experiment with all of the different ones. They all have really amazing tools that you can use to enhance your workflows and things like that. They did not pay me to say that, but it’s true.

So playing around with all of the different ones are cool because you can start to see nuances in the ones that you use. Some folks started naming platforms. So, I want to call out be careful about the difference between the model and the platform.

So, cursor is a platform, right, that allows you to interact with specific models. Copilot is also a platform that lets you or program, right? It’s sitting inside VS Code or whatnot that lets you work with different models.

So, next time you open up Copilot or Cursor, take a look at what LLM you’re using. Most times they’re using Claude or they’re using GPT or they’re using Gemini and or other other models that maybe you are using inside of there as well. Awesome.

Cool. So that said, where So where we at? Right.

So I’m assuming that folks are doing this for the first time. And most times if you’re like me, the thing you hate the most when you’re starting to build some stuff out is having to hit a payw wall. Can I get an amen?

You know when they’re like, "Oh, give me your credit card and then you can work, right?" Nah, we ain’t playing that. We ain’t playing that out here. So, I wanted to figure out how to get you started.

So, the point of my time today is to help get you started so you can tinker as much as you want and know, "Oh, wow. I can do I can do this because you don’t you’re not going to be limited by cost or any other sorts of restrictions in getting started." And so, because of that, I purposefully chose to use Google Gemini as the model. And I saw some folks in the chat were talking about Gemini.

But the reason I like to use Google Gemini for some of this is because of the fact that it is free to get started. And so I wanted to make sure that we can all get started there. So that said, first things first, if you take a look at the actual Jupyter notebook, it kind of goes over this like some of the stuff we’re going to be doing, but it starts talking about Google Gemini.

So I wanted to address that for the folks who are like well why are we using Gemini? Can we use GPT? Yes.

And the answer is with lang chain you can use whichever model provider you want as so long as you can get your API keys for those particular models. This tutorial is written for Google Gemini but we could very easily extend it to be for GPT or any other model that we want to try. So the code is written in Python.

So I’ll just scroll down a little bit so you can see a little bit of what a this Jupyter notebook is going to have in store for us. And we’re going to talk through it. But you don’t need to know u too much Python to get started.

If you’re a dev that’s not familiar with Python, we’ll try to explain it step by step. And I love everybody hopping in in the chat and helping out because it’s it’s very helpful to see that collaboration. That’s what CodePath courses and things are all about in the community.

So, first things we’re going to do is we’re going to get a Google API key. So, the first thing I want y’all to do if you’re going to follow along, like I said, if you’re cool to just breeze through, go ahead and c I’ll catch up with you in a little bit. But if you are following along with me, just let’s take it step by step.

First thing we’re going to do is we’re going to go to Google AI Studio so that we can get a Google API key to use for working with the models here. So to do that, the link here should take you to Google’s AI studio. And for me, I’m already logged in.

I should log out so you can just see a little bit. So it’s gonna, prompt you to get started, right? So, you can go ahead click get started and create an account really fast.

I already have one. But you can create an account. And of course, the security is like securing.

So, let me let me get that together. Just log myself out the thing I need. Let’s do this.

Let’s do my pass key. So, yeah. Sign up.

Sign in and and let me do this so it’s not too crazy. And share my pass key. Continue.

Sorry y’all. Gotta do the gota do the logistical login. All right.

And so when you log in, you can see on the left hand side you’ll probably see this dashboard and stuff going on here. And what you’re going to want to look for is at the bottom something that says get API key, right? So click this thing that says get API key.

And what you’re going to want to do is create an API key for yourself, right? So, when you create an API key, it’s going to just ask you to name it. You can name it really whatever you want.

Typically when we do when we work with API keys, we want to name this something descriptive because you might create multiple keys for different parts of your applications, right? So, you can name this whatever you’d like. You could say CodePath workshop API key or something to that effect.

It really doesn’t matter what you name it. And then it might ask you to create create or choose an imported project. If you don’t see any here, just create a new one real quick.

I made one called CodePath. But this will just be to link your key to a specific project. So once you do that and click create key, you’re going to see another popup that’s going to get you the ability to co copy your API key or you’ll see it registered here in this little table.

So you can go ahead and click copy API key here as well. So you’re going to want to just get the reference to the key and that’s step one. And I’ll show you what we’re going to do next right after that.

Let me take a look at the chat. Why can’t I access the studio? Yeah, are you getting any specific error?

Please let us know anything but try GBT it. Service not available. Here’s the Google API key link.

Thank you to the folks sharing the resources. Appreciate y’all. Cool.

So again, make sure you if you are able to log in to Google Studio, you will be able to get the key. It’s just aistudio.google.com google.com. And once you sign in, then you want to look on the dashboard down to the left, something that says get API key.

It’s right over here. Copy this. Create this API key like I just mentioned.

And then we want to copy the key. Let me just get a pulse check. Thumbs up if you have the key ready to go.

You’re ready. Rock and roll. You’re like, Cam, come on.

Let’s get it going. And thumbs down if you’re having some trouble. It’s all good.

No need to no need to stress. If you’re having some trouble, please drop the errors or whatever you’re finding in the chat. And if you’re just here to vibe and you’re like, "Yo, I just want to listen because, you know, you got a smooth radio friendly voice and I just want to learn from you." You could put a heart in the chat so I know it’s not a it’s not personal.

You’re just sitting here learning. You know, that’s cool, too. I got it.

I understand. Cool. John, I see you, bro.

Nice to see you, bro. Thank you. Welcome.

All right. So, for the folks who have this API key, this is our first major step. Good milestone.

We’re going to go back to our to we’re going to go back to our Jupyter notebook here. And what you’re going to want to do is you’re going to want to save this API key u securely, right? And so to do that, Google Collab has a really cool integration so you can keep your keys safe.

If you click this little key icon here on the left, it’s your application secrets. So things like a API key are things you want to keep secure. And you don’t want to give it to your friend.

You don’t want to give it to your mom. You don’t want to give it to somebody emailing you telling you that they’re your friend or they’re your mom and they want your API key. If somebody’s asking for your API key, tell them to take you on a couple dates first because nah, you want to keep that safe.

You want to keep that safe. So and and for good reason, right? Because if somebody gets access to these things, they could be maliciously using your keys for all types of stuff, right?

Sometimes these keys are tied to things like billing and other re other things that you don’t want to get into the wrong hands, right? Courtney, go ahead, sis. I see you come off mute.

Okay. So, recently for our software engineering capstone project, we used a bunch of API keys and we didn’t know that you’re supposed to hide it. So, do we hide it in the git nor and what file specifically do we like is the API key stored that we have to hide?

Yeah, that’s a great question. So, I’m so I’m going to answer your question, but just give me I’m going to have a roundabout way of ask answering it, but I’m tracking the question. Okay, so first thing I want to do is let’s hide the key we have.

And so for those of y’all following along and this is what’s going to help you if you want to go f further on to the the rest of the Jupyter notebook this is really the only step you have to do synchronously right first thing is click secrets here and then click create a new key for yourself and this key I called Google API key all capitals and underscores again it doesn’t really matter what you call this but later in the Jupyter notebook it assumes that you have something called Google API key, right? And so if you name it just like that, Google API key, it will work by you just pasting the value of your key and and saving and just that’s really it. Once you paste the value of the key and save it, everything else in the notebook should work.

So again you do want to make sure that this toggle for notebook access is on because it is important for us to pass the secret values into our notebook here. But yeah, so for those of y’all trying to save this, click the key, put type in Google API key just like this one here, all caps and underscores, and then paste the value of the key you copied from Google Gemini, from Google’s, API studio, and, save that key and then you should be good to go. The only other thing I’ll mention before I go back to Courtney’s really amazing question is in order to run Jupyter notebooks, right, you can read, do all this stuff, but when you want to run each block, you click this little play icon and if you see a green check mark, everything is good.

So, if you want to move a little further faster, go ahead and just run the notebook. Take a look, make sure the check marks are here, but take a look at all of the the the writing that I put in here. You know what I’m saying?

Like please read the stuff I put so you can learn a little bit and as I catch up feel free to ask some questions in the chat. Now Courtney I want to go back to your amazing question sis because you know just takes bravery being asking a question. So hiding API keys is such an important process in production environments because of the fact that you want to keep things safe and secure.

To your point you’re asking where is the best place to hide those keys and the answer you already answered it. So there’s two parts to the to the hiding of the key that you have to understand. The first part is how do you pass a key without explicitly saying here’s the key, right?

Like cuz sometimes in your code you could just copy and paste the code of your key in there, but that’s not really best practices. So what we typically would do is put the key into our operating systems environment. So that’s a key word you want to no pun intended that’s a that’s an important word you want to take note of is environment right and the environment is essentially works in your operating system to pull pieces of data from your operating system a lot more securely a lot more securely than we normally would.

And what the git ignore file that lets you do is define maybe a file where you can put all your keys in an environment file. And then when you’re working on a project, you’d have this environment file that has all your keys. And obviously that will work if your application can pull the the the secrets from the environment.

But later you might want to push that to GitHub. And so typically what we use the git ignore for is to hide that environment file so we don’t put it on GitHub. So the the environment file would run locally on your computer or run in a server but it won’t be on GitHub and so the teams will have a more secure way of passing those variables to one another.

But it works with both an environment an environment file typically and then the git ignore file on top of it. Does that make sense sis? Just want to make sure you know.

Gotcha. Great question. All right cool.

So let’s get back to business. To defeat the hunts. Y’all know where that’s from.

Or am I dating myself? One more time. Y’all don’t know.

Sean, they don’t even know what I’m talking about. They don’t even know where that’s from. They said somebody started typing in the chat.

I’m crying. Why y’all disrespecting me like this? I’m just joking, fam.

I’m just joking. And obviously it’s getting a little late. My computer went to dark mode on me.

I’m like, "Oh, child." Okay. Scream a little less loud, computer. Let’s see.

One second. Just cuz it’s a little easier to see. So now that we have our API key installed, the first thing we want to do is we want to install a few packages that are going to allow us to work with lang.

And these packages are the first block here, right? In Python, you use the command pip install to install different packages. In JavaScript we use Node.

If anyone’s using Node. And there’s a lot of different languages that have different package management systems, but Python, we use pip. So, this line is installing a number of key packages that we’re going to need to use to build our little chatbot.

So, first one is lang chain obviously. The second one is a another tool that lang chain has created to make building agents a little bit more robust and simple at the same time is called langraph. This third one is a is a lang chain wrapper for Google.

So we can call the Google generation genai models. And this fourth one we technically don’t need because we’re not going to use it in this example. But this is another lang chain framework that we might want to use in a in a different project or you might want to use in a different project and I’ll talk to you a little bit more about that later on.

Next you’re going to see the API key step. Right? So in this step this kind of assumes you followed the first step I told you of saving your stuff inside of the notebook for reference and Courtney to your question we are using the OS operating system environment to pull those API keys.

So this is an example of us using Python to pull the data from our environment files and environment variables securely. In this in this little block of code is doing a couple things. One, it gives you the opportunity to it gives you the opportunity to just paste your API key if you wanted to, but again that’s not the best practice.

So what it does instead, and technically I could just comment this out. What it does instead is it uses the environment fair file in order and in order to pull it from the Google Collab notebook. So that’s what this line is doing.

And it’s pulling that API key. And then last, it just checks if we have it. And if we do, it tells us, hey, you got it.

If you don’t, it’s going to tell you, hey, u make sure you put the API key. So again, to run this Jupyter notebook, we just want to press the run icon. I just realized I didn’t install my packages, so I should start up here.

You want to run them in order just because it’s each one is assuming something different. So first things first, I’m going to run this one to install my packages. Make sure that that’s all good.

And once it’s done, like I told you, you’ll see a nice little green check mark. And you can hide the output by clicking this little arrow here. But once this finishes, we should see a nice little green check mark.

And obviously it’s taking a little time because there’s a lot of packages, but it’s going so good. Yo, y’all know how it is. Like when you’re coding, you’re like, "So long as I don’t see an error, I feel good." Then you see an error, you’re like, "Ah, whoops." But yeah, so long as you don’t see an error, you should be good.

Let me check the chat while I got some time. Wooy woo. So, folks didn’t know what I was talking about.

Got to warn that the notebook isn’t authored by Google. It’s authored by me. So, you can just make a copy and you should be good.

Project creation failed. Please try again later. Getting this error when trying to create the key.

Try to create the project manually. Okay, interesting. Jason, let’s see what’s going on there.

Getting an error while trying to create the key. Did you make a copy of your own version of the Jupyter notebook? And then I’m looking at some other folks says unsupported cell type.

Hey, if you see that unsupported cell type thing, it it was just because when I wrote this Jupyter notebook, I did it on my computer as a re as like markdown, but then when I moved it to Jupyter Notebook, some of the markdown didn’t convert. So, you can just double click it and you’ll see the text that you are meant to see. Don’t worry about it if if that shows up.

That’s not a problem. This is still running, which is so bizarre, but maybe it’s cuz a lot’s going on right now. But let me just check in on y’all.

Did it get a green check mark when you ran your first step? It’s still running. Sean’s like, "No, it’s still running on my side." Anybody?

No. Thumbs up, thumbs down. Okay, I see I see a couple folks said they got it. Could be because it’s we’re all on it and doing all this stuff.

You know, we’re breaking the internet. We’re we’re on we’re on some other stuff. If it’s prompting you to restart, you can refresh.

Dar, I see your I see your message about the key. If it’s taking too a crazy amount of time, you can refresh and see if that helps. I’m looking at my thing and it looks like it it’s just taking some time.

So yeah, let’s let it take its time. And there you go. So it took a minute.

It took two minutes, but you can see here the little green check mark. So, it should work. So long as you get your API key together, it should work.

But let it run. It’s going to take a take a minute. On a side for secrets, how you add the key.

Remember, just click this key, put your secret, and you should be good to go for the rest. You could use this in VS Code if you’d like. Just make sure that you open a virtual environment and install the same stuff.

You can copy this Python code and run it in VS Code or locally if you’d like to as well. That’s that’s totally fine. If you want to do that, what you can do is, you could either run this as a Jupyter notebook in VS Code or you can just copy each block, and, run the Python file that you create in order to do that.

Somebody said, "Copy the project in your drive. It’s much faster." Thanks, Ta. Appreciate that.

Cool. Yeah, I was going to make us write code, but I can’t assume everybody knows Python, so don’t worry about it. Awesome.

So, after you get the installation, the install, and this is writing code, right? You you didn’t you didn’t need to write it, but you got to run it, right? You got to run some code.

After we get the installation steps and resources together, the next step, like I said, is running to just get our API key set up. And then the third step here is when we’re going to start actually working with the lang chain tooling, right? So what langchain gives us is a couple of different ways to work with models.

Langchain itself extends a lot of the models that you’re used to working with and provides certain classes and functions and things to work with those models. It also gives us another tool called lang graph that allows us to build models out in a graphlike context. So, when you’re trying to build more sophisticated models, this graph-like structure becomes really helpful because you can essentially say, hey, for every starting point of my, my mo my agent, here’s the different pathways it can take.

U, we’re going to focus on a simpler version of running the model here for this particular example, but but I just want to give the context. So this next bit is just us getting some of these tools into the notebook that we’re going to reference later. And it is going to pull all of those tools from lang chain and then we are going to create our chatbots structure of messages.

So, one of the most important things to understand about how ChatGPT or any other interface allowing you to send messages to a model works is by sending what are called messages. Now, messages are both your messages that you’re putting and sending to the chat, but also its messages back to you. And what’s important to understand, one of the fundamental gotchas about LLMs is that they don’t do a good job of remembering messages and remembering the history of messages.

So what it does is every time you prompt the model, you actually send the list of messages from before you were prompting it back into it with whatever new messages you want to send as well. So in this case, what we’re doing is creating a Python class that’s going to define our messages that are the history of messages for our conversation that we’re going to pass into our model for it to do for it to understand a bit of the context of of what we’re talking about. So this is going to allow us to create that class.

And in Python classes are object-oriented programming. So we can reference this class later in our code in order to do some things. Now this is the part that makes lang chain really phenomenal is the fact that you don’t have to do too much to connect into a chat model.

Just by defining whatever model you’re working with right in this case we’re using Google but in other cases you could use chat GBT or other things we can create a model and connect to a model in one line of code right so this init chat model function is a function defined in lang chain that will allow for us to initialize a chat model in a single line using the name and provider so as you can see you could extend this to use whichever model provider you’d like and so long as you bring in lang chain’s corresponding library for that particular provider. So we’re going to initialize this chat model with Google Google Gemini. And so we’re going to use that Google Genai package in order to connect into the Google Gemini model.

And the last thing we’re going to do so now we have a model, right? And the model is connected via lang chain. But what we want to do now is create an actual application that will run to be our chatbot and use to create our own little ChatGPT like structure.

Sorry, I’m taking a look at the chat seen a lot of different things. So now that we have this connection to the model, we’re going to create a nice little chatbot function that is going to do really one thing. It is going to invoke from the model a new state of messages.

And the messages are essentially going to be part of part of what we send to the generate the Google genai model with the prompt history of what we are telling it to think about. So it’s going to take all the messages from our conversation. It’s going to send them over to Google Gemini.

It’s going to get back a response and it’s going to return the response in a format that we can use with lang chain and return that message. So this is just a simple Python function. So if you’re thinking about like where do I plug into this as an engineer, right?

Knowing how to write basic functions still matters, right? Because these libraries require you to still write your own wrapper applications on top of whatever agent or whatever things you’re going to work with. So in this case, we’re creating a function for this chatbot.

It’s going to receive the state of our messages and it’s going to pass the messages down into the into the model when we evoke invoke it. Invoking it is basically like sending it with a prompt and we’re going to return whatever responses we get back from from the model. So this is just a Python function that we’re going to call using lang chain.

So, this step eight is interesting because what this is going to do is is this I put this code in here to prepare for even more examples of how you might want to work with link chain in the future. And I’ll show youall some of those resources as we end later today. But what we’re doing here for simple terms is creating our first little agent.

And this agent is going to have really one specific responsibility, and that is to focus on being a chatbot. Right now the chatbot functionality is only here to allow for our agent to start, run the chatbot, and then end. Later when you want to make more sophisticated agents, what you can do is you can use some of lang chain’s tools like lang graph to create more possible pathways for your agent to follow.

And what that is allowing you to do is create multi- aent models or multi-pathways for more sophisticated agentic programming. But for right now this is some good starter block code if you want to add more edges. And so if you think about it as a graph of like a treel like structure, your agent can follow different pathways along a graph and you can define those pathways kind of like if you’ve ever worked on like logical flows or like I know like on type form they have this thing where they’re like if somebody does this go here, go here, go there, right?

Kind of like if else conditions but here we’re giving just defining the pathways that the that the agent can follow. In this particular example, like I said, it’s not doing anything too robust except for just starting and being a chatbot and ending. But in this example, we can continuously add more edges.

Which we’ll try to do a little bit later if we, don’t run out of time here. So, first thing we’re doing is building a flow for our agent where once it starts, it’s going to run our chatbot function, then it’s going to end. So, that is all those first default steps.

And then the last thing we want to do is invoke our chatbot with a message from our with a message from the user. So in this example, we’re creating a function in Python that is going to allow us to work with the same chatbot we just defined and listen for any ex any events that take place after the the graph gets started. And we’re going to be passing in a a number of messages but starting with one simple message u from the user.

In this what we’re doing here fam is we are passing one message into the we’re passing a message into the model for it to then do all of the things that we provided here where the chatbot will allow it to run and take that message and then send it to the LLM and then return any responses that it gets. So in this example here, what you can do is you can create whatever message you want in this example text here. So where it says send message, you can really type whatever you might prompt AI for.

So let’s say why should I become an AI engineer today? Sorry, fam. And so I’m going to do this and we’re going to go ahead and run this.

And as you can see, it’s taking the user prompt. Well, why should I become an AI engineer? And it’s going to go ahead and reach out to the model.

And as you can see, it’s going to return some of the information coming from Google Gemini directly. So all of these steps are basically what’s happening under the hood of an interface like ChatGPT where instead of you having to instead of you doing it through an interface right we’re getting all this as data. Now, if you imagine yourself as a front-end engineer, right, somebody with webdev chops or somebody with mobile chops, you could build a little application wrapping this so that a user can pass in a message.

It might run something like this under the hood and get back the data that then you would put in the chat window for chat GPTA or things like that. So, it really isn’t too many lines of code. We created a function that is going to run to ga grab our data from the from the the lang chain application we created this block of code it looks a little crazy but what it’s doing is it’s looking at all of the the stream of messages and for all of the values inside of it it’s going to create a new piece of data and for first it’s going to show the user’s message right and Then it’s going to show the stream of data from the assistant which is the response we got back from langchain.

And so that’s what gives us this little chat interface here where it’s like oh why should I become an AI engineer? Well become an AI engineer today could be a really smart career move right high demand job security lucrative compensation. I don’t really see too many M dashes.

That’s how you know this is Google Gemini not ChatGPT. So, I’ll pause real quick and let folks kind of catch up here and I’ll take a look at the chat real fast. We got a little bit more time, so that’s cool.

If you want, you can continue to send messages just with this send message function now. So, now you have your own function that will work just like ChatGPT would in that allows you to send a message and get back a response. All here.

One of the other things I put in this notebook is if you wanted like a more ChatGPT like structure and you wanted like an interactive session. When you run this particular block of code, it will run some Python code to collect the input from you and say hey tell me about I haven’t done this. Let’s see what it says.

Tell me about CodePath and and what is it going to say? Let’s see. It takes a minute because remember it has to reach out to actually to Gemini and get some information but hey here’s a various aspects of CodePath right close the skills gap increase diversity of tech improve career readiness it offers a variety of courses and here’s the features from benefits free for students Robbie I’m sorry I’m getting at your spiel early bro but you know I had to had to show them that Google Gemini is trained on our data u but so yeah So you can continue to work with this prompt if you want to stop the agent.

You can just pass any of these terms quit, exit, Q or buy and it will stop. So if I just type the quit here, it’ll stop. So part of the reason I wanted to give youall this Jupyter notebook is so that you can continue to work on this and you know obviously hack on this on your own accord.

But the biggest things that I want you to take away from what I’m talking about because I know it’s a lot of code and you’re like, bruh. The first thing is, with that Google Gemini API key, you can now work with Langchain on any projects that you want that need you to connect to a model without necessarily needing a credit card. So, first things you had to do to do that was install those libraries.

Second thing was to get the actual API key which is like a critical part of the process because we have to connect to those providers in order to use their models. Somebody in the chat mentioned something about using your own and yes you can work with lang chain on your own models as well. It’s a little bit more sophisticated than what I could talked about today obviously but you can and totally should try to play around with it if you’re interested in something like that.

All of these libraries and frameworks like even lang chain have a lot of different pieces of code to how they work, right? And it can be overwhelming when you’re staring at all this code and you’re like, "What does this do? What does that do?

What does this do? What does that do?" And I want you to know that all of these libraries and tools can be explained also in the documentation. So, if you go to Langchain’s website, which is just langchain.com, they have a lot of documentation about all of these things and a lot of resources that you can use to continue to work on things like building out other types of agents.

So, somebody mentioned rag or retrieval, augmented generation, or SQL, like being able to pull data from a database. There’s a lot of different types of things you can build with Lang Chain, but I just want to point out the goal isn’t for you to learn all this in one sitting, fam. It’s just to tinker and be a be curious.

So, so long as it’s making you interested in some capacity, then you’re doing it right. Everything else will come from you just spending more time reading and learning about all of the pieces of the documentation. And maybe taking courses like the ones we have that might help you in the process of understanding more of these structures.

But the big thing here is to be able to play around. So, quick show of thumbs. How many of y’all were able to get a message sent to Google Gemini and a response coming back down for you?

Nice. And I appreciate y’all mention that in the chat. Go ahead, Taj.

Yeah. So, basically what Lang Chain allows you to do is host like an API that I guess communicates with Gemini’s I guess LLM model. Yeah, you could think of it like langchain is you could think of it like lang chain is an interface that you can use in between your code applications and these models and it provides an interface that you can use to work with those models invoke them run and also do a few other things which we’re going to talk about with the last little bit of time that we have here as well.

Okay all right thank you. No great question bro. Go ahead mom.

Oh my bad. I gotta I gotta give you the permission to take the mic. You go ahead, bro.

Oh, I can’t hear you. Oh, now I can hear you. Not Yeah, you gota just talk a little louder.

Wait, give me a second. No, no problem. Hear me now?

Okay, perfect. So, I love the I love this workshop by the way. It taught me a lot.

Well, a lot of the things that it went in my head was I don’t know if anyone ever heard of N. Yeah, it’s a chat a it’s a AI chat agent automation that’s like makes it very simple. There’s no code or anything like that at all.

And I was wondering like with any you could self-host AI chat bots off your computer. I wanted to ask is there like any way you could create your own API key without needing to borrow from Gemini or Chic or Claude? Like is there there’s is there a way you can self-host a sustainable API key?

So what I think you’re trying to ask is there a self is there a way for you to self-host your own model that you can use with your own stuff, right? And like instead of rely on Gemini or these other things, can you use your own? And the answer is yes.

You can have a local model running on your computer or whatever or in the cloud or in the server and connect into that particular model using an API. What you would be doing is building your own server that exposes those connections and in whatever capacity you want to work with it in your other applications. So if you’re running it locally, you can probably connect to it just with some local connections to the running application.

But if you are running in the cloud you can expose certain parameters from that particular running instance that you would pass in other applications and lang chain provides resources for you to do that as well. So part of that langraph framework that they have also lets you deploy your a your models and your agents after you’ve written the code out. So it’s easier to put onto servers and things like that.

Cool. Taking a look at some of these other things. Awesome.

Salmon said, "Name the secret key CodePath." so I’ll just go back through that real quick and then I want to give y’all actually one more deep dive while we have some time. That said, give me one second and give me one second and let’s see. Okay.

So, for those of y’all who are still struggling to connect here, the things we want to do is first we want to, the first thing we want to do is with that API key, right? You got to make sure that whatever you name this key inside of the Google Code Lab is also called the same thing up here. So, if you named it different, you’re going to get an error.

And that’s important. What you named it in Google Studio doesn’t really matter. So long as you copy it and you bring it over and you put it in this notebook by clicking the key and type Google API key just like this and save, you’ll be you’ll be okay.

And the rest of the notebook should work. Folks that are getting errors with the notebook, try refreshing because it shouldn’t if it’s working here, it should work for you. That’s the point of the notebook is that it it should just run on your thing.

Some tips folks mentioned was getting it on saving it to your drive makes it run a lot faster than trying to just run it as the copy. And you can also try if you want are a little bit more used to working with Python, writing the code manually in a Python file and running that Python file on your computer. But yeah, y’all.

So, I want to switch back to one other thing here with the time we got left and obviously I know that I know that this is like a real deep dive real fast, right? So, this was the link to the go the collab we had originally. So, let’s talk a little bit now that we’ve kind of built this little chatbot and you I know you all have some experiences working with things like chatpt and other stuff, right?

What are the limitations that come up with working with ChatGPT or things like that, right? And y’all give me some thumbs up or some reactions if you’ve ever had these experiences that you see here on the slide, right? You know, ever have this issue where you try to reference something and Chad GBT just doesn’t know what you’re talking about and it’s like I don’t know what you’re talking about, right?

And what does it do? It starts making stuff up. Chad GBT the worst liar in the world.

Chad GBT like yeah that that happened. You’re like no it literally didn’t. What are you talking about?

Right? So, have y’all heard of hallucinations? How do I say hallucinations?

Hallucinations. Yeah, I see some nods, some things in the chat. Right.

So, a hallucination is the model is is the interface in the model trying to give you an output that doesn’t quite correlate to what it is that you’re trying to infer. Right? So, there’s like a mathematical mismatch and then it’s trying to just fill the gap with whatever it can.

It’s just talking too much, right? The other limitation is that and that takes place let me say that takes place because the model can only infer what it was trained on and what it has context on. So whatever you told it or whatever it was trained on is where it gets these embeddings that allow for that mathematical representation to work well.

If it doesn’t have something that’s a good embedding that that aligns to it. Some there’s been a lot of research talking about why hallucinations take place. And one one study was that when they trained the model they did positive and negative reinforcements.

So it told the model every time something was every time it gave back something it gave it a positive reinforcement which made those models start to actually just decide to give you something instead of just saying hey I actually don’t know right so a lot of this comes back to how is the model trained like and how will it respond if it if it doesn’t have a quite a good correlation. So for my data driven folks who care about the algorithm, there’s a lot of research going into things like that. How do you improve model performance without hallucinations by using different statistical models for like how you train the actual model itself.

So just something to to note for y’all y’all data nerds out there. You know what I’m saying? It’s okay to be a nerd out here.

We we love it. The second big problem, right, is the lack of long-term memory. How many of y’all are using Cursor right now?

Or using any AI dev tools in your workflow. Right now, I use cursor. I used to use GitHub copilot, but I like cursor a lot.

So, how many of y’all have had this experience where like you know cursor, you’re working in a chat and then you got to go to a new chat and it’s like doesn’t remember anything you’re talking about, right? Or you go to chat GBT and you go to a new chat GBT window, it doesn’t remember anything you’re talking about. There’s a lack of long-term memory.

Now, Chad GBT as an interface has tried to solve that with things like remembering stuff and every time it does it, I’m a little scared. It’s like I’m adding this to my memory. I’m like, Chad GBT, nobody told you to do all that.

You know what I’m saying? Like, Chad GBT try to remember my government name and all types of stuff I don’t wanted to know. Do yourself a favor, go to Chad GBT and be like, "What’s my name?" It’ll freak you out.

You’ll be like, "What? I didn’t want you to know all this stuff about me." but the long-term memory piece is actually a really challenging problem for developers in the AI space. And so there’s a lot of systems and tools built to actually extend your ability to work with these AI models u with memory.

The third and this is the where I want to culminate today to continue to peique your interest is there’s not any inherent access to other data or systems. So the only data that the model will get was what it was trained on and stuff like I said before. But what if it needs data from somewhere else to actually function, right?

That fundamental question is what we are talking about when we think about extending the model and with to be an agent and be more agentic. In that vein, a lot of what we’re trying to do is in that vein, a lot of what we’re trying to do is give the model pass more context into those prompts. So, just like we were writing the prompts and it was giving us a response, we want to enhance the model’s ability to get us back a a good response for whatever prompt we’re asking it.

And this takes place because if we ask it something it doesn’t know, it’s going to not know what to do, right? So, what we’re talking about is how can you improve the performance of a already working model with the ability to give it more access to data or systems. That, my friends, is again what lane chain helps us with.

But that’s what creates this idea of agentic programming. So when we talk about agents, a lot of what we’re talking about is the LLM, which we now know we could connect to very easily with lang chain and then this idea of what we call tools. Tools are essentially these extended functions that you can write as a developer software that you can write that gives the the model more pathways to reach out to for for other information.

If you ask it a particular prompt that it doesn’t know the answer to, like how many orders are in my database, right? How how is it supposed to know, right? And what would it do?

It would probably try to make something up if it doesn’t know, right? That’s what typically if you ask a question like that to ChatGPT, how it would perform, right? And just to just to show you that real quick, I think I can do it real fast.

Let’s see. I’m going to go to ChatGPT real fast. And I had the prompt for myself so that I could remember to write this for y’all real fast.

Let’s see. So I’m going to go to ChatGPT and I want to sorry, trying to find it. We want to now I lost my prompt.

I’ll get back to this because I want to show you all a prompt that will prove this point, but I’ll have to find it in a second. But before because I I’m being mindful of the time, I want to give y’all one more resource. But be but in order to do that I’m trying to explain this whole idea of agentic stuff.

So really what agents allow us to do is extend our knowledge of extend our knowledge and extend the models knowledge in a sophisticated way. So we’re able to say things like okay well take that model we already have at base and give it more extended capabilities. The tools are essentially just functions that we can give it for that that sake.

What we then do is tell the agent, take time to reason and figure out what you need to do and give us a good answer. So y’all might notice now that Chad GPT’s latest models do a lot of what they call thinking, right? And before it gives you a straight answer, it’s thinking.

This is what I’m talking about with this reasoning loop. So this the new models are now getting more and more tools that allow them to spend time trying to identify what is the best approach to get you a good response. And so the tools now become a very important part of the process.

So just like before, fam, I have one more collab for y’all. You can scan this QR code. I forgot that I can’t do QR codes, but if you want to save it for yourself, scan this QR code real quick.

And I will, while that is up, I will get the actual link for those of y’all who need it really fast. Grab the link and put it in the chat. So, I have one more Jupiter notebook for the homies, because you know your boy Cam, he cares about y’all.

So, I put it in the chat down there. So, this one is a little bit more focused on tools and agentic stuff and it’s a little simpler, but also something worth noting. So in a second I’ll go over it and I just think I realized I think I realized exactly where I put my my note before.

So this actually would be a cool thing to end on if I can get this for y’all. Okay, cool. I got it.

I got it. I got it. Awesome.

So let me go back here and everybody got the link so that’s good. And like I said, we’ll send we’ll send it out also for everybody as well. So, no worries if you don’t have it.

So, what I want to do now is real quick, I want to go to ChatGPT to show y’all what I was talking about with the tools, but I just lost ChatGPT real fast. Okay. So, let’s do this and then go back to Zoom to share.

All right. Cool. So, I’m in Chad GPT fam.

Y’all been in Chad GPT before. So, I just want to give you a highle overview of what I mean by tools, right? So, here I have this little agental prompt.

I’m going to copy it in here. So, cool. So, imagine if I was prompting Chad GPT, right?

And I told Chad GPT something like, let’s see, we have a database called my store with an orders table, like a table of data, right? And I tell chat GBT, you have access to the following tools. One called run query that runs a Postgress query and returns the result.

It accepts an argument of a SQL query as a string. To use a tool, I want you to always respond with the following format. And it’s just a little bit of JSON for the name and the argument of what it is that you’re that you’re showing.

Right. How many orders do we have? Right.

So, what do you think Chad GPT is going to respond with? What do y’all think? Right.

If I push past this prompt in there, what we think is going to happen? Random stuff, right? Most likely, right?

So, let’s actually see and test and see what it does. And it’s running. It’s analyzing.

It’s thinking, hey, it doesn’t have run query. Use the provided tool. Incorrect.

And it’s like it’s trying to run instead of using your provided tool. Here’s the correct tool call. So, here’s what it actually gave me.

It said it returned the exact tool analysis that I told it to do. Right? So, it it was going to try to run some code, but then it returned this tool because it’s it realized, hey, I don’t actually have the ability to do the thing you’re telling me.

You told me I have this tool that I can run that is going to allow me to get the stuff I need to give you the right response. And I just got to tell you I want to use the tool. So, I’m giving you this.

Right? So, here it’s giving me this JSON saying, hey, I want to run that query. And I need here’s what I want to do.

I want to count all the all those orders from your store. For those of y’all that don’t know, this is SQL. And this big format here is JSON.

Which is a data format that we use pretty commonly in different applications. But now just take a look at what’s happening here, right? We’re extending Cad GPT’s capabilities by telling it about the existence of certain tools.

Thumbs up if y’all see what I’m talking about. Now the model can do a lot more than what it might have done on on its own. Right?

So the fundamental thing with tools and with agents is defining these sorts of tools out for your a for your model to use in different contexts. So I’m going to breeze through real fast this second collab just to give you context of what it’s doing and how you can use it. If you use the f the first one, right, you should still have your Google Collab key saved to your environment.

That’s the only thing you need in order to run this one. First one obviously is going to install the same packages. But because this is a different collab, you have to do that.

The second one, same thing is installing the operating system and making sure that we are able to get the Google API key. And then this third one is actually running some code to create another agent. Now this one is a little bit simpler so I can actually breeze through this a little bit easier.

It’s first step is pulling all of the functions from langchain to build the agent. But the second and most important thing is defining a system prompt. So system prompts essentially are our ability to tell the agent how to infer the context coming in from our different our different prompts from our user.

So in this system prompt it looks very similar to what I just put in ChatGPT right. You are, but this one says, "You’re an expert weather forecaster who speaks in puns." let’s change that to raps. Because, you know, I like I like raps.

And the the the as a oops, who speaks in raps? And you have access to these tools, right? Get weather for location.

Use this to get the weather for a specific location. And get weather location, use this to get the user’s location. If a user asks you for the weather, make sure you know the location, right?

We’re telling the agent and we’re telling the model to be very specific. If you don’t know, use these tools. Sometimes you have to be this explicit for it to know.

If you don’t know where they are, get this user location tool to get their location. Right? So, this system prompt is going to tell the model to be very specifically to use our tools.

La. Lastly, what it’s going to do is create a couple of Python classes. One for the context and then two for the tools.

Right? So these tools as you can see are just functions. They’re just Python functions, right?

You can have a tool for anything. Any API you work with, any logical thing you want to accomplish, you just create a tool which is a function that you can pass to your model to use. Later we’re doing what we did in the last example where we’re initializing our chat model with Gemini.

And what we’re able to do after is create the create the opportunity for our agent. So here we have our agent being created with that system prompt certain tools and the model. This is the important difference from what we did first to what we’re doing now.

Now that we have this agent that has the knowledge of the tools, right? We’re doing the same thing we did before invoking that agent with a message from the user which is what’s the weather outside and we’re passing in a particular context the user ID being one and that is going to create a structured response. Then we have another response where you can send more stuff.

But when you run this what you’re going to see that comes back is the model is going to take a look at where the user says they are. And the reason it knows or says Florida is if you see this whole idea of user ID one we have a function in our tool that says hey if the user doesn’t give you a user ID we’re going to return Florida right otherwise we’re going to return San Francisco right so us passing this context into the agent will change how it performs so I want you to try to play around with it but what’s cool about this is with this collab and the last one you have two collabs set up to just continue to tinker with the AI stuff. And I’m excited to see what you continue to build with it.

Obviously, we wish we had a little bit more time to keep hacking and tinkering. I hope you enjoyed, the time today. But before we go, in order to talk a little bit more about how we can continue this relationship of learning all of this stuff, I want to turn it over to a member of my team at CodePath, Robbie, to share a little bit more about CodePath and how you can continue to get involved with some of the work that we do.

Robbie, I’ll turn it over to you, bro. Perfect. You can hear me, see me, all that good stuff.

Yes, sir. All right, cool. Well, first of all, give it up for Cam.

That was amazing to crank that out in less than an hour and a half. You freaked it. Great job.

Show him some love. Give him some emojis. That was so so cool.

Like we’ve been sharing, there’s going to be resources for this afterwards. We’ll be sharing those out for you. So definitely make sure to revisit them, come back.

But I wanted to talk specifically about what is the next step you can take from this session and kind of keep this going. And I know we’re sharing out LinkedIns and stuff. I’m going to share some helpful links as well.

So, make sure you’re keeping an eye in the chat. But if you’re newer to the space, if you’re not already familiar, first of all, welcome to CodePath. If you’ve never taken a Code class before, actually quickly, just by like thumbs up React, who’s enrolled in CodePath or has taken a Code class already?

Just curious. Okay, nice. Definitely some folks in here who know.

I actually saw some people being like, I have to hop for my CPATH class. So, good to know that there are some folks who are aware, but if you’re not aware or if you curious about what is new at CodePath, CodePath is a nonprofit organization and we run free technical courses for college students. So, if you’re currently enrolled in a school in the United States right now, Codepath is a place for you.

We have a variety of topics and a variety of levels. So, there really is something for everyone here. And I’m here really to kind of promote what’s going on for the spring term.

We have four principal pathways. And our pathways at CodePath are really kind of like the learning journey. Within each pathway, there’s usually a couple of different levels of skill and readiness within each pathway.

And as a student, you’re available to take as many pathways as you want. You can combine them. You can stick to one pathway, explore, but really really good options to actually be exposing yourself to better tech skills.

I know that many of you are probably CS students, so you’re deep in the weeds with discrete math and calculus and data structures and doing all that really, really fun stuff, but we want to give you ways to actually apply that in real time, kind of like you did tonight. And so, a lot of our courses are actually project based. Excluding our technical interview prep course, which if you’re someone who wants to be a software engineer, that’s definitely the pathway you should check out.

But, as far as the spring cohort goes, our applications are open now for all spring classes. They are first come, first serve. So, if you’re already thinking this something you want to incorporate into your spring schedule, absolutely start applying.

The sooner you apply, the sooner you do your pre-work to get into the class, the sooner you can be accepted. And again, these are no cost, totally free if you’re a student in the US. And we’re happy to provide these directly to you.

I will say kind of compared to what you did tonight, probably one of our most, in demand classes that we’re seeing right now is our applied AI pathway. And so, we’re actually launching this for the first time ever, which we’re super excited. We’re starting with a applied AI for engineering course which is AI 110.

And essentially in this class you’re really going to be focused on project work. So a lot of you are asking how can I keep this going? How can I add this to my LinkedIn or to my resume?

This is the way you do that. Take this intro class. It’s really designed to help you integrate AI as a development partner but also a product feature in the course.

So that’s things like chatbot projects summarization tools autodocumented assistant workflows it’s you know really really comprehensive in terms of what types of projects and actually culminates with a big final capstone and so most of our courses are project based so if you are looking for a way to add more specific AI skills and technologies to your resume and to your LinkedIn this is the way to do it. As far as the course structure goes all of our classes are 10 weeks long and they’re virtual. So just like this, you’re logging on to a section every week.

You have your instructor who’s an engineer. You’ve got assignments and projects. For the AI class specifically, a lot of focus is going to be on things like generating code with AI, debugging, rag, all that great stuff.

Some things people are asking about here. So definitely would encourage you to check out our website. I’m going to drop in the chat right now a couple helpful links.

One of them being a direct link to that pathway page. So explore that pathway, check it out, see if it’s a good fit for you, and I’ll also link the application there as well. Again, these are totally free resources for you.

Check that out. We also have our technical interview prep course running again for the spring. If you’re a software engineering focus student, if you want to become a software engineer for your career, this is a class to take, but we’re also running things like web development and cyber security pathways as well.

So, lots of really great options. I don’t have enough time to go into all the details for all of them, but just know that they’re all 10 weeks long, virtual, and free for college students in the US. So, always happy to chat more.

Cam, I’ll turn it back over to you for a final close out. Thank you so much Robbie. Obviously y’all CodePath is here to see y’all succeed.

You know we do a lot of work in all of this and it is always meaningful to see all the students. So thank you to everybody that stayed to the end. I put my LinkedIn and my contact at the beginning slide.

So I’ll just share it one more time for anybody that wants or needs help after you as obviously you’re going to continue hacking on this stuff. But I just want to tell y’all again, there’s it is a good time to be a bad AI engineer. And I want you to keep that in mind because, you know, now more than ever, we need people like you taking risks and obviously, learning as much as you can.

So if I can ever be helpful in your learning journey, feel free to holl at me. Here’s my email. This QR code goes to my LinkedIn.

And I’d love to be a a helping hand. And, if you learn something, just give me some love in the chat or just some reactions. I love seeing that folks came and learned something.

That’s really the point of us being here today. And so I want to thank you for your time and yeah, have a wonderful evening and I hope that everybody has a remarkable