{
  "video_id": "6vkmNxpRMJw",
  "channel_slug": "techsimpluslearnings",
  "channel_handle": "techsimpluslearnings",
  "title": "Text to SQL AI Agent - Build a Complete Task Manager App | Python + LangChain + SQLAlchemy + Groq",
  "duration_seconds": 3718.0,
  "url": "https://www.youtube.com/watch?v=6vkmNxpRMJw",
  "upload_date": "",
  "transcript": "Hello everyone, my name is Prateek Mishra\nAnd welcome to Tex Plus Learnings. Today we\nA very interesting and amazing\nThe project is about to be built. So\nBasically today we are going to build ai\nPower task management applications. One\nAn AI agent that can handle user queries and\nReal-time SQL queries to text\nconvert it into real time performance\nCan. And whatever your task is,\nCan manage. Right? so let me show you\nFirst, that's what exactly we're going for.\nTo Build It Today. Then we will build it\nFrom a Scratch. Ok? So This Is Our UI\nDizz right. So we basically build the UI\nWe are going to use streamlets\nFramework. Right? Streamlet Library of\nPython. Ok? And it says AI power\nTask Management and Subtitle Segment Manage\nYour Task Using Natural Language Meaning\nSQL Alchemy ORM plus Lingchen plus\nGrok. So we also use SQL Alchemy ORM\nwill use it and also understand how\nExactly it works. Ok? De Lachan\nThe framework we're going to use to build\nThe AI ​​agent and Grok we will use to\nUse the LLM API and LLM Models OK\nNow how it works first example is\nLet's ask the question, list all my tasks.\nSo whatever tasks are available to you, they will be\nWill show it for you in the form of a table.\nOk? Now if I say that our learn\nZen wala task is in progressive status\nis in. And I want to say that I have\nCompleted this task right? So what are we\nWill you say? We said I have\nCompleted\nMy JNAI\nCourse.\nSo Can See This? This is telling you that the\nYour task is to be done, he marked it.\nIs. Done. Ok? Ok. Suppose we have another\nLet's run the query here to create a\ntask called watch movie at 5 pm with high\nPriority and Due Tomorrow. Right? Ok.\nSo here I want to say that\nWhatever will be today's date, from that date to the next\nThis date has to be considered as a due date.\nRight? Okay, let's try to run this.\nYou can see that it has created a new task.\nWhat is Watch Movie at 5 PM Status?\nIt is pending. What is priority? Hi\nIt is a priority. And the due date it\n26 considered automatically. Even today's is\n25th March. Right? Amazing we have. So beans\nKind of project we're going to build today\nExactly from this crash. So I hope you are\nExcited to build it. If yes then let's\nStart. Okay, so let's go to VS Code.\nWe have created a folder here.\nOpened AI Task Manager. Correct\nIs? And we have a file\nRequirement.txt file in which we have all\nThe required packages which we need for this\nWe have done everything we need to build the project.\nThey are already defined. Ok?\nWhich ones do you want? Estimate for UI.\nLung Chen. Lache is our framework that allows us to\nWill help in building agents. Correct\nIs? perfect. Lungchen Crock for us Elda\nThis will help you connect to the model. Correct\nIs? We will also use the lung graph.\nTo have the memory we have when we now build agents\nIf you do it, you will also have to store memory.\nAnd we will use the Lanagraph SQL Alchemy\nIs ORM right for our SQL database?\nAnd dot nb will be useful in managing\nfor virtual environments and you can say a\nEnvironment variables ok done let's go\nFirst of all, you will create your virtual\nHow can we all help the environment?\nKnow Nothing New Python h n m v en\nV ENV runs. Like you do this\nYou will run the command, your virtual\nThe environment will be created. here like\nThis env folder. This needs to be activated\nSo what is the command? You can tell me.\nWhat will we write here? ENV WIN END\nActivate.\nDone. So this is how we can create our virtual\nYou can also activate the environment.\nNow first of all I need to install these packages\nI have to do it inside my virtual environment.\nYou can also tell me how to do it.\nPip\nInstall Hfn R Require Right So\nRecord any packages you have added in txt.\nAll of them must have been configured by us.\nWill be set in virtual environment. Correct\nIs? And it will be installed basically not\nSet. Ok? Ok? so now after\nInstalling this, now we need to understand that\nWhat will be the structure of our project? Correct\nIs? So understand that first. See if we go or\nLet's create a new file.\nReed Meat\nOkay, and here we'll make this our own now.\nJust for Understanding Purpose\nWhat exactly we're going to build is fine.\nHere Then We Will Build It From Scratch\nokay okay first of all we'll have a\nUI Design Okay now to UI Design\nWhat if the UI design allows the user to\nHe can ask questions and we can answer them\nWhere will you have to bring your back end system i.e.\nIf we have to send an agent then we will do the UI design.\nFor the build we will create a file\nI will create an app with the name dotpy, it's correct.\nNow what will the fpy file do? Whatever the user\nIt will query till the fpy file\nWill come. But fpy file needs an agent.\nBecause who generates the answer to the question?\nWill you give? The agent will generate it and give it. So we are a\nAgent py will create the file. And We\nNo Agent Means What? LL.M. Models. Ok?\nAnd then what is needed? Tools. It means\nThat we also have to create tools. Now\nWhat will the tools be? Consider it close.\nTools mean such systems or such other\nWorking functions that perform different tasks\nCan perform. Now in task\nWhat will happen? Task Basically whenever we\nTalking about SQL, out of four\nOnly one task is possible. CRUD\nCrowd operations as we speak. either\nwill be created, read, updated or\nIt will be deleted. It will be one of these four. You\nYou can either create the task, read it,\nWill you update or delete it? So these four\nTo perform all four tasks, we need\nFour different tools will have to be defined\nWhich the agent will know about. Its\nMeaning we will have a file and tools\ndotp. Is this clear till here? Yes. finally\nThe tools will perform whatever card operation\nTo finally save the operation, perform\nTo do this we need a database. Right?\nOk. So we will create a new file for the database.\nWill create. We will also give it a name.\nDatabase dotp. perfect. So overall, if we\nIf we understand then we should include these four in our project.\nThere should be files. So let's make a forest\nBy one. Ok?\nSo what will we do? Look, if you want, forest\nYou can also make it by one and if you want\nAll four of us with a single command\nCan make. So we would have made it one by one.\nAre. f dot py is your first file. Correct\nIs? What will the second file be? Agent Dotpy\nWhat will the third file be? The third file will be\nOur\ntools.py ok and the final file will be\nWe will have database dotpy\nDone, okay, and whatever code we will do, we will reverse it.\nFirst we will define the database.\nthan we will have tools than we will\nhave agent and finally we will have appy\nFile Yes Agree Yes Now we do it\nStart it up, skip it\nLet's clear it and just remove it\nAnd finish it so we have complete file is\nReady to write our code.\nOK [nasal sound] so now\nWhat will we do? First we will write database.\npy file, okay so what?\nWe will write it here first.\nfrom sql lcm import from whom\nWe will have to import one.\nto the create engine. What is the use? I am everything\nI will explain now. Ok? Just us first\nLet's import it. Ok? then we\nWill import the columns. because we\nA table needs to be defined. Ok? Fine.\nThen which ones in the column after the columns\nWill it be typed? So we will have one type\nInteger. One type will be our string and\nOr fine. nothing. We only need two things right now\ntill. Ok? Then what will we do? then we\nSomething else will have to be imported. that is from\nSQL.RM. With SQL's ORM we\nWill import. Who will they import?\nSo first we will import declarative\nTo the base. Ok? And finally to the session maker.\nSession Maker helps us create DV sessions.\nWill help. Ok? Is it so? Yes. Now\nWe need data first.\nBase URL. Ok? So now understand one thing\nbe careful. We can add any database to the database.\nYou can use the URL. We are working with PGSQL.\nYou can also use it. Ok? We are using MySQL\nYou can use it. Whichever SQL you use\nTo do this, you can do it through SQL Alchemy.\nYou can connect. Right now we are for this\nFor this project, we are going to use Squte 3.\nBecause it is light weight and hum without\nInstallation also we can install this sqlite3 database\nYou can use it. Ok? But in the future, if\nYou want you can improve and you can just\nReplace the database URL from sqlite3\nTo your PGSq database. Right? Ok? Fine.\nSo what will this URL be? So this URL\nwill be ours\nSQLite\ncolon triple slash we're going to put here\nare then2S dotdb what is the name of our file\nwill be tdows dotdb perfect perfect so\nThis is our database URL, now what?\nFor us to do, we must create.\nan engine for this database URL or you\nThis is how you can call this database URL\nI want to connect it with my DV then how?\nSo we will define a variable\nEngine Equipped with this too. Ok? engine\nEqu to create engine. and in create engine\nWill you pass it? Simple nothing but\nDatabase URL. Done. Ok. finally we are one\nWe will define the variable.\nsession\nOr we will define a value. local\nSession equals to session maker. Inside this we have a\nWill pass the argument. bind equal to\nengine. That's it. This was our only job.\nWhat did we do? We have added the database URL\nA connected through the engine. and whenever\nWe will need the database URL, we\nA session from the local session name variable\nWill create it for a temporary basis. And\nThat session maker connects us to that database.\nHe will do it for a time. as long as we need\nIt is for the time being. Dun Dun.\nNow what are we to do now? Now we\nYou will have to define a class here which\nWe will name the class BaseClass. One\nWe'll define our base class here.\nWhich will be connected to the declarative base\nAnd there is nothing to do here, just pass it.\nNothing but what we inherit from this class\nTo do this we created this class as base class\nOkay, okay, now the whole game is very\nIt's going to get interesting here now.\nYou have to define the schema of your table.\nThe table that will be created in our database\nWhat will be the schema, then how will it be done, very easy\nHave We Will Simply Say\nClass\nWe created a class called To Write To and\nFrom whom will you inherit it? Inherit from Base\nI will do it. Ok? Now the first target\nThe table that will be created in my database\nWhat will be the name of that table? So how to define\ndo? underscore underscore table name\nunderscore underscore equals to what name\nDid your own give it? Toos. Whatever you want here\nIf you want to give any name, you can give it here.\nOk? Done. My work is finished. Yes.\nNow let's create some columns. So the first column\nWhat will happen? ID. we all know. So\nWhat should be made of the ID? a column\nHave to make it. Ok? And what is the type of column?\nwill be? The column type will be\nInteger. This is the same integer that we got from the top.\nHas been imported. This is the Integer class\nRight? So what did we pass here?\nInteger and do they work like primitives?\nWill he? Yes. This works like a primary\nWill do. Ok? And is this auto increment\nwill be? Yes, there will be auto increment also. Because\nWe never create IDs in the database ourselves.\nDo not create. it should be auto\nIncrement. Right? Until then we don't have to\nSpecifically configured. Right? Ok.\nperfect. perfect. Now let's create more\nDefine the column names. How can you define\nAre? So what will be the first column? Title and\nWhat should the title be? Our title will be\ncolumn. Ok? And what should I pass in the column?\nWill you give? What will be the type of the column? string\nwill be. very good. and how much in the string\nDo you want maximum character? 200\nCharacters. Ok? Perfectly fine. What else\nShould it be? Nullable equals to false. Its\nThis means that any time a row of the table is created\nWhile doing this, the column Title should never be null.\nCannot be done. If null, create that row.\nIt will not happen. Dun Dun.\nDescription Equals to Hum Quickly\nLet's create a column and what will we pass?\nwill pass the string. Ok? and how much\nWhat will be the maximum description? 500 categories\nThere will be a description. and by default we pass\nwill give a blank string. Ok? Fine.\nOne will be status. Status is also a column.\nwill be. What will be the type of the column? string\nwill be. end string could be maximum 20\nCharacters. very good. and default default\nI will pass the pending. Ok? And\nWhich ones could it be? Aribal\nThe pending one was passed. But who else?\nCan there be status from? So one of them is ours\nwill go to pending which will be by default. Second\nWhat will happen? In progress.\nAnd what will be the third one? It will obviously be done.\nNo question arises in this. Ok?\nDone status. What should we do now? What\nDo we have to set its priority also? Yes\nIs it low, medium or high? then do it\nLet's take it.\nPriority Equals Two column. column type\nWhat will happen? String. And maximum in this\nHow many characters will there be? 20. and default\nWhat will be the priority? So the default\nWe give priority to this as medium.\nWe do not know at all whether this\nIs it low or high? Ok? So medium. And\nWhat are the possibilities? So take one\nMight be possible.\nWhat could be the other one? Medium and finally\nWhatever happens will be high. Ok? here we are\nI am also writing for the future\nReference. Ok? It is not compulsory that we\nI have to write this. Ok? [laughter] Then\nFinally we need the due date. and dew\nWhat will be the date? There will be a column. and in the column\nWhat will you be storing? We string\nWill store. We can even date here if we want.\nCan store. It's not a big deal,\nRight? But we'll store the string for now.\nHave been. What else will you pass? 20 more\nWhat will you pass as default? Blank\nString. And what will happen in the end?\nCreated at. When was this created?\nNot the created date, we will name it\nCreated at. Ok? And the same code in this too\nwill be. It will be exactly the same code. And what is this\nCan be nullable? Cannot be done. So this\nWe will pass Nullable Falls. When created\nIf it happens then the created date will be created, right?\nYes it will be. Dun Dun. Perfectly fine. now now\nWhat is there for us to do? We are going to use a method and\nWill make. Whenever we have a class\nIf there is an object, then inside that object there will be a\nThere will be a method which we will call break. Now Today\nWill you do it? I have a\nwill return the dictionary form. This is us\nIt is going to be very helpful in the future.\nHow to see and understand, we have defined a method\nDefine CurryToDict. Now what's in TooDict\nwill be? Argument. Ok? what is there in it\nwill be? First there will be self because our\nSelf must be coming near you. Ok? and this\nWhat will the return do? This will return a\nDictionary. Ok? Is it so? Yes. Let us go\nLet's return. What else but a dictionary?\nWill it happen? So the first one will be the ID. Ok? And\nWhat will you return in the ID? Self Dot\nID.\nThere is no question in this. So when if you\nIf this is clear then everything else will be clear.\nWhat will happen to the next one? Title and what\nWill you pass? Self dot title. Ok?\nWhat will happen next? Next's our\nThe description will be done.\nWhat will happen? Description. and the name of the key\nWhat will the value be? Self Dot\nDescription. Ok? very good. Next Key\nWhat will happen? Status. And what will you pass?\nInside this? Self dot status. That's it.\nSo on, what do we have left now? Ah\nThe discussion took place. Priority remains.\nOk? You would have passed your priority also\nAre. What is priority and priority?\nWill you go? Self dot priority. Ok? finally\nWhat remains? Due date. So what is the due date?\nWill be done? Self Dot Due Date. and last\nWhat remains is created at. and what\nWill we pass here? Self Dot\nCreated at. That's it. Our complete\nThe database schema is already created.\nReady. Now where do we have to jump?\nOn tools. Because we first need to define\nTools will be required. And tools are the ones\nThis is a complex section where we need to\nIt is going to take time and we will have to understand things.\nThere will also be. Once It's Completed Everything Is\nEasy, even quite easy. Right? Ok? Come on then\nLet's jump to our tools section.\nSo what should I do? Well, we now\nOne more thing needs to be done in the database which is\nLast one. Ok? We need to define a method\nWill have to do it. Define in it DB. This method\nWhat will she do? Basically this method will work on your database\nIf the table is not already created in\nWhich table tous would not exist\nShe will create the name, okay it is like this.\nYes, so what will we do here?\nHere we will call base which we have named base.\nI have created a class of okay fine so base dot\nMeta data dot create all and create all in\nWill you pass my pass in Create All?\nWe'll make our engine that's it right now\nWhat will be the profit from this that the base name\nJojo classes will inherit from the class\nWhich tables in the class will have names if they\nTable names that exist in our DB\nIf you don't do it, it will be created.\nThat table. Dun Dun. Where will you jump now?\nWill jump into tools. Ok? Perfectly\nFine. Perfectly fine. So let's make it now\nWhat first? to the tools. Ok?\nSo to make tools, we first need to\nThe thing will have to be imported. Firstly I\nMust import from blankchain.com\nTools Import Tool. What will this tool do?\nThe tool is a decorator that can be used on any of our\nConverts Python functions into tools.\nWhich the Luck Chain agent will be able to use. Correct\nIs? Well, is it like that? Yes. give us again\nNeed from database import. which we\nCreated a file named database. By this we\nWhat will you import? Firstly we\nwill import local session so that we can see the sessions\nBe able to make it. Ok? And then we import\nWe will do our class called To Do where\nOur schema is built on. Done? Done. End\nFinally, we will use another library which\nWe will need from date time import\nDat Time That's It Let's Start Building\nA tool so how many tools would we need okay\nIf so, we need four tools CRUD\nCreate Todays Read Todays Updates for Cred\nTools and Delete Tools to Make One\nBuy one okay okay so define like this not like this\nCreate to\n[nasal noise] OK. Ok?\nAnd what will we put @ this? of the tool name\nDecorator. Ok. Now we have to understand that create\nWhat are the arguments in the method named to?\nWill you come or should you come? So whenever I get a task\nWhat is the first argument to create?\nwill be? Title by default value and its\nWhat will be the basic type? String. Correct\nIs? perfect. what is the next argument\nwill be? Description.\nAnd what will be the type of description?\nIt will be a string. and by default value\nWhat will happen? It will become string. Correct\nIs? Perfectly fine. next argument\nWhat will happen? So try running it from your database.\nWhich columns have we created? Title,\nDescription, status we do not define\nWe will do it while creating. Why not\ndo? Because while creating status\nIt is confirmed that it will remain pending. Right? No One\nis going to come and say that I have watched the\nMovie and Just Market Is Completed.\nRight? Because we need to create first.\nRight? Ok? So what will be next?\nIt will be a priority. Then there will be a due date. Correct\nIs? Let's go. So what about next?\nWhat will be the defined variable? Priority.\nWhat should the type be? String. And\nWhat will be the default priority? Medium. Ok?\nPerfectly fine. Even if you don't pass\nWill work. But we have to receive it. end final\nWhat we will have is the due date.\nWhat final will we have? Due date.\nWhat will be its type? String. and bye\nWhat will be the default? Blank string.\nPerfectly fine. Yes. Now we just\nThere is nothing to do here. Create to\nThe logic of do has to be written. But write logic\nFirst we need to pass the doc string.\nIf you remember we discussed it multiple times\nIt is done that whenever we make a tool\nIf so, what do we have to pass?\nWe have to pass his dock strength\nOr a description of that tool has to be given.\nWhat exactly this tool is going to do\nDo and the problem is going to be solved. Ok?\nSo let's do it. What will you do first?\nWe divide it into multi lines here.\ndo. And here we will write create\nand save\na new\nTo do task. This is our title and\nYou can tell me about the working of this particular\nTool. Now we have to define this here also.\nIt will happen that whenever any Eldam model is\nIf you want to call the tool, then which ones?\nArguments must be passed. Right? So we\nLet's make one here. Ek Hum Title\nDenge extracts. Will enter. a little further\nWill move. What other keys do we have?\nAre? The first is the title. Ok? So in the title\nWhat will you pass? So we have to write that\nWhatever happens here will be the sort title for\nThe task. And this is required. What does it mean\nWhat happened was that whenever someone called the LLMS tool\nIf he does, he will have to give the title first.\nOk? Amazing thing we have. Now the rest\nDefine it quickly. Ok?\nDescription. What will be the description?\nOptional\nDetailed note of the task. Okay, very good.\nWhat will happen next? Priority. So\nWhat will you pass on priority? priority\nLook, it could be any one of three. Take\nmedium\nWill not say end. What will you say? And high.\nIsn't it? What else should we write here?\nDefault. And which default one are we passing?\nAre? By default we are passing Medium.\namazing. And what is the last argument?\nwill be? The last argument will be the due date. And\nWhat will be the due date work? is optional and\nWhat will we write here? Due date. Right?\nOff Task\nTask. Right? And give an example. So\nHow will you give an example? E.g. dot apan wrote\nAnd gave it. What can happen; what can be done? So we pass\nCan A25. pass today's date\nAre. 0326\nPerfect This Is Just An Optional. So this is it\nThere goes our create to do doc string.\nWe need to base this entire information on LLM.\nHe will provide the information or the data that will\nWe are capable of creating a task\nWill be. Is it clear till here? Yes.\nIf it is clear till here then we don't need to do anything.\nDon’t want to do. We have to write here with\nLocal session. We need an object from the local session.\nhave to create edge session so that we can access that DB\nBe able to access. And what will you do finally?\nTwo equals two. An object of the two class\nWill make. And what do I have to pass?\nInside this? The first argument will be\nTitle will be equal to title. todo class\nThere is an argument inside. is the name of a column\nTitle. What will be its value? in the title\nIncoming value. What will happen next?\nDescription. what pass in description\nWill you value it? Description. Ok?\nThen what do I have to pass? Priority.\nNow what is the priority to pass? just understand\nbe careful. See.\nIf priority comes, if you\nPass the priority and\npriority if I get it in the argument\nIf it is there then we will pass it as it is.\nOtherwise what will we do, otherwise we will go to the medium\nIf you pass right yes then what can you do\nBefore we run this here, we\nCan I put a condition on it?\nare a\nTask\nPriority equals to medium by default\nWhat priority did we give, we gave it to the medium.\nNow put a condition here. If\nPriority dot lower priority\nconvert to lower case and check\nWill do these. Now, is any of these three\nEither one or two. Ok? or high\nShould be. Ok? Or what finally\nDo we have any left? Medium.\nIf any one of these three priorities\nmatches the priority inside the function\nThe value of the incoming priority. So we\nWill replace task priority\nWith whom? By the value of priority. And here\nPay hum priority equals to pass kar denge\nWhat? Task Priority. I believe this\nIt must have become clear. Yes. Now what remains\nArgument? Finally, what else do you have to pass?\nDue date. Let's pass it.\nDue date equals to due date. That's it.\nThat's it.\nOk? And finally we will pass. Another one\nWe need to pass the argument. If You\nRemember we created an argument.\nAt due date etc. all this is optional. But\nWhat is Created At? Created at what\nIs? It is compulsory. So Created at Equals\nHow to remove the two created at? So we\nwill say date time dot now current time\nRemove it and format it again.\nSo what will you do? Needed in string form\nString f time. Ok? Formatted in\nTime is needed. And what should be the time?\nI need to see it first\nPercentage of d = then percentage of m\nMeaning month then finally we will have percentage\nOf by year and then we will simply say\nPercent of h after space means hours end\nPut a colon and we will simply say percent\nof m minutes. So this should be our\nComplete date time and created at\nFormat. perfect. And as soon as our two\nWhat do we say here?\nsession dot\nAdd two to-do objects to the session\nAdd it and tell the session to commit it.\nTwo. Commit means that whatever task\nobject is created in RealDB\nPlease implement it also. Is this clear?\nHui? If yes then just give me a thumbs up\nUp and like the video. Right? Ok. Now here\nIs yours clear yet? Yes it is done. Now\nFinally, we will say session dot here.\nRefresh of two. What will be the benefit of this?\nThe advantage will be that whatever task you create\nIt would have had four arguments but\nThere will be no real data. Real To's Object\nWill not done. Ok? So he wants to fetch us\nWhat did we do for? Here it\nRefreshed it. Ok? And what to do here\nWill you give? From here we will return a\nFormatted string.\nOk? Now what is in the format string?\ndo? We have some intersections here.\ndo. Ok? message will be todo\nCreated. First of all, what did you say?\nThat there is a todo which has been created on its own.\nOk? Now if you want to do ID also\ncan give. So what will the ID be? Who\nWhat is the object of to do?\nID. So what did we pass? ID this\nIs. Ok? And what difference will you pass?\nWhat will you give in the title butt? give in the title\nwill give\ntodo\ndot\nTitle. Ok? Do you have to pass anything else?\nA. That's fine. And they pass some other things also.\nLike what else do you need? Priority show me\nYou have to do it, not what the priority is.\nof. Ok? So what will we pass?\nPriority and what priority is set\nIs? Priority is set to do dot\nInside Priority. Ok? Anything Else\nWe need to pass a I think due date, due\nTime no leave it. This is enough for us.\nWhenever any of our tasks is created,\nThis entire function of ours will run and end.\nAfter the run, we get this return response\nYou will find that we have created this task.\nIs. Is the matter clear till here? If\nYes then it's amazing thing we have. So your\nWe have already created the first tool.\nNow kids, now we have three more tools.\nTo create. How to do it? Look very\nIt's easy. We need to create a function read\nToos. Can make it or can't make it.\nWhat should we give him in our time? Near\nAnd what do you put on top of it? @Too Felt\nWe give. Ok? Done. We need another one like this\nYou will need to create a function. Ok? what did you do\nMade it now? Read to do. Do this one thing.\nName it your to-do list. Ok? Ok? One\nWe will have an update\nToos. Ok? very good. what is in this too\nWill you come? pass or you can say like this we here\nWhat do I have to pass? A doc string.\nOk? And what will we put here? @\nTool. There will be another final function like this\nWe have the definition\ndelete\nTo do. And what is coming in delete to do also\nWill I have it? The docstring will be coming.\nWhat else will we put in the end? @\nTool. So like this I have these three functions or you\nYou can say three tools and create\nAre. So what about creating radio?\nIf yes, then let's do it with our remaining three children.\nTools too. Ok? It is very easy. don't\nWorry about it. What do we just have here?\nDo you want to define it? The problem is to be defined.\nOk? Ok? So what will we do here?\nWe will define pept here. Correct\nIs? And my prompt and you can say\nDoc String Should Be Something Like This.\nList All To Dos Optional Filter By\nStatus and POD. Right? So here we are, two\nWill also receive arguments. Ok?\nStatus. Someone says I should keep it pending\nNeeded Ok? So what is the type of status?\nwill be? String. And by default what do we\nMust be passing? All. Ok? very good. End\nThe next argument will be\nPriority. And also the type of priority\nWhat will happen? will be the string. and by default\nWhat will we be bringing? All. means all\nPriorities and all status data to me\nNeeded I have the by default configuration.\nBut if in LLM and if my agent v\nRequest that I only need pending\nI will get the pending ones. need these progress\nSo you will get these progress. Right? So look\nWe have also defined here that eggs which\nThere may be status of priority.\nThere are three possibilities in the status. Pending,\nIn Progress and Done. and priorities\nThere are three possibilities in this also. Low, Medium\nAnd high and all. All means all. Done.\nperfect. Now let's write the code for it. So\nI have to do exactly the same code with\nlocal session\nS session. Can you do it? can not do?\nCan do. Ok? Now we are inside it\nWill do the actual code. What will be the code? So now\nOne will define query equal to\nsession dot query and query for what\nIf we do it, we will put parents to do.\nWe will query the table, whatever the query may be.\nMaybe, maybe now here we have a condition\nLet's see if we changed our status.\nIf you have tried this then what will be the condition if\nStatus Not Equals to All It Means We\nwant to flirt with some different status ok\nSo what should we put, we will say it here\nQuery equals to query we returned to object\nMade. Ok? We want to flatter him\nWill try. what is then filter and filter\nwill be? It will be flatter. Status Equal to To Do\nWhose should it be? coming in the argument\nOf status. Then understand this thing carefully.\nWhat did we say? We said that first\n[sound of clearing throat] We've\nConsidered by default. No query placed\nThe user. The amount of data the user has collected in To Do\nI need the data. But once we found that\nThe status is there, that is not all. means now either\nPending, In Progress, Done. If these\nIf it is any of the three, then we said it here.\nthat query equals to query dot filter\nThe status column of the todo should have a value of\nof the status column in the argument\nEqual to the value of status. Done. Same code\nWe will copy it again. Ok?\nWill paste it here. And now the value is\nThere will be no status. What will happen? priority\nWill happen. If Priority All is not set then\nThe priority column has a value that must match.\nThe priority value should be the same. What\nIs this clear? If it happens, it is very\nIt's a good thing. Ok? Now the last one remains\nStep. What will be left? We will say here\nToday's equal to query dot order by whatever\nThere is a date for the query, we will also order it.\nWho will you order from? So we will order\nFrom the two dot ID column. So I'd be higher then\nYou will get it at the last, if it is lower then first\nwill get. Right? So in ascending order in\nDescending Order Whatever Order You Want\nYou can do this right? Ok. So Id and\nI should have all the data I have.\nFINALLY Fetch. So what will happen with this? as many as\nAll of them will be available todays to me.\nIn the form of a variable named today\nYou will see the list. Well, is it like that?\nYes. What to do now? Now we need if\nNot to do means what you have done for to do\nThe query passed does not exist\nDoes. Right? So what do we do from here?\ndo? A we'll make a return from here\nmessage and the message will be a formatted message.\nOk? What else can I say? No Twos\nfound\nFor\nYour\nflutter values. Done up can return this much\nAre. Our work will be done. That's it.\n[laughter] And if we have twos, we'll\nThen make some interesting returns from here.\nwill be. What will he return now? understand\nNow we are. Ok?\n[nasal noise] OK. so if\nWe have todays, so let's turn these todays into\nWill return. So what will you do here?\nFrom? Return of today. Ok? or todos\nYou will not be able to return it directly.\nWhy? Because todays will be ours\nPass object of class to todo class\nWill be. We need dictionary data. So how\nWill we get it? So we can do one thing.\nWe can create a variable. All twos and one\nMade a blank list. And even here we are\nYou can also say this to do for\nTo do. in\nTo dos so what did we put here? List\nI used the comprehension method. Ok?\nAll the to-dos will be on this list.\nWill be added. And in what form will the ads be?\nThere will be add in two dick form. so dictionary\nWill be added to the form. And from here we\nWill return alt to two.\nperfect. perfect. So this way our\nThe two tools are ready. Now\nOne tool remains. Why do I tell you this\nHave I been? Because the deleted one is\nIt's the easiest one. The main effort we have to put in\nThose have to be updated. anyone else\nDo not apply it. Ok? So let's do it\nWhich tool works? Work on update tool. Correct\nIs? Ok. Now first update us on this\nIt must be understood that in our update tool\nWhat arguments will come? so almost\nAll the arguments that were in create\nwill be coming. You should accept that.\nOk? Done. Just one more argument\nWill come. Which is that extra argument?\nwill be? The ID of the todo. How will we know that\nWhich todo do you want to update? So that\nWhere will I find out? From the ID of two. so one\nargument and we will have to do ID\nWhat will be its type? will be int and this\nIt will be compulsory. Meaning, if it is not there then\nYour task will not work. Dun Dun or Hum\nIf we want, we can pass it by default.\nDo you give? Nun Nun passed it. Ok?\nThey don't pass. Leave it. Leave it. Ok?\nOk. Listen now. Interesting point. Correct\nIs? Now these values ​​here we have\nWill not pass. Ok? Ok.\nWe have the description. Our poverty\nIt is nearby. Status We will also change the status.\nOk? Suppose one more should come?\nStatus. So title we have, description we\nHave, Status, Priority and Due Date. We\nCan you update any of these? Tax\nCan. Ok? Now here we define\nWe will have to do this to our doc string which is\nThat's all we can update\nAnd What All We Can't. Ok? So, how\ndo? Let's see.\nOk. So what do we have for update two?\nwill be? The doc string will be something like this\nwill be. Ok? Something like this. Ok?\nI'm copying and pasting right from my\nAlready Build It Project. why i am\nCopying and pasting? because ah this is a\nFixed Value and I Don't Want to Waste\nSo much time to write it word by word.\nRight? Ok? anyway you are going to get this\nComplete project on Get Up. So, there you are\nIf you want, go to and copy this doc string.\nYou can use it in your project.\nI'm just going to explain that to you, Doc.\nWhat we're going to do with the string. Ok?\nSo basically update an existing to do by\nIt's Id Only Provided The Fields You\nWant to change. Not everything needs to be updated.\nOnly the fields that need to be updated\nYou have to pass those fields only. user\nIt says I just need to update the description.\nIf you want to do this then other fields will not be updated.\nNeeded Well, is it like that? Yes. Now to Do\nID ID of the to update is required\nCompulsory. Title New Title Leave Empty to\nFunnel current. If the current title is to be retained,\nIf you don't want to change, will you pass it?\nEmpty. New Description Leave Empty\nSame thing again. status, new status\nAnything between Pending, In Progress, and Done\nIt is possible Done Priority, New\nSome of the priority are low, medium, and high.\nIt can also happen. Due from End Due Date\nIt could be a date. Is it clear till here?\nIs? Yes. If it has reached this point then\nWe only need the basic logic of the code.\nI have to write. Same with\nlocal session\nS session.\nOk? Done. Like, look, we wrote here.\nTha other codes in with local session s session.\nRight? So what do we need first? DB\nsession of once we have db session then only we\ncan work on it okay is it like this yes and\nWhat if we first two\nwhat will fetch do for id task fetch\nIf we do it, okay, then how will we fetch it here?\nwould say to equal session dot get get whom\nWhat to do has to be done and on what basis\nIf we have to do it, we have to do it through To Do ID.\nBase Pay Perfect Perfect and here is a\nI will put a condition if I don't want to do it, what does it mean?\nThe to do ID that you have passed to me\nThe to do ID given in LL is wrong.\nWell, is it like that? Yes, what will you do? Then\nI will return it here. what returns\ndo? to do\nWhat will be With ID and ID? To Do ID\nHogi not found. Now how to ID this\nHave to do it? Dynamic. So what will you put\nHere? I will put F. So this happened\nOur first step. But if I get to do something\nThen we have to calculate each value one by one.\nHave to update as well. How to do it? So look\nFirst, we need to check whether\nWhat will you do if the title has value? If\nTitle If there is value in the title, what do we\nWill you tell me? We will say here\nTo do dot title equal to title. We every\nWill have to check for the case. One by one.\nOk. Is it so? Yes. What is the next case?\nwill be? The next case will be that if\nDescription If the user said that we\nPassed the description here. Us\nThe description needs to be changed. So what\nWill you write here? Two Dot Description Equ\nTo describe okay okay. Then what\nDo we have any left? Then there is status. If\nThere is also value in status. Also tap the status\nNot there. So what will you write here? to do\nDot status equals to status. well even\nDone. Done. How many fields are left now?\nWe have? The title is done. The discussion took place.\nThe status is done. Then what remains for us?\nNear? Probation and Due Date. So what will you write\nAre we here? If\nUse. So I will write it here\nTwo dot priority equal priority and\nIn the end, what remains is what remains with us.\nIf we change the due date also\nIf we want to do something, what will we write as to do?\ndot\nDue date equals due date, that's it, simple and\nAs soon as you have applied all the changes, suppose\nIt was found in the exam that we had made all the changes\nIf we do it then what will we do here?\nHow will you implement this?\nsession dot add\nNo, then what will we do here? we here\nBut I will say session dot comment. That's it. End\nfinally session dot\nRefresh of two. So whatever todo was there, save it.\nIt happened and it also got refreshed. Good\nIs it so? Yes. What to do finally now\nIs? Have to return it. What is the return\ndo? A formatted string. We Are\nMust have to do this. Right? Ok. So what\nDo I want to return it here? me here\nBut we have to return to our todo.\nWe have updated the ID. todo it\nAnd what is his ID? That ID is his too\nDot ID\nUpdated. First of all, this is good news.\nOur todo has been updated. Ok? Then\nWhat to do next? Next we have\nI have to do a simple to-do which is the new update.\nWhat happened to do that? So how do you pass\nWill you give? todo.com\nTwo\nThat's it. Simple even the simplest one we have.\nSo our update tool was also complete.\nare done. I can understand that a little\nThis project may seem big. you are you\nI feel like I'm covering a lot of things.\nAre. But you can see that here we have just\nThree tools have been created so far. Create to\nList all tos and update to. That's it. Yes.\nNow it remains to make the last tool which is very\nIt is the easiest. You can say that. Us\nYou just need to delete it. So just\nLet me bring what we can\nFrom doc string for delete to do. Then I\nwill come back here right ok\nOkay, now we copy and paste this here.\ndone and what we have permanently\nDelete a to do by it's id simple hai and\nWhat I need is just to do ID so here\nWrite on To Do ID and what should be there\nInt that's it. Perfectly fine. now now\nWhat needs to be defined? Simple same logic. These\nYou can also copy the above if you want.\nAt least we can do it this far.\nEverything from copy with local session. Correct\nIs?\nOk. What can you believe? Is this clear?\nI created the local session. again from the session\nWe got to do it with to do ID.\nIf not found, suppose I get that\nNo? This too does not exist. So\nWe said to do with ID not form.\nperfect. But it is available if it says\nYes, I got it, so what should I write?\nI need to delete session dot and delete whom\nI have to pay what I have to pay to do, is it right?\nYes now finally we will simply session dot\nCommit OK, and there's one more thing to do.\nWe need to change the title of the todo before deleting it.\nIf you want to remove it, how will you remove the session dot?\nNot session, basically what will we write here?\nTwo dot title that's it now you have it\nThe commit also came, everything came. We finally\nFrom here you have to return a formatted\nstring\nWhat is to do and to do? to do our\nThe title is\ndeleted\nSuccessfully.\nThat's it. Almost my project is ready.\nIf we created the tools, you would think that\nAll our other work is going to be very easy.\nAre. So we define all four tools for this\nproject. In which tools do we define\nof Then we revise it quickly.\nCreate Tool, List All Tools, Update Tool\nand delete tool. And all the tools have the same\nThe main important thing is our dock.\nString and proper logic. That's it. Yes.\nSo what have we done? Our database\nIt is ready. Our tools are ready. we need\nJust the last thing and that is Agent. agent\nMade that our project is ready. by\nSee. Let's try it. so what will you do\nAm I the first? from lichen dot agents\nimport createAgent. Right? what is the last\nIs? from link chain\nNo, not the link chain, we need it here.\ngraph dot check pointer dot memory import\nin memory saver okay okay okay\nThen is there anything else left for us? Yes, we\nNeed LLM, which LLM should we use?\nSo we're going to use from\nLynching Crock Import Shed Rock Done Done Now\nWe need from whatever tools we define\nWhat will you write if you do?\nFrom Tools Import. Look now as much as\nThe tool has been defined, where do we find all of them?\nNeeded? We have in our All Tools form\nNeeded Need a list of form tools\nWill be. Okay, right? So inside your agent\nIf you want, you can put a star. Its\nThis means that whatever is in the file named tools\nThere will be tools for all the agent names.\nCreate this will have been imported into the file.\nNow let us define a variable.\nWell now look\nIf we want to create an agent then we\nWhat do you want? System preparation is most important\nThe thing that will define that exactly\nWhat is the working of your agent?\nHow will it work? So whenever we talk\nWe need four things from an agent.\nAre. Which ones? The first LL.M. Ok? Then\nTools. Ok? So is there an option for LLM?\nIs? Absolutely. Chat drop. what tools\nAre? Absolutely. There are tools. Then what\nNeeded? System Prep.\nWhat does system pt define? We\nDiscussed multiple times. these these\nWill define what the working of that agent is\nIs? and what the agent can do and what\ndoes not make. Well, is it like that? Yes.\nAnd then we need the user's question.\nperfect. So let's make it one by one. So first\nWhat will I need? LL.M. Who is LLM?\nWhat are we going to use here? Chat\nWhat will the group pass? Model. what is the model\nWill you pass? Open AI Half OSS does one thing\nAre. Let's go to Google. Different\nPick up the model. Isn't it? Grok's\nGrok Models is fine.\nThis one we're gonna pick up okay Grok\n3.3 billion one okay okay what's the name\nYou will have to copy this limit\nThis one on Grok, he said something like this\nYou can copy it, okay?\nOkay so now we have this model yes model. Now\nWhat do we want? Tools.\nTools equals to here you can say all\nTools equals whatever tool you created\nDid. So which one have we done? One we\nCreate to has been done. Ok? List\nTodays. Ok? Then update today and delete.\nTodays. so that we had all the tools\nWhere did all of them come from? All Tools\nI got combined. Well, is it like that?\nYes. What remains now? Finally, we need\nSystem Prt. So sy s t e m\nSystem\nprt will be equal to multistrings\nmultistrings will be ok ok\nNow we need now we need system prompt to\nThe system prompt will be something like this\nOK, what have you defined, see the system prompt.\ncreated a variable you are smart and\nFriendly to-do manager\nAI Assistant You Help User Manage There\nTasks using a database and you can create\nNew Task List and Filter Tasks by\nYou can filter by status and priority\nHo Update Any Field Of The Task Like Title\nDescription Status Priority and Due\nYou can update any of these dates.\nAnd delete task by id amazing perfect\nGuidelines: What to do and what not to do\nKaroge Right Always confirm what actions you\nTook after each tool call ok when listing\nTwo Dos Present Them in a Readable Table\nFormat so that I can view it in table form\nBe able to read it in proper form. Mark\nAs Done Update with Like If Someone Will Says That\nMark as Done So what do we do? Update with\nStatus Done. Ok? If someone said start\nWorking on it. So what will we do? Update\nWith status in progress. So pending then\nIt will list it with pending status. End\nHigh priority. So the priority should be high\nNeeded amazing. Now Be Conscious and\nFriendly. What is the value of status?\nCan it? Pending in Progress and Done\nCan. And we have one more thing here\nExtra configuration that makes LLM a little\nAnd will make it better or will make the response better\nWill make. Use Status Icon with Status\nValue. How? If someone has pending status\nIf it is coming then I will see it with this icon on the UI\nIt should show pending. For these progress\nI should get this output and for Done\nI want this output. amazing. End\nWhat are the priorities? Low, Medium End\nHi. You want it, it's just for you\nHomework as well. You can do the work yourself\nThat's when you configure low, medium, and high.\nYou can configure the icon for that as well.\nDo it and if it happens then I will get this icon.\nShould be visible. If it is a medium then something different\nIf icon end is high then different icon. Right?\nAnd you implement this then just\nComment it as well that yes you\nImplemented it. And how was your output.\nRight? Ok?\nSo, do we have everything?\nLL.M. All Tools   System Prons. So\nWhat are we waiting for? to create the\nAgent.\nCreate\nAgent Okay, okay, what else will you define?\nHere we will define agent equal to\nCreate Agent\nCreate Agent, this create agent is ours\nThis is the method and this is the create agent.\nThis is also our method but which is\nImporting from the agents right Lenche\nDot Agents OK Done Now What Pass\nYou pass the model quickly\nEquals to what do you want LLM okay okay\ndonation\nTools and Tools Will Be My All to Tools\nOK then System Print and System Print\nWill you pass your system?\nBut look, whenever we create an agent\nWe have to take care of one more thing and\nWhat we have to keep in mind is that\nmemory is also required to store the\nConversations are good like this, so yes\nWhere will you import the memory from? Look at these.\nWe had imported the memory saver, so we\nWe created everything, we just didn't create the memory.\nLet's take how to make it\nDefine a variable in MEMO\nMemory Equate Two\nIn Memory Saver That's It Yes\nNow we will go to the last and pass it.\nCheck Pointer Equated to Memory\nPerfectly fine so inside our create\nWhatever the agent required, we provided it to him.\nI have passed all of them and we are from here.\nWhich agent is ready to return?\nWhat became clear to everyone?\nClear how it's working Yes if everything\nIf it is clear then what do we do, we\nLet's create another method for create agent\nCall agent and what will it do, all this just\nThe string will receive the user's query.\nin the form and will call the agent and give\nWell, is that so? If yes, then how will you call?\nLook, first we have a variant named Agent.\nCreate and how to call it create\nwill call the agent method so what do I need to do\nwill get the agent's object OK and now\nFrom here on we will say response equals to agent\ndot invoke invoke what will you pass something\nWhat would be interesting is having a dictionary nearby.\nWe will take it and it will contain messages.\nAnd the value will be a list of dictionaries.\nWell, what would be in this dictionary? Roll\nAnd what will be the value of the role? User. Its\nIt means that the message you are passing\nWho is the owner of that message? I mean, that message\nwhose? Does it belong to the user or to the AI? So we\nWhat will you pass? Users will pass. Why?\nBecause the question is, the query is\nWho would have done it? The user must have done it. Correct\nIs? So, have you passed the rule? User. And\nWhat is the value and how will you pass the content?\nHow will you pass the query? So that will be made\nContent. Okay, what else will you pass? query\nYou will pass it. Can I believe here?\nIs it clear till now? If yes. Then we move on\nAre. Ok? A last argument pass\nWe will do it here in the dictionary. his\nWill be configurable. And this is very important\nIs. If you have given your agent memory.\nDo not pass configure if there is no memory\ndo it. There is no problem. But if\nIf you have given me memory then I will get the configure pass\nIt has to be done. Good. What is that? Yes. And\nWhat will be its value? The value will be one\nDictionary. We would have brought it to a new line.\nAre. We have reached very far in this. Correct\nIs? And its key will be the value of\nDictionary. And here we will pass the thread ID.\nWell, what would be its value? Forest. Now\nThis will mean that whenever an agent conversion\nIf he does it, he will remember that I will thread\nOnly the data of the person with ID one is used for reference.\nWhether to take it or refer to its conversion itself\nI have to take it. So there is no problem in local.\nNot there. Will Work. But when if you\nIf you go into production, this ID will be\nShould be unique based on the different user\nIDs. You will be managing your tasks.\nSomeone might be managing their tasks. than we\nNeed Different IDs Here. Yes yes. So believe\nMe everything is ready now. Now we just\nAnd all I need is the answer.\nWhat will answer equals to generate?\nresponse of\nMessages. Its last index date\nWill take it out. And how will you remove it? of content\nFrom. When it is sent through content then it is sent through content only\nwill get. Isn't it? And finally print it\nTo the answer. That's it. The Project Is\nAlmost ready. All that's left is to create the EUI.\nEverything else is ready. Try it.\nLet's try running. Opening the terminal\nAre.\nVirtual average has been activated. What\nWill you run? Python and which file to run\ndo? Agent Dr. Py So far we've only seen one\nI didn't even try running it. So we have no\nIdea how it is working and how much\nBetter is working. Ok? by running\nLet's see. So Python Agp /\nWell, we're getting some errors. what error\nAm I getting it?\nWell this is the error that we did with the Grok API.\nI did not pass it. And why not? see\nAre. Look, yes we did and the other one could have gone too.\nSo we didn't even call the call engine.\nDid. So how does it work? It doesn't work. It will be good if\nWhat do I have to do? We write here\nwill be fromenv\nThe import load must call the load.\nWhy do I have to do it? Because our ANB\nWell, inside the variable, we just did this\nHaven't discussed it yet. That's That's\nMy message. I thought we discussed it early.\nRight? So whenever we use our LLM\nAre going to do it. Which LM to use\nAre you going to? Gonna use Grok. So\nI need the API key of GC. Once We Have\nGrok API Keys Than Only My LLM Can\nwork. So how to get it? See. So let's go\nAre. Where will we go? Let's go to the grog.\nOk?\nClick on Playgrounds. Ok? or click\nOn API Keys. You will click on the API key.\nSo whatever API keys you have, you have\nYou might have also created them, you can see them here.\nWill meet. We create a new one\nFor you. Ok? What will happen? SQL\nThe agent submits it. Ok? It\nWill take hardly a minute. Ok? Not Minute\nBasically seconds. Ok? Copied. Own\nwill run inside the environment file and here\nWe will define a variable. end see error\nI am also showing it. which error is it\nNeeded? of the Grok API. then paste it\nLet's take it. Let's copy this to save our\nTime something like this. So what is our\nIs the API configured? Yes. Now this API\nI need to load the following for my environment:\nInside. So who will do that? Load NB which\nThis is a method that will do this for your environment.\nLoad the variable inside your program. Ok?\nperfect. perfect. So now we run again\nLet's try it. But to run this also\nI have to call the agent first. do\nNo call? Yes. Then copy the call agent.\nAre. Let's paste it here. And accept this\nThey say list\nList my all the tasks. Dun Dun.\nOk. So we are getting the error.\nperfect. perfect. so let's see what to do\nWe can use this to solve it. So\nFirst thing, we are missing this step right now.\nWe gave it. No, if we go to the database\nSo we defined a method for these DVs.\nBut did we execute this method?\nIf you do not execute, what will happen to us?\nTables will be created, database will be created\nIf it doesn't happen, then what should we do?\nLet's go to the agent and import\nso from database import int db end\nAfter load ANB we can use inet\nWhat will you do to the DB by executing it?\nIf the table does not exist,\nIf it happens then the table will be created, right that's it.\nThe Important\nOK now what's left? Another task\nIt remains that we have Eldmore in the agent\nI used it, we would have removed it once\nAre. Ok? We are not using the previous one.\nLet's see. Because some time it happens that\nTools not configured properly based on the\nEl Moral All the Things. Ok? So what\nWill we do it here? Use it here\nWill Open AI Huffn\nGPT\nOSS 20b. Ok? Letts C. Now again\nLet's run the same code and see. RV\nGetting the correct answer or not? Yes It Looks\nlike you don't have any task in the in your\nsystem right now right and I would like to\nAdd something right so we can add it\nAnd even if you open it here, you can\nC that here I found a website called Todays.DB\nThe file is automatically created\nIs. That's an amazing thing we have right, yes\nNow let's cut it. Ok? Ok\nNow what do we have to do now? So our\nBasically, a complete agent or a complete system\nIt is ready. Just One Step Spending\nthat we have to build a UI where\nThe user should ask a question and our agent\nHe was able to give us an answer. Ok? How\ndo? It's going to be very quick. Win a\nIt will be a minute. Ok? How to do it? So\nFirst of all we have to write from here\nagent\nImport\nCreate Agent. Ok? Create us Agent\nHave to do it. Ok? And finally we have one more\nImport will have to be done from basically import\nStimulate as st done now finally what\nWe have to do it for ourselves, we have to condition it now.\nWill apply if agent not in ST dot session\nstate\nIf any key named Agent has session state\nIf I do not exist then here\nwill say ST dot session state dot agent\nEqu create agent we will create a\nWe will store it in the reception. Ok?\nFor the future use. Ok? Now one more us\nCreate value here\nmessages\nNot in ST dot session state. If the messages\nThere is no one even by name. Then we will\nSimply say ST dot session state dot message\nA blank list. That's it. Now what do we\nNeeded? Questions and answers from users\nHow to do it? Look, I'll say it here\nQuery equals s dot chat input and chat input\nwhat will you pass\nManage Your Tasks\nOkay, and here we will put a condition that if\nQuery If the user has asked a question\nWhat we will do is call this query\nI will pass it to my agent\nWell, if so, what should I do?\nFirst of all we will say ST dot here\nWe also need to display the chat messages on the UI.\nWhose message is this? It belongs to the user. What else\nIs there a message? Mark down and pass\nQuery. This means that the user, whoever\nWill question if you look at your UI\nLet's go. Ok? So let's assume the page\nRefreshed it. Well, our server is down.\nIt's basically done. Ok? Let us ourselves\nWill run . So now whenever the user\nIf he asks a question, the user's question\nReflection should also happen on the UI side.\nSo how will it happen? If query received then we\nsaid ST dot chat messages of users dot\nMark down query. Good. Now Icy Query\nYou also have to call the agent for this. So what\nWill you say? Response Equ St Dot Session\nState dot agent dot invoke. Ok? And that\nWhat will you pass? The same code that we\nI made the call here while working as an agent. So\nWe comment on it. Ok? End\nWe will copy the exact same code.\nBecause we don't have so much time. Right?\nAnd paste it here. and agent's place\nWhat will come? ST dot session state dot\nAgent Right because where do we have agents?\nIs there a store? The state of the session is stored.\nOkay Amazing Now Less Everything Is Same\nEverything is the same. And finally we reach this line\nI will also copy and paste it here\nWill give. And what will you pass here?\nAnswer from the end user or your agent\nAnswer. Good. And what do you pass here?\nWill you give? AI. That's it. There is so much work\nOur. Is the matter clear till here? If\nYes. So let us run this code and see.\nOkay, let's do one thing now. do one more thing\nI just take it. Ok? very small task\nAll that's left for us to do is. Is it that the number of users\nHe will also ask questions, whatever answers he generates\nHonge, we need to store those questions and answers\nEdge well. How will you be able to do it? So look at whenever\nThe user will ask a question, we will say it here.\nST Dot\nsession state dot\nmessages dot append. What else can I add?\nWill you give? Same dictionary which you took for LLM\nSent to ask the question. Good. Ok\nAnd what should I reply here, exactly the same?\nI will copy this and show it to AI.\nAI will be rolled out first and the content will be\nOur answer will go\nThat's it, there was so little work left and here\nIf we add one more loop, our\nThe project will be ready, it will be completely ready.\nwill go even for message in st dot session\nState Dot\nmessages\nrole equals to message of role well it is like this\nCopy what is okay and pass what you will\nContent\nEquipped with content and simply, we are here\nwould say ST dot chat message\noff roll dot\nMarkdown of Content\nThat's it your complete project is ready\nBelieve me everything is ready now\nAll we have to do is run this code and you are\nReady to See the Magical Project You Have\nCompleted Just Now. How will you run? So\nWill run here. Server run of Stimulate\nI have to stimulate. What else will you write?\nRun. Which file will you run? fpy file. Run\nWe do it.\nOk? So you can see our browser open\nIt is done. And here I have this thing. Correct\nIs? We missed one thing that we all\nFirst I will show some patience. ST Dot Subder\nWhat else will happen?\nAI Task Manager Dun Dun Rein do.\nHere We Have This AI Task Manager Now\nWe call this List My All The Tasks\nHow to See This It Looks Like You Don't Have\nAny Task Say That's OK I\nwant to\nCreate One Sure What He Is Asking You\nThat you pass his title and when is the due\nput date all the pass okay so I\nI call this the title is\nConnect with HR\nTomorrow at\n5 pm\nYes created ok list me accept that's it\nThey give shortcuts. Ok? Scanned C Titles\nAlso there. Description is empty because you\nDidn't pass anything. The status is pending.\nOk? I can see the priority. Dew\nThe date is visible. Ok? Ok. I have\nConnected\nwith HR\nYes it's done again you will say list we have\nStatus is done so similarly you many\nYou can create a task and\nYou can improve the project even further.\nSo I hope you really enjoy this project\nAnd you feel that you learn something new\nThen like this video share this video with\nAll of your friends who really want to\nBuild This Amazing Project from\nScratch and if you feel that you enjoy this\nYou learn something new then subscribe to\nOur channel is well not done yet\nSubscribe we are coming soon for more videos\nmore advanced and next level of\nProject builders are 100% right\nThank you so much for watching this I will see\nYou in the Next One Thank You Again by Have\nA good one",
  "transcript_chars": 59251,
  "ingested_at": "2026-05-26T16:32:28.107926+00:00",
  "source": "channel",
  "yt_meta": {
    "view_count": 73,
    "like_count": 6,
    "channel_id": "UCLgmvKM3Eu1LRXoMlgsmxYw",
    "categories": [
      "Education"
    ],
    "tags": []
  }
}