Download "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent"

Download this video with UDL Client
  • Video mp4 HD+ with sound
  • Mp3 in the best quality
  • Any size files
Video tags
|

Video tags

rag app
rag application
rag tutorial
rag system
multimodal ai
python programming
ai
generative ai
genai
rag
chatbot
langchain
neo4j
keyword search
chromadb
tfidf
sentence transformer
reranker
reranking
cohere
cohere api
multiretriever
lost in middle
rag fusion
nlp
sunny savita
sunny savita rag
sunny sir
gemini
google gemini
memory
langgraph
ai agents
react agent
aiagents
ai agent tutorial
langgraph agents
structuredoutput
generativeai
aiautomation
llm
embedding
futureai
generativeai
textgeneration
ragapp
programminglogic
python
openai
gpt
langchainj
crossencoder
transformers
ragfusion
advancerag
llamaindex
google
lcel
aiagent
react
agenticai
generativeai
doctorappointment
automation
Subtitles
|

Subtitles

00:00:01
Hey. Hi everyone. Welcome back to my
00:00:03
YouTube channel. My name is Sunonny
00:00:05
Savvita and I'm back with another
00:00:07
exciting and important video. So guys,
00:00:10
in this particular video, we're going to
00:00:12
implement one end to end project using
00:00:15
multi- aenting system. Yes guys, so in
00:00:18
my previous videos I explain you about
00:00:20
the multi-agenting system. I discussed
00:00:23
different different kind of
00:00:24
multi-agentric system along with a
00:00:26
complete theory. Now it's time to
00:00:29
implement some project. So guys uh in
00:00:31
this video I will show you how you can
00:00:33
implement a project using supervisor
00:00:37
multi- aentric system and this project
00:00:40
is going to be complete end to end means
00:00:43
I'm not going to write a code inside the
00:00:45
IPV file instead of that I'll be writing
00:00:48
complete modular coding and you will get
00:00:50
a idea if we are getting any sort of a
00:00:53
project related to the agentic AI or
00:00:56
multi- aent system how we can code that
00:00:59
end to end. So let's begin. Let's start
00:01:02
without further delay. So uh here guys
00:01:05
you can see the complete syllabus of
00:01:08
this uh langraph course. Uh this entire
00:01:11
syllabus I covered inside my course. Uh
00:01:14
you can check out the playlist it is
00:01:16
there over the YouTube. And now guys we
00:01:19
are about to complete this course. So we
00:01:21
are here at this particular point where
00:01:23
we are going to understand the different
00:01:26
different voltage index system along
00:01:28
with a real world projects right so uh
00:01:31
two to three more video I'll be
00:01:33
uploading with respect to this course
00:01:35
and then I'll be starting with a new
00:01:37
playlist soon I will announce that a
00:01:39
particular playlist so if you haven't
00:01:42
seen my YouTube channel so far if you
00:01:43
haven't subscribed guys please go and
00:01:45
check please subscribe the channel hit
00:01:48
the like button if you are liking the
00:01:50
content, liking the video and leave your
00:01:53
thoughts inside the comment section.
00:01:55
Now, apart from that guys, you can
00:01:57
connect with me over my LinkedIn uh and
00:02:00
you can follow to me over the uh GitHub.
00:02:03
There also I'm uploading uh my code base
00:02:06
and all everything. Okay. And this
00:02:08
entire code base of this particular uh
00:02:10
course right this langraph course you
00:02:12
will find out over my GitHub itself.
00:02:13
Here you can see this langraph end to
00:02:15
end. Now apart from this one if you have
00:02:17
any any query right for me so uh you can
00:02:20
click on this onetoone call and uh you
00:02:23
can connect with me onetoone for sorting
00:02:25
out any sort of a query whether it is
00:02:28
regarding to the resumeumé career
00:02:29
guidance interview preparation mock
00:02:31
interview genative interview or if you
00:02:33
want to do quick chat with me I'm
00:02:36
available uh like for the given slot
00:02:39
right so please uh check out this page
00:02:41
and uh based on the like query okay you
00:02:45
can running with me now. So, uh guys,
00:02:48
first of all, let me clarify the
00:02:49
complete problem statement. So, here I
00:02:52
written the complete problem statement
00:02:54
uh on my blackboard. Okay, step by step,
00:02:56
we'll try to understand uh each and
00:02:59
everything, right? And uh from in front
00:03:01
of you only I'm going to code the entire
00:03:03
project, right? A couple of pieces I
00:03:05
kept in my system that I'll be copy and
00:03:08
pasting at the specific place uh inside
00:03:10
the project directory, right? But most
00:03:12
of the thing I am going to write in
00:03:14
front of you only. Now here guys, so uh
00:03:16
first of all let's try to understand the
00:03:19
problem statement. Uh I written in very
00:03:21
uh clearcut way easily you can
00:03:23
understand it. See we are going to build
00:03:25
a doctor appointment system using
00:03:27
langraph fast API and streamllet. So
00:03:30
here guys we are going to use the lang
00:03:32
graph for creating our agentic flow.
00:03:34
We're going to use this fast API for
00:03:36
creating our endpoint and this
00:03:37
streamllet for the UI. Okay. Now you can
00:03:40
read out the problem statement right.
00:03:42
What is my problem statement? So this
00:03:44
project is a multi-agentic system. Uh in
00:03:47
multi-agentric system where which
00:03:49
architecture it is following. So it is
00:03:51
following a supervisor architecture
00:03:53
right supervisor multi-agentic
00:03:55
architecture. I'll show you in some time
00:03:57
I cap the architecture as well and here
00:03:59
you can read the further description. So
00:04:01
this is a project this is a multi- aent
00:04:03
project AI power doctor appointment
00:04:04
booking system. Okay. So that's similar
00:04:07
to realistic medical assistant capable
00:04:09
of handling user query regarding doctor
00:04:11
availability, specialization,
00:04:13
appointment booking and all. So guys
00:04:15
this is a a doctor appointment booking
00:04:17
system which I developed using the
00:04:19
multi- uh agent uh supervised multi-
00:04:22
aenting system. How does it work? Okay,
00:04:24
what are the what all functionality I
00:04:26
have incorporate over here. Each and
00:04:27
everything we are are trying to discuss.
00:04:30
Right now here I'm talking about the
00:04:32
tech ST right? What is the tech ST for
00:04:34
this particular project? So we're going
00:04:36
to use the langraph for the workflow
00:04:37
automation right for creating the agents
00:04:40
and all. Then we're going to use the
00:04:41
langen for modeling model loading prop
00:04:43
engineering okay for the tool creation
00:04:45
and all. Then we're going to use the
00:04:47
fast API here right for serving a API
00:04:49
endpoint and all. Then we're going to
00:04:51
use the streamllet for front end
00:04:53
creation and then we're going to use the
00:04:55
python panda CSV for the data headlight.
00:04:58
So here I have I incorporate the data as
00:05:00
well. I kept the data inside the CSV uh
00:05:03
that that particular data I can leverage
00:05:05
okay for building this particular
00:05:07
project. I'll show you how the data
00:05:08
looks like and what all components we
00:05:10
have inside the data. Right now apart
00:05:12
from this one guys here you can see uh
00:05:14
so this is the sample use case. So how
00:05:17
this application is going to work. So
00:05:19
let's say if you are going to ask can
00:05:21
you check if a dermatologist is
00:05:23
available on 5th of August at 10:00 a.m.
00:05:26
So according to that it is uh replying
00:05:28
to me. Okay. So it is checking inside
00:05:30
the database and all based on the tool
00:05:32
calling based on that agented flow and
00:05:34
it will provide me a answer right now. I
00:05:37
hope this problem statement this tag is
00:05:39
tag okay and this simple use case uh it
00:05:42
is clear now coming to the architecture
00:05:44
of this project. So guys this is a
00:05:46
multi- this is a multi- aent
00:05:48
architecture uh it's a supervisor
00:05:50
multi-agent architecture. So uh over
00:05:53
here what I'm doing please try to focus
00:05:55
now you will get the clearcut idea.
00:05:57
First we are passing the input. Okay,
00:05:59
this input is going to the supervisor
00:06:00
agent. Now based on the query it is
00:06:03
going to be delegate, right? Let's say
00:06:04
if I if I just want the information so I
00:06:07
can pass my query to the information
00:06:09
node. Let's say along with the
00:06:10
information I want I I want the booking
00:06:13
node. I want the booking also. So after
00:06:15
collecting a information okay it is
00:06:18
passing again cursor to the supervisor
00:06:20
and then it is booking a slot for me.
00:06:22
Let's say query does not belong to any
00:06:24
information uh uh information node or to
00:06:27
any booking node. In that case directly
00:06:29
it's going to be finish the query. Okay,
00:06:31
that mechanism is also there. So in
00:06:33
short I can say it is a complete
00:06:35
multi-agentic AI system supervisor
00:06:37
multi-agent AI system where whatever
00:06:40
query we are getting based on the query
00:06:42
it is going to be delegate the task.
00:06:43
First it is trying to retrieve the
00:06:45
information from the given database and
00:06:47
then what it is doing according to my uh
00:06:49
convenient time or according to my date
00:06:51
it's going to book the slot for me okay
00:06:53
for the doctor I hope uh this entire
00:06:56
thing is clear now guys so uh you you
00:06:59
can uh take a pause or you can you can
00:07:02
take a screenshot and all of this entire
00:07:05
thing right because if you're going to
00:07:06
mention this type of project in your
00:07:08
resume so this entire information would
00:07:10
be required right so you can take it up
00:07:12
or else I can give you the P as a PDF uh
00:07:14
in the description. You can download
00:07:16
from there itself. Now guys, uh let's
00:07:19
try to uh start with the implementation.
00:07:21
Let's see how we can implement this
00:07:23
entire project. How we can implement
00:07:25
this entire use case guys. So here guys,
00:07:28
I will show you from very scratch and
00:07:31
what I'm doing. Uh first I'm going to
00:07:34
create a folder and uh inside that
00:07:36
folder I will open my VS code and then I
00:07:38
will create my environment and all the
00:07:40
complete folder structure. Okay. is
00:07:43
saying enter character to delete up to
00:07:45
right. Now here what I am doing first
00:07:47
I'm going to create one directory uh
00:07:49
inside this location see uh you can see
00:07:52
my location over here see user sunny
00:07:55
okay it could be any location in your
00:07:57
system so I'm writing mktir means make
00:07:59
directory and my project name is what
00:08:03
doctor
00:08:08
appointment multi- aent okay so I
00:08:12
created this folder now I'm going inside
00:08:14
this folder doctor
00:08:17
appointment multi- aent
00:08:22
okay with it now what I'm doing here I'm
00:08:25
going to write this code dot so that I
00:08:27
can open my VS code inside this location
00:08:30
right so uh here I have opened this here
00:08:33
I open the VS code inside the particular
00:08:35
location now what I can do I can close
00:08:36
the CM is not anymore required uh so
00:08:40
first of all what I will do over here uh
00:08:42
inside this VS code I'll be creating my
00:08:44
environment ment. Okay. So for creating
00:08:47
an environment guys, uh I I am going to
00:08:49
open my terminal and over the
00:08:52
terminal. So I'm not going to use the
00:08:54
power cell here. I'm going to use the g
00:08:56
bash. So here is my git bash and let me
00:08:59
open the g
00:09:00
bash. For the git bash actually you can
00:09:03
uh execute the linux command. So my
00:09:05
command is going to I'm going to use the
00:09:07
cond for creating a virtual environment.
00:09:09
You can use anything okay python or uv
00:09:12
sorry not uv you can use directly python
00:09:14
as well okay or whatever uh this
00:09:17
environment manager you are using can
00:09:20
use that so here conduct
00:09:25
create
00:09:27
penv and python which python version I'm
00:09:30
going to I'm going to use python 3.9
00:09:33
here and then
00:09:35
python guys uh you can see my
00:09:37
environment is getting created and along
00:09:39
with the environment what I will do I'm
00:09:41
going to be initialize the uh g as well
00:09:45
okay so I can give you this entire code
00:09:47
through the github only so that you can
00:09:49
practice so first I'm going to create
00:09:51
this g ignore and inside I mentioned
00:09:53
this v n okay now here I'm going to
00:09:56
create one more file the file name is
00:09:58
going to be requirement re
00:10:01
ui m ns txt okay uh then guys uh I'm
00:10:06
going to create one more file over here
00:10:08
the file file name is
00:10:10
setup. Okay. Uh now here I think so this
00:10:14
is clear this all the files and folder.
00:10:16
So let me do one thing. Let me
00:10:18
initialize the gate for so for
00:10:20
initializing the gate this repository.
00:10:23
Okay. As of now it is my normal
00:10:24
repository. Once I will initialize the g
00:10:27
so it will become a local repos local
00:10:29
get repository. I'm writing over here
00:10:31
get in it and see uh my g has
00:10:33
initialized. Uh now you can see it is in
00:10:36
track. Okay. This file is being tracked
00:10:38
by the G it okay under track.
00:10:40
Unttracked. Okay. See here is it is also
00:10:43
telling me unttracked. So once I will
00:10:44
add it so you will find out this
00:10:46
unttracked is
00:10:47
going is like tracking that file and
00:10:51
then I can commit that. I think you know
00:10:53
the basic concept of the git. If you
00:10:55
don't know I will create a separate
00:10:56
video on it. Now uh here guys I think.
00:10:59
So this is clear. Now let me create
00:11:01
couple of more folder. So I'm going to
00:11:02
create one more folder where I will be
00:11:04
keeping my data. Okay. This data would
00:11:07
be available in the form of CSV. But uh
00:11:09
this data could be anything. It might
00:11:11
come from anywhere from any database.
00:11:13
I'm just keeping in the form of CSV.
00:11:15
Okay. Now I'm going to create one more
00:11:17
folder here. So my folder name is going
00:11:19
data model. So inside this data models
00:11:21
I'm going to keep all the pentic models.
00:11:24
Okay. Then uh here is my one more
00:11:26
folder. The folder name is notebook. So
00:11:28
first I can do the experiment inside the
00:11:30
notebook and then I can keep the code in
00:11:32
a model. Right. uh then guys here I'm
00:11:35
going to create one more folder the
00:11:36
folder name is going to be prompt
00:11:38
library so I'm not going to keep my
00:11:40
prompt okay at a single place whatever
00:11:43
prompt are coming so I will be keeping
00:11:45
those particular prompt inside this
00:11:47
prompt library is nothing it's a py file
00:11:50
only but it could be any file in your
00:11:52
case it could be a JSON file it could
00:11:54
file in whatever file you want to
00:11:55
configure your prompt you can do right
00:11:58
now we have one more folder here so the
00:12:00
folder name is going to be toolkit okay
00:12:02
so inside this tool kit Guys, I'm going
00:12:04
to keep my all the tools whatever tools
00:12:07
is required for creating this
00:12:09
multi-agent. Then I'm going to create a
00:12:11
one I'm going to create one more folder.
00:12:13
The folder name is going to be utils. So
00:12:14
inside this utils folder I will keep all
00:12:17
the utility function. Okay. Uh now guys
00:12:20
uh there is couple of more file which is
00:12:22
required. So here I'm going to create
00:12:24
this agents py. Okay. So this agents py
00:12:28
uh it will keep the main agent. Okay. it
00:12:30
will keeping all the agents react agent
00:12:32
and all whatever we are okay then I'm
00:12:35
going to create one more file over here
00:12:37
the file name is going to be main py so
00:12:39
inside this main py I will define my all
00:12:41
the endpoints okay then here I'm going
00:12:43
to create one more file my file name is
00:12:47
goingore ui so I will keep my uh I will
00:12:51
keep my UI okay UI code inside
00:12:55
this_i file I hope guys I have created
00:12:58
each and every folder now I will keep
00:13:00
the code inside this all the folder.
00:13:02
Okay. So let's see step by step one by
00:13:05
one what all type of code what all type
00:13:07
of file files we have files basically
00:13:10
okay we we required inside this
00:13:11
particular folder and how to write our
00:13:13
agents right and what all requirements
00:13:16
are there for this particular project.
00:13:18
Got
00:13:20
it? Okay. So guys uh here I added all
00:13:24
the requirements whatever is required
00:13:27
for this specific projects. Uh before
00:13:30
recording this video I was executing
00:13:32
this project in my uh different folder.
00:13:35
Okay in my different uh uh VS code and
00:13:39
uh there actually I created an
00:13:40
environment. I take I took all this
00:13:42
requirement from there itself. So uh
00:13:45
better if you can download if you can
00:13:47
install this all the requirements so
00:13:48
that you won't be you you won't face any
00:13:51
such issue with respect to the uh
00:13:53
requirements. Okay. Now let me highlight
00:13:56
what all thing is required. So here guys
00:13:59
uh this is required. Uh which one
00:14:03
uh fast API is required. Then if you are
00:14:06
executing uh if you are using the Google
00:14:08
model then this Google libraries will
00:14:10
required. If you are going to use the
00:14:13
grog model then grock would be required.
00:14:15
Okay. Now IPv kernel will required it is
00:14:18
a by default. If you are going to use
00:14:19
the if you're going to run your code
00:14:21
inside the uh inside we inside your IPv
00:14:25
file. Then apart from this one there is
00:14:27
a complete ecosystem for the langen
00:14:29
langen core
00:14:31
experiment langen google generative ai
00:14:33
gro hugging phase this all the libraries
00:14:35
required. Okay. Uh then langraph would
00:14:38
be required. Okay. Now apart from that
00:14:41
you can see numpy would be required.
00:14:42
Numpy pandas would be required. Okay
00:14:44
here see I'll install this numpy and
00:14:46
pandas. Then uh after that guys ubicon
00:14:49
will be required because we're going to
00:14:50
use the fast api. So we'll have to run
00:14:52
the server using this ubicon command
00:14:55
right. And then this stimulate langen
00:14:59
community is required. The hyphen e dot
00:15:01
is for what this hyphen e dot actually
00:15:03
it is for installing the local packages.
00:15:06
local packages means so let's say here I
00:15:08
created this toolkit okay if I want to
00:15:10
convert this toolkit into my local
00:15:12
package so I will create one file over
00:15:14
here unders
00:15:17
init_init okay so if I have that file
00:15:21
okay if I have that file uh inside any
00:15:24
folder so that a particular folder will
00:15:26
be installed inside this virtual
00:15:28
environment okay what I'm what I'm uh
00:15:31
see what I'm trying to explain you over
00:15:33
here I'm just trying to explain you that
00:15:35
how you can install So the local
00:15:36
package. Okay. So if you are going to
00:15:38
initiate uh this package as a local
00:15:41
package, so you will have to define
00:15:44
the_init file over here. Okay. And then
00:15:47
you can install this particular folder
00:15:50
inside your current virtual environment.
00:15:52
So whenever you are going to be
00:15:54
imported, whenever you are doing any
00:15:56
crossimporting or any anything right,
00:15:58
you won't face any such issue. Module
00:15:59
issue or this uh module is not there,
00:16:02
this module is not getting detected.
00:16:04
That's why we generally follow this
00:16:05
step. Now uh apart from this one guys, I
00:16:08
have created a couple of more project.
00:16:10
So if you will go and check with my do.
00:16:13
So there only you will find out some end
00:16:15
to end project. Okay. Long back I uh
00:16:17
released one project with respect to
00:16:19
this Google dialog flow e-commerce
00:16:21
chatbot with deployment. Okay. So there
00:16:23
also I have explained all these
00:16:24
particular steps. Uh if you are
00:16:27
following to me regularly then I think
00:16:29
this step is nothing for you. So guys uh
00:16:32
yeah if you are liking this content if
00:16:34
this content is helping to can uh
00:16:36
subscribe the channel okay because I'm
00:16:39
trying to give you very premium content
00:16:41
which you can uh directly utilize okay
00:16:44
which will directly help you uh for
00:16:46
landing your job right for getting your
00:16:47
first job into this generative AI. Now I
00:16:51
think requirement.txt is clear. Now what
00:16:53
we'll have to do guys what would be the
00:16:55
next step? So after creating the
00:16:56
environment, we'll have to activate this
00:16:58
environment and then we'll have to
00:16:59
install this require.txe file. So no
00:17:02
need to worry about it because I I
00:17:04
already written all this command inside
00:17:06
this read file. I will provide to all of
00:17:08
you. You can take this entire commands
00:17:10
from the GitHub directly, right? I
00:17:12
already perform it just to save my time
00:17:14
so that directly I can execute my code.
00:17:16
Okay. So what you have to do guys? So
00:17:18
first you have to create environment
00:17:19
then activate the environment. Then
00:17:21
mention the requirements over here.
00:17:23
Okay. inside the recon.txt file and
00:17:26
after that you have to install this
00:17:28
requirement pip with this pip install
00:17:30
recon.txt txt. One more thing you have
00:17:32
to make sure over here. So inside the
00:17:34
setup py file, this code should be
00:17:36
present. Okay. So inside this code
00:17:38
actually the setup function is the
00:17:40
important one where you are going to be
00:17:42
uh define your local package. What is
00:17:44
the meaning of it? The meaning is very
00:17:46
simple. Uh like this uh folder right I
00:17:49
was telling to you know wherever you are
00:17:50
going to be uh mention the init file. So
00:17:52
those will be those will be like
00:17:55
downloaded as a local package inside
00:17:57
this particular environment. What would
00:17:58
be the name for it? name for that
00:18:00
particular package would be a doctor
00:18:02
appointment agent. Okay. So in short uh
00:18:05
you are going to be install the local
00:18:07
package inside where inside your virtual
00:18:09
environment and this would be a name.
00:18:11
Here is a version here is my name here
00:18:14
is a mail id. Find packages means uh
00:18:16
like it is finding out the package means
00:18:18
wherever the init file is available is
00:18:20
downloading only those folder. Okay with
00:18:22
under this particular name and uh here
00:18:25
is what called requirement. So yes, I
00:18:28
can install this requirement also while
00:18:30
I'm downloading the packages. Right? So
00:18:32
it won't give me any such issues. And
00:18:34
here is what at the last you will find
00:18:36
out the Python requirement. So at least
00:18:39
3.10 is required for this particular
00:18:41
project. Okay. So this is the basic uh
00:18:43
setup for executing the project. Uh
00:18:46
still we haven't uh started our main
00:18:48
coding and all but this was very much
00:18:50
required for running the project. Okay.
00:18:52
So I hope this entire thing is clear.
00:18:54
Now let's come back to the data. So guys
00:18:57
uh here I kept the data inside the CSV
00:18:59
file. As you can see the data. Okay. So
00:19:01
inside this data I have around 4,000
00:19:03
rows. If I will scroll down now. So here
00:19:06
you will get the entire post. So in
00:19:08
total how many rows are there? So in
00:19:11
total guys 4,000 rows are there?
00:19:14
4,281. Now what it what this data about
00:19:18
right? So to understand about this data
00:19:20
you will have to read the column of okay
00:19:23
column name of this data. So here I have
00:19:26
this data slot then specialization that
00:19:28
doctor name then is available or here
00:19:30
you can see the patient attend. Okay. So
00:19:33
uh here you can see the date and the
00:19:36
time then uh here you can see the
00:19:39
specialization this doctor this John Doy
00:19:41
okay he is expert in the general dentist
00:19:44
he's expert of the general dentist. Then
00:19:46
is available true? Okay if it if is he
00:19:48
available that case it it like this
00:19:51
doctor don't have any patient to attend.
00:19:54
Okay, it is not having any patient ID.
00:19:56
Now just uh let's look into the next
00:19:58
data point. So here is a date slot.
00:20:01
Okay, here you can see general dentist
00:20:03
for this John is available false. And
00:20:06
here is a patient ID. So this John Day
00:20:09
which is a like expert in this general
00:20:11
dentist. He's going to be attended to
00:20:13
this particular patient. Okay, at this
00:20:15
particular date and time, right? So you
00:20:17
can see the availability of this John
00:20:19
Day at which date it is available. Right
00:20:22
now, apart from this one, we have other
00:20:24
doctors as well. Okay, in the different
00:20:26
different other expertise and
00:20:27
specialization. Let me uh show you uh
00:20:30
those doctors. So, there is one more
00:20:32
doctor Emily Jensen. Okay, he she is a
00:20:35
expert in general dentist again. Okay.
00:20:38
So, she is not available at this
00:20:40
particular date and time. And here is
00:20:42
the ID of the patient which is going to
00:20:44
be attended by this John Emily Johnson.
00:20:47
Right? Now, uh see the other entries.
00:20:49
Let's say if I want to check with the
00:20:51
Emily Johnson itself. So Emily Johnson
00:20:54
like who is a general dentist she is not
00:20:57
she is a available at this particular
00:20:59
time. Why? Because is inside this is
00:21:01
available we have mentioned true and
00:21:03
there is no patient to attend. Okay. Uh
00:21:05
this Emily Johnson is not going to be
00:21:07
assign any sort of a patient at this
00:21:09
particular time. Okay. Date and time. I
00:21:11
hope you understood this particular
00:21:12
data. Now how we are going to be use
00:21:14
this particular data. Okay. for our
00:21:16
requirement for our multi creating a
00:21:18
multi- agent for you will get in some
00:21:20
time but guys this data could be
00:21:22
anything this data could available
00:21:23
anywhere inside your case let's say this
00:21:26
data is available in in it is
00:21:28
available in some uh private databases
00:21:30
in your in-house databases okay let's
00:21:32
say it is available it over any server
00:21:35
any API okay wherever guys I'm just
00:21:37
assuming this data is available anywhere
00:21:39
in real time but in my case this data is
00:21:42
there inside this data folder I hope
00:21:44
this thing
00:21:45
Now coming to the rest of the file. So
00:21:47
guys, now here I'm going to create a
00:21:49
rest of the file. So inside this data
00:21:51
models, I will keep my all the pinetic
00:21:54
models. So the file name which I'm going
00:21:55
to create inside this data models, the
00:21:58
file name is going to be models py.
00:22:02
Okay. Uh now inside this notebook guys,
00:22:04
I will keep my uh IPv file so that I can
00:22:07
do the experiment. So here I can write
00:22:10
multi-
00:22:14
agent dot ipy. Okay. Now uh then I have
00:22:19
next file prompt dot prompt library
00:22:22
prompt library. Okay. This is the
00:22:23
folder. Now inside this particular
00:22:25
folder I'm going to create a file. The
00:22:27
file name is prompts. Okay.
00:22:30
Prompt. Then what I will do? So inside
00:22:32
the toolkit guys again uh I required one
00:22:35
file. So inside the toolkit guys I'm
00:22:37
going to create a file. The file name is
00:22:39
going
00:22:40
toolkits.p okay
00:22:43
toolkits py. I will keep my all the
00:22:45
tools inside this particular file. Then
00:22:47
inside the utils guys I required one
00:22:49
file. So uh for loading the llm and all.
00:22:52
So here I'm going to write llm py. Okay.
00:22:55
So this is one more file. Now agents is
00:22:58
there main.py is there. Rest of the file
00:23:00
is here. Okay. So I think no need to
00:23:02
worry about. I hope this entire thing is
00:23:06
clear to all of you. Now coming to the
00:23:08
next part. So agents py is here. Did I
00:23:12
do any mistake? Okay, it is a folder
00:23:14
guys. Not it should not be a folder
00:23:16
actually. It should be a file only. Let
00:23:18
me give
00:23:21
file
00:23:24
ag. Okay. So my file name is what?
00:23:27
Agents py or it should be agent
00:23:33
only. Perfect guys. So I hope this all
00:23:36
the file and folder everything is clear.
00:23:40
It is not very much difficult. Now let
00:23:42
me define let me write the init file as
00:23:44
well. So here what I can do I can me the
00:23:47
init
00:23:49
file 4 py. Now inside this toolkit also
00:23:54
I'm going to mention this
00:23:58
4 py. Okay then the utils. Okay. So
00:24:10
unus py so whatever folder is there
00:24:13
wherever you have defined the py file or
00:24:16
in inside all the folder actually you
00:24:18
can
00:24:21
create_init p okay so see inside the
00:24:24
data it is not required inside a data
00:24:26
model it is required I created then uh
00:24:29
inside notebook it is not required
00:24:31
prompt library yes required Toolkit
00:24:34
required, utils required. Okay. And rest
00:24:36
of the file is a pile a py file itself
00:24:39
at this workspace. Right? This is my
00:24:41
whole sort of a project structure for
00:24:44
doing the for creating a like end to end
00:24:47
flow. Okay. End to end multi- agentic
00:24:49
flow. Uh okay. So this particular folder
00:24:51
structure it could be present or it
00:24:53
could be a part of any sort of
00:24:54
application. Let's say one multigenic
00:24:57
system you are going to be append inside
00:24:59
your website or one multigenic system
00:25:01
you are going to be append inside your
00:25:03
app and running software. So you can
00:25:05
create a folder structure like this you
00:25:07
can do all the modular coding and all
00:25:09
and you can expose your endpoint from
00:25:11
here okay from this man. py and then you
00:25:14
can make a connectivity but again I'm
00:25:16
saying guys this could be a in little
00:25:18
more detailed way. So in the upcoming
00:25:20
session uh definitely I'll try to
00:25:22
discuss in that manner as well. But yeah
00:25:24
this is enough for creating any end to
00:25:27
end flow. Okay all this f files and
00:25:30
folder you can add on more file and
00:25:32
folder according to your like
00:25:34
understanding. Okay some yaml file
00:25:37
config file and all. I hope till here
00:25:39
everything is fine. Now let's do one
00:25:41
thing. Let's try to start a coding
00:25:45
guys. Okay. So guys first let's start
00:25:48
with the data models. So if I'm saying
00:25:51
data model that mean uh I'm talking
00:25:53
about the parentic model model for the
00:25:56
validation classes for the validation.
00:25:59
So here I created one file inside this
00:26:01
data_m models. So the file name is
00:26:04
models py. Let's try to write a code
00:26:06
inside this models py. So first of all
00:26:10
we'll have to import this regular
00:26:12
expression. I'll show you why we are
00:26:14
doing it. Why we are importing this
00:26:15
regular expression. Then uh from pentic
00:26:19
we are going to import a base model. So
00:26:23
let me import this base model and using
00:26:26
this particular class we can convert our
00:26:28
class into the pyic uh model itself.
00:26:31
Then the next one is a field just to
00:26:33
showcase the description just to write a
00:26:34
description of a given parameter. Uh
00:26:37
then we have a next one which is called
00:26:39
field validator. So let me write this
00:26:41
field validator. It is very amazing uh
00:26:44
function which I can use as a decorator.
00:26:46
I'll show you what is the use of it. So
00:26:48
here is my field validator. Now, so let
00:26:51
me create a classes. Uh the first class
00:26:54
is going to be datetime model. So I'm
00:26:58
going to create a a class. The class
00:27:00
name is date time model. So what it will
00:27:02
do guys, it will check the format of the
00:27:04
date and time. Uh it will check whether
00:27:07
whatever date and time we are getting
00:27:09
from the user end or whatever date and
00:27:12
time we are getting after generating
00:27:13
from the tools. Okay. from the model it
00:27:16
is correct or not. So here I'm going to
00:27:18
inherit my base model. So let me inherit
00:27:20
my base model and inside this one I'm
00:27:23
going to write my parameter which is
00:27:26
date and the type of this date is str.
00:27:28
Now here I will mention the field. So
00:27:30
field it will keep the detail of this
00:27:32
date parameter and let me mention the
00:27:36
detail of this field. So here guys I'm
00:27:38
going to mention the description. Now
00:27:40
along with the description I'm going to
00:27:42
mention the uh pattern also. So here you
00:27:45
can see the complete code. So the
00:27:48
description is properly formatted date
00:27:50
and the pattern would be like this. So
00:27:52
what I'm saying here what I what I try
00:27:55
to return in the pattern. So D in the
00:27:58
curly presses we have this two. So it is
00:28:00
saying that the date will be up to two
00:28:02
digit month up to two digit and here the
00:28:05
year up to four digit and here is my
00:28:08
hour and this is the minute. Okay. So it
00:28:10
is representing a time. So if you will
00:28:12
look into the data guys, so here is a
00:28:15
data dr availability csv. Just look into
00:28:18
this date slot column date slot. You
00:28:22
will get a clearcut idea that why we are
00:28:24
writing that type of pattern. So uh here
00:28:26
is my date is day mm and here is my year
00:28:30
and you can see the time. Okay. So just
00:28:32
to validate this date slot we are going
00:28:34
to write this date time model. Now uh
00:28:37
let me write one more thing over here
00:28:39
that's going to be a field validator. So
00:28:41
here is a code for the field validator.
00:28:43
Let me do one thing. Let me copy and
00:28:45
paste and uh see guys this is the code.
00:28:48
So what we have here inside the field
00:28:50
validator we are passing a date. Okay
00:28:52
this is just one more level of
00:28:54
validation inside this datetime model.
00:28:57
Right. So whenever we are getting a
00:28:58
date. So here itself inside this
00:29:00
particular class we can validate whether
00:29:02
it is correct or not whether it is
00:29:04
following this particular pattern or
00:29:06
not. So here we are passing a date. So
00:29:08
and to this check format date we have to
00:29:10
pass the cls reference along with this
00:29:12
v. V is nothing it is a date itself.
00:29:14
Then we are checking whether this v
00:29:17
means my date is following this
00:29:18
particular pattern. If it is not
00:29:19
following in that case I'm going to
00:29:21
raising this value error. Otherwise I'm
00:29:23
going to return this date as it is. Now
00:29:25
apart from this one I have I have two
00:29:27
more date models. So let me uh take
00:29:29
those model as well. One is for date.
00:29:32
Okay, only for the date excluding the
00:29:34
time and the next one is for the
00:29:36
identification number. So guys, this is
00:29:38
only for the date. I think you can
00:29:40
clearly understand this date model. We
00:29:42
don't have time over here. If someone
00:29:43
giving a date only, so we can validate
00:29:46
this uh we can validate the date using
00:29:48
this particular class. Okay. Now the
00:29:51
second one is what identification
00:29:52
number. So if you will look into the
00:29:54
data, so the last column is a patient to
00:29:56
ID which is having one identification
00:29:58
number which is having one ID number.
00:30:00
Just count the numbers how many digits
00:30:02
we have over here. So 1 2 3 4 5 6 7
00:30:06
digit we have. So just look into this
00:30:08
model py. So here we are saying if it is
00:30:11
not going to be matched means if inside
00:30:13
the ID we don't have 7 to 8 digit. In
00:30:15
that case I will raise this value error.
00:30:17
The ID number should be seven or 8digit
00:30:19
number otherwise we are going to be
00:30:21
return is as it is. Okay. So one more
00:30:23
level of validation we are going to do
00:30:25
over here. So this is my simple uh data
00:30:27
model. I hope you understood this data
00:30:29
model and all. Don't worry guys, I'll
00:30:31
show you the output of it because I
00:30:32
created one notebook over here. Inside
00:30:34
this I kept the entire code see over
00:30:36
here and one by one step by step we'll
00:30:38
try to execute this entire one. But
00:30:40
first of all let me place the code at a
00:30:42
appropriate folder at appropriate file
00:30:44
so that later on we can execute it
00:30:46
directly. Now the next file we have
00:30:48
which is a prompt or py. So uh let me
00:30:52
show you what actually I'm going to keep
00:30:53
in my prompt. py file. So here I'll be
00:30:56
keeping the system prompt. Okay, I'm
00:30:58
going to copy and paste this particular
00:30:59
prompt. See here uh is a prompt and
00:31:01
along with the prompt I'm giving some
00:31:02
additional information. So try to read
00:31:05
out this particular information what I
00:31:06
have mentioned over here. Uh so first of
00:31:08
all let me do the word rap for you so
00:31:10
that you can easily read out the
00:31:11
information. So the first note this is
00:31:14
my first note first agent. It is a
00:31:15
information agent. So it is a detail of
00:31:17
the information agent what it is doing.
00:31:19
Then this is my second agent which is a
00:31:21
booking agent. Okay. And here is a
00:31:22
detail of this particular agent. So
00:31:24
information agent is just to fetch out
00:31:26
the information from the given data okay
00:31:28
database and booking node it is for the
00:31:31
booking right now here guys you can see
00:31:34
we have a option so how many options we
00:31:35
have we have a two option one is
00:31:37
information node second is a working
00:31:38
node and uh here third one will be a
00:31:40
finish right so if you will look into
00:31:42
the architecture which I shown you I
00:31:45
think in my uh previous uh okay just a
00:31:48
second guys let me show you that
00:31:50
architecture
00:31:52
uh give me a moment
00:31:56
Here you can see the architecture guys.
00:31:59
So inside this architecture we have two
00:32:01
agent. One is a information agent.
00:32:02
Second is a booking agent and third is a
00:32:05
end. Okay. So the finish finish which I
00:32:08
shown you over here. This finish
00:32:09
actually it is representing to the end
00:32:12
uh end node itself. And here what I'm
00:32:14
doing I'm compiling the complete
00:32:16
information inside this particular
00:32:18
variable working info and I'm appending
00:32:20
inside this system prompt. So you you
00:32:22
can read out the system prompt. Uh you
00:32:24
are a supervisor tasked with a managing
00:32:26
a conversation between following worker.
00:32:28
So here is a complete information of
00:32:30
this particular agents. Then your
00:32:32
primary role to help user make an
00:32:34
appointment with a doctor and provided
00:32:35
FAQ. Okay. If customer requested to know
00:32:38
availability of the doctor or to book
00:32:40
reschedule or cancel appointment you
00:32:42
have you have to be delegate the task
00:32:44
according to that. Okay. Respond with
00:32:46
the worker act. Next, each note each
00:32:48
worker will be perform a task and
00:32:51
respond with their result and status
00:32:53
when finished. Okay, response response
00:32:56
respond with finish. Okay, whenever the
00:32:57
task is going to be finished. So here
00:32:59
you can see this is a complete prompt.
00:33:01
You can pause the video and you can read
00:33:03
out this complete prompt. Now coming to
00:33:05
the next part. So here after the prompt
00:33:07
guys, the main thing which is coming
00:33:09
which is a toolkit. So we have to write
00:33:11
a toolkit. Okay, inside this toolkit I'm
00:33:13
going to define my four to five tools.
00:33:15
Now this tool
00:33:16
basically it is interacting with the LLM
00:33:20
okay and it is providing a information
00:33:22
based on the logic. So inside the tool
00:33:24
guys see how many tools we have. First
00:33:26
of all let's take a walk through of it.
00:33:28
So we have this we have this tool class
00:33:30
okay uh this we are getting from that
00:33:32
len itself. So we are using as a
00:33:34
decorator on top of the function and we
00:33:36
are creating a custom tool over here. So
00:33:38
what this tool is taking let's try to go
00:33:40
through with it and I will show you the
00:33:42
complete execution inside the notebook.
00:33:44
First of all, let me put out the code.
00:33:46
Okay. Uh as I told you in a appropriate
00:33:48
file. So here the we have a first rule
00:33:51
which is check availability by the
00:33:52
doctor. Then the second is a check
00:33:54
availability by the specialization. Then
00:33:56
we have a third one which is a site
00:33:58
appointment. Okay. Then fourth one is a
00:33:59
cancel appointment. Uh then we have a
00:34:02
fifth reschedule appointment. So in
00:34:04
total we have five tools. And here you
00:34:06
can see what we are passing to the tool.
00:34:08
We are passing to the desired date and
00:34:09
the doctor name. Okay. To this tag
00:34:11
availability by the doctor. And here is
00:34:13
a complete logic behind uh the inside
00:34:15
this tool. Okay. Now what it is going to
00:34:17
be written we'll look into some time.
00:34:19
Now here we have next tool check
00:34:21
availability by the specialization. So
00:34:22
we are giving a desired date. Okay. And
00:34:24
we are validating this date using this
00:34:25
date model as I already told you. So
00:34:27
this user user input date we are going
00:34:29
to be validated. Here is a
00:34:31
specialization right according to the
00:34:32
specialization we have written a logic
00:34:34
over here. Then we have a next one which
00:34:36
is a site appointment. So again we are
00:34:37
giving a date time model and here you
00:34:40
can see identification number and we are
00:34:41
giving a doctor name and we are setting
00:34:43
the appointment. If you want to cancel
00:34:44
the appointment so again we are giving a
00:34:46
date time and here we are giving a ID
00:34:49
number and we are giving a doctor name
00:34:51
and we are going to be cancel the
00:34:53
appointment. Now reschedule appointment
00:34:54
is also there right. So this tool is
00:34:56
helping to me for performing a several
00:34:59
task and whatever agents we have created
00:35:02
it will interact like the LLM model
00:35:04
frequently is going to be interact to
00:35:06
the appropriate tool and it is providing
00:35:07
me a result. I hope this toolkit is
00:35:09
clear. Now coming to the next part. So
00:35:11
guys we are going to define our LLM
00:35:13
model as well. So instead the utils I
00:35:15
will keep my LLM. Okay. So here let me
00:35:18
keep my lm. Now see so I created one
00:35:22
class for the llm model. The class name
00:35:23
is LM model itself. And here we are
00:35:26
passing a model name. Okay, it could be
00:35:27
a configurable model means uh it this
00:35:30
model name could be could come from any
00:35:32
configurable file. You can create any
00:35:34
JSON file or any AML file from there you
00:35:36
can pick it up instead of passing it
00:35:38
over here. But just for the sake of
00:35:40
simplicity here only I pass this
00:35:41
particular model name. Now I'm checking
00:35:43
whether model name is there or not. If
00:35:45
it is not there I will raise the error
00:35:47
otherwise I'm taking a model name and
00:35:49
I'm initializing the model name and
00:35:50
using this particular method I'm going
00:35:52
to be return it. Okay, this openai
00:35:53
model. Now here is what here is my LLM
00:35:56
model. Okay, this is just a testing
00:35:57
file. Uh you can run this file
00:35:59
individually and you can test whether
00:36:00
your model is working fine or not. I
00:36:02
already tested my model is working fine
00:36:04
and here guys what I have done I
00:36:06
mentioned the API keys where I mentioned
00:36:08
the API key. I mentioned the API key
00:36:10
inside this env. Okay. So in the same
00:36:12
way you have to mention it. See I have a
00:36:14
so many API key lengchen Google tably
00:36:17
but these all the API key is not
00:36:18
required for this particular project.
00:36:20
only this API open API key is required
00:36:22
for this particular project. Okay. Now
00:36:25
coming to the next part. So I think so
00:36:27
this API key is fine. Uh now along with
00:36:30
the API key right? So if we're talking
00:36:32
about the API key guys. So along with
00:36:36
the API key what all information is
00:36:37
required? Uh I think uh okay so what uh
00:36:41
what all thing is required guys this
00:36:43
exception handling and all for that also
00:36:44
we can create a separate folder over
00:36:46
here. The exception handling py and we
00:36:49
can create a logger. PY. So later on I
00:36:51
will show you I I was thinking about it
00:36:52
but I couldn't create that because of
00:36:54
the time constant but uh for sure in the
00:36:56
next video or in the next like tutorial
00:36:58
I will show you that exception handling
00:37:00
and the logger as well. Okay then we
00:37:02
have a next one which is a agent. py
00:37:04
okay this agent. py is containing all
00:37:06
the agents right so let me show you this
00:37:09
particular code as well regarding the
00:37:10
agents py and here guys this is a
00:37:12
complete code and you can you can see
00:37:15
guys I I created what I created this uh
00:37:17
like the custom class what is my custom
00:37:20
class name my custom class name is a
00:37:22
doctor appointment agent now inside this
00:37:24
doctor appointment agent we have three
00:37:25
main agent okay let me show you the
00:37:27
agent the first agent is a supervisor
00:37:29
node the second agent itself is a
00:37:32
information node okay and here the third
00:37:34
one is a booking node. So this
00:37:36
supervisor node what it is doing it is
00:37:38
going to be delegate the task from one
00:37:40
uh from like whenever it is taking a
00:37:42
input it's going to be delegate either
00:37:43
to the information agent or to the
00:37:45
booking agent. Okay. So to get a better
00:37:48
understanding so you can look into this
00:37:50
particular architecture your doubt will
00:37:52
be clarified then guys here what you can
00:37:54
see. Okay let me check it is giving me
00:37:56
error. Is there any issue with the input
00:37:59
statement toolkits is there? Okay it is
00:38:01
a toolkit. Uh it's a tool toolkit
00:38:06
toolkits. Okay. So I missed this as and
00:38:09
because of that I was guessing getting
00:38:10
getting a issue. So let me check out the
00:38:13
spelling now. So is it is tool kits not
00:38:17
tools kit. Now it is perfect. Now see
00:38:20
here guys we are not getting any sort of
00:38:21
error and everything is fine over here.
00:38:24
So guys I'll give you the quick overview
00:38:26
of this particular supervised node and
00:38:29
all. I'll show you this code inside the
00:38:30
IP bind file. As of now just uh you can
00:38:33
pause the video and you can take a look
00:38:35
on top of it what I have written and
00:38:37
here is my information node and the
00:38:39
booking node as well. I I'll show you
00:38:40
each and every line of code. Don't
00:38:41
worry. Now inside this particular class
00:38:43
I have created one more class one more
00:38:45
function. The function name is a
00:38:46
workflow and inside this workflow we are
00:38:48
going to mention this nodes and ages and
00:38:51
all. Okay. So what will be my node and
00:38:53
what is my ages? So I I mention over
00:38:55
here and this notes means it is
00:38:58
representing the function right and uh
00:39:00
and here the ages is nothing it's
00:39:02
representing a connectivity between the
00:39:04
function I no need to write all the
00:39:06
conditional statement and all why
00:39:07
because here I mentioned this command in
00:39:09
return a statement and uh according to
00:39:12
that it is all it is like it's going to
00:39:15
be map okay from node to node the
00:39:17
conditional and all everything so we
00:39:19
just need required this command module
00:39:21
and even I have explained you this thing
00:39:22
in my previous tutorial as how this
00:39:24
command module is working. If you want
00:39:26
to get a detail of this command module,
00:39:28
you can check out with my previous
00:39:29
video. Now coming to the next part. So
00:39:31
guys, this is done. Okay, I think my
00:39:33
back end code is completed. Now what I
00:39:35
have to do, I have to write my front end
00:39:37
code. Okay, so I'm going to write my
00:39:38
front end not with the HTML or not with
00:39:40
the CSS. Okay, so here we are going to
00:39:43
be write that front end code using the
00:39:44
HTML only. So let me show you the front
00:39:47
end code how it looks like. So here is
00:39:49
my front end code guys. I'll give you
00:39:50
the walk through of the entire code. No
00:39:52
need to worry. So here see what we have
00:39:54
we have a title okay this title will be
00:39:56
represented then we have a user ID and
00:39:58
query which we are taking from the inh
00:40:01
from the user only and then here is my
00:40:02
button right so whenever we'll submit
00:40:04
this button this will hit the API okay
00:40:07
this API we are going to be create using
00:40:08
the fast API itself so after that I'll
00:40:11
show you the API as well how we can
00:40:12
create a API so this will hit to the API
00:40:15
and here is my API URL this one and
00:40:18
after that if it is getting response
00:40:20
code is 200 from that particular API In
00:40:22
that case we are getting a response back
00:40:24
and we are going to be represent this
00:40:26
response back we are going to be write
00:40:27
it over here. Yeah like this is very
00:40:29
simple code I think you can
00:40:30
understanding just by reading this
00:40:32
entire code and now what we are doing.
00:40:34
So here we are going to be create a API.
00:40:36
So inside this main py file I'm going to
00:40:38
be write a code for the API for the API
00:40:40
creation. So guys uh here let me show
00:40:42
you the code for the API creation how it
00:40:44
looks like. So this API we are going to
00:40:46
be create using the fast API itself. So
00:40:48
we are going to be import the fast API.
00:40:50
Here we are going to be import this base
00:40:52
model. Okay, this is for the this is for
00:40:54
the py object. Here is my doctor
00:40:56
appointment agent and here you can see
00:40:58
my human message and OS. Now uh this is
00:41:01
uh okay so here guys I mentioned this
00:41:03
SSL certificate file. If you're getting
00:41:05
any SSL related issue you can mention
00:41:07
this particular file because what we are
00:41:08
doing it guys we are running it over the
00:41:11
we are exposing the API. So it sometime
00:41:14
it shows this particular issue if you
00:41:16
have a antivirus or something inside
00:41:17
your system but for the production
00:41:19
system it is pretty much required this
00:41:21
SSL certificate okay for the security
00:41:23
reason so we will see if we are going to
00:41:26
be deploy any sort of a project over the
00:41:28
cloud now what I'm doing here I'm going
00:41:30
to be create a object of the fast API
00:41:32
class and here is my class guys user
00:41:34
query and here I'm importing the base
00:41:36
model you can see we we have ID number
00:41:38
and message so this two thing we are
00:41:40
going to be validate whatever user is
00:41:42
passing right in a in a text form sorry
00:41:45
inside a text field right so those thing
00:41:47
we are going to be validate using this
00:41:48
pentic model now here is my agent okay
00:41:51
this agent needs to be called so where
00:41:53
we are calling this particular agent so
00:41:54
we are calling inside this particular uh
00:41:57
route okay so let's execute so inside
00:41:59
this let's execute we are getting a
00:42:01
query here we are going to be initialize
00:42:02
a workflow okay as see we got a workflow
00:42:05
so this is my all the input data which
00:42:07
we need to pass to the workflow okay and
00:42:09
here guys you can see we have a input
00:42:11
this is a message from the user. Here is
00:42:13
my query data. So we are going to be
00:42:15
form this JSON object sorry this uh
00:42:17
dictionary basically. Why it is
00:42:18
required? Because this all the key is
00:42:20
available in the pyic class which we
00:42:22
have defined message ID next query
00:42:25
current reasoning and all. So in this
00:42:27
particular format only we'll have to
00:42:28
provide a data. So here is my message
00:42:30
which is a input only. Here is my ID
00:42:32
number. Here you can see the ID number.
00:42:34
We are validating using this uh
00:42:36
basically user query only. And uh here
00:42:38
you can see we are going to be uh
00:42:40
validate this user input using this
00:42:43
message key. Right? So I hope so this
00:42:45
everything is perfect. Now we are
00:42:47
passing this particular thing to the
00:42:48
application
00:42:50
app.graph.invoke and whatever response
00:42:52
we are getting from our workflow we are
00:42:54
going to return it back to the
00:42:56
streamllet UI over here. Okay. Now we'll
00:42:58
be getting a response and we are going
00:43:00
to be write it down over the UI. Okay.
00:43:03
Using this st.right. I hope so guys this
00:43:06
entire code is clear. I kept the code in
00:43:08
the appropriate files and folder. Now
00:43:11
let's take a look on top of this
00:43:13
notebook. Let's try to understand this
00:43:15
code in a little depth and then we'll
00:43:17
try to execute it and we'll see the
00:43:19
response. So where is my notebook guys?
00:43:21
First of all, let me close this entire
00:43:23
file and let me open the notebook and
00:43:26
here you will get a nitty-gritty detail
00:43:28
of each and
00:43:29
everything each and everything of this
00:43:32
code. So yeah, I think I selected the
00:43:34
environment also. So let's try to
00:43:36
understand this code. So first guys,
00:43:39
let's import all the uh modules. Uh here
00:43:43
I'm going to be loaded. Then uh here I'm
00:43:45
going to load my environment variable
00:43:48
using this load env. Uh then guys I here
00:43:51
I'm going to setting up the openi key.
00:43:54
Okay. And then after setting up see here
00:43:56
is my open key. Let me delete it. Then
00:44:00
I'm going to set it up as a environment
00:44:02
variable. Now here I'm going to
00:44:04
initialize my open air model which is
00:44:06
GPD40. And now here I'm going to test it
00:44:08
whether it is working fine or not. So
00:44:10
everything is working fine uh so far.
00:44:12
Now let's try to understand about this
00:44:14
data time model. Uh so this I already
00:44:16
explained you. Now let me show you how
00:44:18
it is validating the date. So this is
00:44:22
fine. Uh this date model is also fine.
00:44:24
Now identification number is also there.
00:44:26
This is also perfect. Now here is my
00:44:28
tool. Uh so let's try to check out this
00:44:30
tool. uh let's try to call this tool and
00:44:33
then we'll get a better understanding.
00:44:34
So what we need to pass over here we
00:44:36
need to pass the desired date whenever
00:44:38
we have to check the availability of the
00:44:40
doctor and here is a doctor name. So
00:44:42
literal means what literal is just
00:44:44
representing to the type hinting. Now
00:44:46
here you can see we have the DF dot read
00:44:51
CSV we are going to read the data. Now
00:44:53
here what we are going to do we are
00:44:54
going to be segregate the date and time.
00:44:56
Okay. And here this is my logic based on
00:44:59
this particular logic what we are doing.
00:45:00
we are going to be check the
00:45:02
availability. So uh what I have written
00:45:04
over here. So here we are going to be
00:45:06
split the date first. Okay. Uh then we
00:45:09
are matching it with the desired date
00:45:11
whether the date is matching or not. If
00:45:13
the date is available along with this we
00:45:15
are going to be check the doctor name.
00:45:17
See here is a doctor name. Then we are
00:45:20
checking doctor is available or not. If
00:45:22
it is available then what we will give?
00:45:23
We'll give the time slot. Okay. So this
00:45:26
is my filter condition which I'm going
00:45:27
to be apply. You can go through with it
00:45:30
and you can understand but whatever I
00:45:32
explain you I think you got the idea
00:45:34
that how it is working. So we are
00:45:36
combining multiple condition here you
00:45:37
can see desired date with the available
00:45:39
date whatever date is there then here is
00:45:41
my doctor name and here is my
00:45:43
availability here is availability of the
00:45:45
doctor and according to that I'm
00:45:46
providing the date and time slot so if
00:45:49
row is equal to zero in that case there
00:45:51
is no availability in the entire day
00:45:52
with respect to the doctor if it is
00:45:54
there then here we are returning a
00:45:56
output. So let's see how the output
00:45:58
looks like. So let me pass the date over
00:46:00
here. So I'm passing this particular
00:46:01
date and see uh see guys. Uh here I'm
00:46:04
checking how the date looks like. Okay,
00:46:06
we are checking with the date model
00:46:07
only. Then uh here I'm going to call it.
00:46:11
So once I will call it guys, so see this
00:46:13
is all the time slot when the doctor is
00:46:15
available. So 8:00, 8:30, 11:30, 12:00,
00:46:18
12:30. So this doctor is available at
00:46:20
this particular time slot at the given
00:46:22
date. I hope this is clear. Now let's
00:46:25
try to check by the specialization or
00:46:28
let's say there is some person which
00:46:29
don't know the doctor name but they are
00:46:31
they want they want to know their
00:46:33
problems. So let's say someone want to
00:46:34
search dentist, cosmetics, dentist or
00:46:37
the uh
00:46:39
proist. Okay. Now here is a pediatric.
00:46:42
So there is a different different
00:46:43
occupation which I mentioned over here
00:46:45
inside the uh list itself right inside
00:46:48
the specialization. So uh let's see what
00:46:51
is happening. So again it is reading a
00:46:52
data. Now here again we are going to be
00:46:54
segregate the date and time right and
00:46:56
then what we are doing so we are
00:46:57
checking. So here is a condition. So if
00:47:00
the specialization is getting match if
00:47:01
the date is getting match if the uh
00:47:04
availability is there in that case we
00:47:06
are going to be group all this thing
00:47:08
right and then we are giving it back. So
00:47:11
here we have written one more additional
00:47:13
thing. So here is what here is a convert
00:47:15
to A.M. to PM. Okay, because you can see
00:47:18
in some time basically uh the this that
00:47:21
is from 0 to 24, right? So in that case
00:47:24
we have to convert from A.M. to P.M. So
00:47:26
let's say we are talking about the P.M.
00:47:28
right? So it is from 12 night uh sorry
00:47:31
12 noon to 12 night. And if we are
00:47:33
talking about AM so it is from 12 night
00:47:34
to 12 noon right? So this is what we are
00:47:37
going to be perform over here. Now how
00:47:38
you will get your output? Let me show
00:47:40
you. So here is my date. Again I'm
00:47:42
checking with my patient object. Now
00:47:44
here I'm checking with the availability.
00:47:45
Okay. by the specialization. So see here
00:47:47
you are getting availability. So you're
00:47:49
getting 8:00 a.m. uh 11:30 p.m. then 2
00:47:52
p.m. Okay, because inside the data they
00:47:54
haven't given this particular thing. If
00:47:55
you will go and check with the data
00:47:56
itself. So see there there is no A.M. PM
00:47:59
something like this. So from where from
00:48:02
which time uh like which is representing
00:48:05
to AM from and which time it is
00:48:07
representing to A.M. sorry PM. So
00:48:10
everything detail I have added over here
00:48:12
programmatically only. So where it is
00:48:14
inside this IP1B file. I hope you
00:48:16
understood this entire thing. Now let's
00:48:18
try to test the next tool. So the next
00:48:20
tool is re reschedule the appointment.
00:48:22
So before rescheduling the appointment,
00:48:24
you will have to understand two more
00:48:25
tool which is cancel appointment and set
00:48:27
appointment. Okay. So let's understand
00:48:29
this cancel appointment how it is
00:48:30
working. So if I want to cancel the
00:48:32
appointment for any sort of a doctor. So
00:48:34
here what I'm doing I'm passing my date
00:48:36
and time model. Okay. Inside a date and
00:48:38
time model I would be having date and
00:48:39
time both. Then here is my
00:48:42
identification number. Okay. Uh
00:48:44
identification number you will get when
00:48:46
when you are going to be set the
00:48:47
appointment. So here I want to cancel
00:48:48
the appointment. So identification
00:48:50
number would be required. So this is
00:48:51
also I'm going to validate using this
00:48:53
identification number model. Then here
00:48:55
is my doc doctor name to which doctor
00:48:57
I'm going to be cancel the appointment.
00:48:58
Okay. Now uh I gathering all the
00:49:01
information. Now here is my data. Now
00:49:03
case to move. Right. So if I want to
00:49:05
cancel the appointment. So first I'm
00:49:07
checking with the date patient to
00:49:09
attend. Okay. this id and the doctor
00:49:11
name. So if it is going to be match this
00:49:14
all the thing is going to be match. So
00:49:15
what we are doing see if is not going to
00:49:17
be match we are getting zero. So here I
00:49:19
return you don't have any specific
00:49:20
appointment. If this thing is going to
00:49:22
be match in that case see here what I'm
00:49:24
doing uh so patient to attend. Okay so
00:49:28
instead of true see uh here you can see
00:49:32
uh just just follow from here df lock df
00:49:35
date slot date is date. Okay. Then here
00:49:38
is a patient to attend is equal to what?
00:49:40
ID number. This is a one condition. This
00:49:42
one. Now the second is what? So sorry.
00:49:45
Third is what? Doctor number. So what
00:49:47
I'm doing instead of this is available.
00:49:49
Okay. Or this patient to attend what I'm
00:49:51
passing true and none. So what is the
00:49:53
meaning of this true and none inside
00:49:55
this particular file? See if there is
00:49:58
true. True means uh basically doctor is
00:50:01
available and here is don't no patient
00:50:03
ID means my doctor is available at this
00:50:05
particular time slot means we are going
00:50:07
to be cancel our appointment. I hope you
00:50:09
understood this logic. Okay. So if there
00:50:13
is a doctor appointment in that case it
00:50:14
would be false and there will be some ID
00:50:16
but if we are going to cancel the
00:50:18
appointment now the doctor will be
00:50:19
available. So it will be representing
00:50:21
false and the ID over here. That's it.
00:50:23
Now we are again giving back to the CSV
00:50:26
only. So, DF2 CSV availability dot CSV.
00:50:31
Okay, let me check out the specific name
00:50:32
with which name we have to create a
00:50:34
file. Uh, I think it is there. So, we
00:50:37
have to create a file with this specific
00:50:39
name. Uh, just a second guys. Let me
00:50:43
mention the file
00:50:45
itself. So, here this would be the
00:50:50
file. I hope this is clear. Just a
00:50:54
second. Let me take a specific path only
00:50:57
and let me paste it
00:51:12
on. Okay, perfect. Now let me execute it
00:51:15
and see uh I'm checking with my daytime
00:51:18
model. Here is my notification number.
00:51:19
Now cancel the appointment. So if there
00:51:22
would be any appointment, so it's going
00:51:23
to be cancelled that. See successfully
00:51:24
cancelled. Okay. Now set appointment
00:51:26
again it's going to do a same thing. So
00:51:29
set appointment means if the appointment
00:51:30
is not there first of all I will take
00:51:33
appointment and then basically I'm going
00:51:35
to be define as a set means I'm going to
00:51:37
put the put my value over there. Let me
00:51:39
show you what all value basically we are
00:51:41
keeping we are going to be set it. Let's
00:51:43
try to trace a logic from scratch. So
00:51:45
first we are going to read the data. Now
00:51:46
here convert date time format. So here
00:51:48
we are going to be convert the date time
00:51:50
format. Okay, means we are checking the
00:51:52
date date and the time it is in a
00:51:54
specific format or not. Okay, if it is
00:51:57
not we will be converting that. Now
00:51:58
after that we are we have a condition
00:52:00
over here. So after the converting and
00:52:03
all see here we have a case then what is
00:52:06
happening? So date time format guys why
00:52:08
we are going to be converted because we
00:52:10
want to be match okay with the same date
00:52:13
time format which is available inside
00:52:14
this particular file. If it is matching
00:52:17
with this date time format means the
00:52:19
appointment is there means what is the
00:52:22
meaning of it the appointment is there
00:52:24
okay and we can set that particular
00:52:25
appointment see over here what we are
00:52:26
doing so we are passing it to this
00:52:28
condition and if it is not matching so
00:52:30
I'm saying no available appointment for
00:52:31
the particular case
00:52:33
okay otherwise here you can see all the
00:52:36
thing is going to be match okay in that
00:52:38
case what we are going to do we are
00:52:40
saying okay this appointment is
00:52:42
available and we are going to be update
00:52:44
inside the file also now I Hope this
00:52:46
thing is clear. See here I'm passing is
00:52:48
available and patient to attend. False
00:52:51
and ID number. So false and ID number
00:52:53
means what? To that particular position
00:52:55
we are going to be passed this false and
00:52:56
ID number means position is there. Okay.
00:52:59
Sorry. Appointment is there. So that's
00:53:01
why it will be representing false and
00:53:02
that ID number. I hope so this thing is
00:53:05
also clear. Now let me execute it. So
00:53:07
guys once you will go through with it
00:53:08
now one by one step by step you will be
00:53:10
getting each and everything. So this
00:53:12
tool by design by me only. And here you
00:53:14
can see we have a reset appointment. So
00:53:15
based on the date and time we are going
00:53:17
to be rescheduled the appointment and
00:53:19
here no available slot for the desired
00:53:21
period. If the condition is not going to
00:53:22
be matched if the condition is going to
00:53:24
be matched then first we'll cancel the
00:53:26
appointment and then again we'll set the
00:53:27
appointment. So this two method cancel
00:53:29
appointment and send appointment
00:53:31
basically it belong to this rescheduling
00:53:33
appointment. Okay let me show you how it
00:53:35
works. So here I'm giving my date and
00:53:36
time and now see here is my new time old
00:53:39
time. Now here is my identification
00:53:41
number. Okay this one and I'm checking
00:53:43
with the rescheduling. So it is saying
00:53:45
no available slot is desired period. So
00:53:47
at this particular time the new time the
00:53:50
available slot is not available. I hope
00:53:52
this thing is clear. Now coming to the
00:53:55
next part. So guys I was talking about
00:53:58
this particular information the member
00:54:00
dict. So here you can see the member
00:54:01
dict. Okay. Uh let me execute it and let
00:54:04
me show you how this member dict looks
00:54:06
like. So just a second guys. Let me
00:54:09
print this particular variable members
00:54:12
and see. So we have two node and this is
00:54:14
the information of this two node. Now
00:54:15
here let me run it and see the all the
00:54:17
option. This is all the option
00:54:19
information node booking node and
00:54:20
finish. Now here let me show you the
00:54:22
working information. So the this is the
00:54:23
working information. Now this particular
00:54:25
information we are going to append
00:54:26
inside the system prompt and I hope so
00:54:28
this is fine right? This is also perfect
00:54:31
to you. Now after this one guys what we
00:54:33
are doing we are going to be uh define
00:54:35
my agents. Okay the main agents. Now
00:54:37
let's try to understand this supervisor
00:54:40
agent. Okay. So to the supervisor agent
00:54:43
what we are doing guys we are passing a
00:54:44
agent state. Uh here you can see we have
00:54:48
already defined the agent state this
00:54:49
one. So what all thing uh what all keys
00:54:52
are flowing throughout the flow
00:54:55
throughout the uh this agentic flow. So
00:54:58
message would be there ID number next
00:55:00
query and reasoning with respect to that
00:55:02
query. Okay. Now uh here uh let me show
00:55:06
you what will happen. So the for see
00:55:08
here uh command is going to be written
00:55:11
this three thing information either
00:55:12
information node revoking node or this
00:55:14
finish right so we are going to print
00:55:16
the state this print statement just to
00:55:18
understand the flow that's it what is
00:55:20
being passed what is not being passed
00:55:21
that's it so here is my message which is
00:55:23
coming so in the message I'm appending
00:55:25
the system prompt I'm appending the user
00:55:27
ID and here is my system message right
00:55:29
so this is a combined message I printed
00:55:32
the message as well now here I'm
00:55:33
checking a query so if uh system message
00:55:36
is equal to one in that case I am taking
00:55:38
a query from there. Okay, means I'm
00:55:40
taking a question. I'm keeping it inside
00:55:42
the query and then I'm passing it to
00:55:45
this uh see what I'm passing to this one
00:55:47
open AI dot openi model with structure
00:55:50
output uh we are passing this message
00:55:53
okay this particular message this entire
00:55:55
message and here I pass the router as
00:55:58
well see what is my router just look
00:56:00
over here look into the router so the
00:56:02
router actually is providing either this
00:56:04
next or this reasoning okay based on the
00:56:06
given message so what it will what it
00:56:09
will what it will sorry what it will
00:56:11
provide. So that particular thing will
00:56:13
go will get inside this go to variable.
00:56:15
Okay, from this response uh next from
00:56:17
this response uh and this next and here
00:56:20
I'm going to print this go to and then
00:56:22
here is I'm going to print my reasoning.
00:56:24
If go to is finished in that case we are
00:56:26
going to uh stop the process. Now below
00:56:29
is my state. So I'm printing the state
00:56:31
as well. Okay. And here guys you can see
00:56:33
what we are doing. So if query is there
00:56:36
means if it if we are running it first
00:56:38
time in that case what we are doing? So
00:56:40
in that case we are passing the go to
00:56:43
means where we have to go right from
00:56:45
this particular stage what will be the
00:56:47
next agent here is my query means my
00:56:49
question here is a reasoning okay and
00:56:51
here is my human message. So why I have
00:56:53
written this query and this why I made
00:56:55
this particular logic because if I'm
00:56:57
passing it first time then only this
00:56:59
identification number this particular
00:57:01
information is required. Okay. Now if
00:57:03
you will look into the second return
00:57:04
statement if query is not there when the
00:57:06
query will not be here see over here if
00:57:08
the message length is more than one
00:57:10
means in the next iteration the message
00:57:12
length will be more than one in that
00:57:13
case the query will not be here. Okay.
00:57:15
So based on this particular message what
00:57:17
I'm getting I will be getting my next
00:57:18
and here whatever reasoning would be
00:57:20
there. So I'm passing this next. Okay,
00:57:22
next means what? To which agent we have
00:57:25
to go and this current reasoning. So at
00:57:27
first time I'm passing this uh
00:57:28
information along with this user ID.
00:57:30
Okay, and this query and then in every
00:57:33
iteration I'm passing the reasoning.
00:57:35
Whatever reasoning is happening based on
00:57:36
the given message and the next node.
00:57:39
That's it. I hope you understood this
00:57:41
logic. Now let me execute it. This is
00:57:43
fine. Information node. Now let me show
00:57:45
you the information node. What is there?
00:57:47
The information node. We have the system
00:57:49
prompt which we have designed according
00:57:50
to the information node. You can pause
00:57:53
this video and you can read out this
00:57:54
particular prompt. Okay. What is there?
00:57:57
So here uh you are a specialized
00:57:59
assistant. Let me do the water app. Let
00:58:01
me see the complete detail. Okay. So
00:58:03
here see you can you can pause the video
00:58:05
and you can read the complete prompt. So
00:58:07
we are passing it to the s we are
00:58:09
passing it to the chat prompt template.
00:58:10
We are creating a prompt template and
00:58:12
then we are creating this react agent.
00:58:14
Okay. It's an inbuilt agent which we are
00:58:16
creating. So we are passing a model open
00:58:18
AAI means this is my open AI model and
00:58:20
here is my check sorry tools. So what
00:58:22
are tools we are passing over here? We
00:58:24
are just passing two tools check
00:58:25
availability by the doctor and check
00:58:26
availability by the specialization and
00:58:28
we are passing the prompt as well. So
00:58:30
whatever information we'll be getting
00:58:32
after this reasoning. Okay this is
00:58:34
individual agent only guys. Okay this
00:58:35
information node. So after the
00:58:37
individual uh sorry after the uh
00:58:39
execution whatever information we'll be
00:58:41
getting. So we are going to be uh return
00:58:43
it using this command. So where it is
00:58:45
going again? It is going to the
00:58:46
supervisor. Now supervisor will take a
00:58:48
decision what needs to be done. And this
00:58:50
is a updated message guys. Okay. Which I
00:58:52
am going to be mention which I mention
00:58:54
over here. Now this is my first thing my
00:58:57
first uh note the child node. This is my
00:58:59
second child node. Okay. So you can read
00:59:01
this about this child node. It is all
00:59:03
about the booking. Just look into this
00:59:04
react agent. Create react agent and you
00:59:07
will get the clearcut understanding over
00:59:08
here what is happening. So see uh first
00:59:11
you can read out the complete prompt.
00:59:13
Okay. I don't know why it is not
00:59:15
working. So you can read out the
00:59:16
complete prompt guys. Here you can see
00:59:19
let me do the right swipe. See uh you
00:59:22
can pause the video you can read it. And
00:59:23
here is I'm creating a prompt and then
00:59:25
this is my react agent. Now to this
00:59:28
react agent we are passing a set of
00:59:30
tools. So set appointment, cancel
00:59:32
appointment and reschedule appointment
00:59:34
because it is my booking in order right
00:59:35
and here it is doing a reasoning and
00:59:37
based on that based on the result we are
00:59:39
updating the agent. Okay that's it. Uh
00:59:42
now uh this is fine. Uh here I'm going
00:59:44
to create my graph. So first is my
00:59:46
supervisor node. Then my information
00:59:48
node then here is my booking node. Okay.
00:59:50
And here I'm going to be start the
00:59:52
process. Here I'm going to compilation
00:59:53
it compile it. Then here is my app. So
00:59:56
how the app will look like? It will look
00:59:57
like this only. Now here is my input
00:59:59
message guys. Uh and here along with the
01:00:01
input see what will be the my input
01:00:03
message. My input message going to be
01:00:05
include this input as well as this id
01:00:07
number. So this is going to become my
01:00:09
state. Now this particular state I'm
01:00:10
going to pass to my invoke app
01:00:12
do.invoke. Okay. Now see guys, it is
01:00:15
working and see the entire uh thing is
01:00:18
going to be execute and once it will be
01:00:19
done I'll be getting my result. So
01:00:21
simply I can print my result. So for
01:00:24
printing a result just a second. Uh let
01:00:27
me give you the
01:00:30
logic. So after running it how you will
01:00:33
be getting a result. So guys sometimes
01:00:35
you might get a accurate information
01:00:37
sometime you might not get. If you're
01:00:38
checking with other model like grog and
01:00:40
all you might get a issue okay because I
01:00:44
seen uh the reasoning capability of the
01:00:46
forro is quite good compared to the
01:00:47
other model. So please be stick with a
01:00:49
good model if you want a good result and
01:00:51
this scenario you can fit your uh you
01:00:53
can fit in your any use case. Okay let
01:00:56
me show you the result. So see here is a
01:00:57
result. So currently there is no
01:00:59
available for the general dentist
01:01:00
whatever question I have asked. Okay.
01:01:02
And here it is giving me alternative
01:01:04
option also. So here yes guys we are
01:01:07
able to achieve our result but this
01:01:10
result basically we are able to achieve
01:01:12
based on this question where we are
01:01:13
checking a booking with the general
01:01:14
dentist on 8 p.m. and 24 2024 at 8:00
01:01:18
p.m. right 8 sorry 8th August 2024 at
01:01:21
8:00 p.m. And this is the complete
01:01:23
result. Now let's see how we can get the
01:01:25
same result over the UI itself. And if
01:01:28
you want guys uh if if I should provide
01:01:30
you the complete uh basically chatbot
01:01:33
kind of UI where you can do the chatting
01:01:35
and all. So I'll provide you that as
01:01:36
well. Now first of all what we have to
01:01:38
do guys we have to execute this entire
01:01:40
code. Let me show you how we can execute
01:01:42
it. So open the terminal and here the
01:01:45
terminal let uh here you have to do the
01:01:48
split terminal. Okay just click on this
01:01:50
split terminal get bash only and the new
01:01:52
terminal is getting open. Let me clean
01:01:54
it clear it first of all. So here I'm
01:01:56
going to be up my streamlit UI first.
01:01:59
Okay. So let me up my streamlit UI. How
01:02:04
to do that? Let me show you. And here
01:02:06
guys, I will up my uh fast API. Okay. So
01:02:11
here I'm going to write my uh command
01:02:13
source activate
01:02:16
dot s o ur source activate dot / venb.
01:02:23
Okay. Now yes my environment is ready.
01:02:27
Now what I will do guys I'll be writing
01:02:29
a command over
01:02:31
here. Okay so guys here I written a
01:02:34
command you can see streamlit run
01:02:36
streamlit ui.py. This is a command for
01:02:39
upping the server for running the
01:02:41
server. This is streaml and here is a
01:02:43
command for running the server of this
01:02:44
fast API. So ubicon main is my file
01:02:47
name. App is a app inside this main. py
01:02:50
file. reload it will automatically
01:02:52
reload it if it is going to be detect
01:02:54
any sort of a change and here is a port
01:02:56
okay on which port I'm running it so by
01:02:58
default it will take 8,000 port so if I
01:03:00
I already executed my code on top of
01:03:02
that it was running over there so that's
01:03:03
why I'm mentioning the other port right
01:03:05
so guys uh here whenever you are going
01:03:07
to be write any sort of a port over here
01:03:08
so please make sure that you are going
01:03:10
to be write a same port inside your API
01:03:11
URL as well okay otherwise it will give
01:03:14
you the issue it will not hit the same
01:03:16
API let me execute and let me see
01:03:18
whether it is working fine or not so
01:03:20
first I'm going to up my streamlet UI.
01:03:22
So here uh it is getting execute. Let's
01:03:25
see whether it is working or not. And
01:03:28
then uh here I'm going to execute my
01:03:31
fast API also. Okay. So yes guys, uh I
01:03:36
think it will up just a second. Let me
01:03:38
show you
01:03:39
that. Uh give me a moment guys.
01:03:43
Okay. Yeah. So it is asking for the
01:03:45
allow. Uh let me share that UI on top of
01:03:49
this
01:03:50
screen. Give me a
01:03:52
moment. Yeah guys.
01:03:57
So here is a UI. Uh wait where it is
01:04:08
representing. Yeah perfect guys. So I
01:04:10
got a UI over here and see this is my
01:04:16
UI. Okay. Now what I have to do I have
01:04:20
to execute this fast API also. So let me
01:04:23
execute this fast API. And uh here it is
01:04:27
running. It will only up sorry it will
01:04:30
also up. Just a
01:04:32
second. So the code is loading.
01:04:38
It takes time guys if you're running it
01:04:40
first time now. It takes time.
01:04:52
Okay. Okay. So, perfect. My fast API is
01:04:56
also up. It is on a different port. So,
01:04:59
here is a URL. Once you will click on
01:05:01
this URL, you will get that fast API
01:05:05
also. Okay. So just a second let me
01:05:08
check it out whether it is up or not. So
01:05:10
yeah it is up. Now guys here what you
01:05:12
have to do you have to write this /
01:05:14
docs. So you will get your uh swagger
01:05:17
UI. Okay. Now see this is your swagger
01:05:19
UI and here you can see your endpoint
01:05:22
this one. So you you have to hit uh this
01:05:25
particular endpoint this uh 127.0.0.1
01:05:30
0.1 col 80002 /
01:05:34
docs/ this one execute only. Okay, docs
01:05:37
is not required. No need to write a
01:05:38
docs. It is just to check with a swagger
01:05:40
UI only. Okay, if you're going to be
01:05:42
write slcute only. So it will
01:05:45
automatically hit this particular
01:05:46
endpoint. Now let me show you how to hit
01:05:48
that. So first of all uh let me take a
01:05:51
same question. So I'm going to take a
01:05:53
question guys. Let me check whether I'm
01:05:55
getting a same response or not. So where
01:05:58
I kept the question in my IPB file. So
01:06:01
here is my IPB and what question I took.
01:06:06
This was my question. Okay. No need to
01:06:08
mention this thing. Uh you just need to
01:06:10
mention the ID and this particular
01:06:12
question. Everything will work for you
01:06:14
as expected. If you want to me to create
01:06:17
a uh basically a separate video with a a
01:06:22
proper UI uh definitely I will do that.
01:06:24
So here I will put this question and
01:06:27
here I will put my uh ID. Okay, you can
01:06:30
put anything. Uh I I'm just testing with
01:06:32
the same question whether it is working
01:06:35
or not. So let me take the ID also.
01:06:40
Okay, but feel free to check out with
01:06:42
any sort of a uh ID or a question. Uh
01:06:45
for sure it's going to work if you have
01:06:47
write a code according to me. Now what
01:06:49
I'm doing guys, I'm submitting the
01:06:50
query. So it is going to the fast API.
01:06:53
Let's see whether everything is working
01:06:55
fine or not. Over the console itself you
01:06:56
will you can check it. See over the
01:06:59
console everything is going to be
01:07:00
execute guys in a back end. Now what I
01:07:02
will get if everything is perfect. So
01:07:04
here I will get my final answer. So
01:07:06
let's wait for the final answer and uh
01:07:10
yeah let's wait for
01:07:13
that. All right guys, so our code
01:07:16
execution is completed and uh here it is
01:07:19
returning some output over the UI. Let's
01:07:21
see what it is going to return. Uh so
01:07:24
here is the output guys. See it is
01:07:25
returning a complete uh uh JSON itself
01:07:29
and I think the specific slot is not
01:07:31
available because of that. So just look
01:07:33
into the add answer the last answer. See
01:07:36
it it is saying I'm sorry for the
01:07:37
inconvenient but this there is no
01:07:39
accessing availability information at
01:07:40
this moment. Okay means with respect to
01:07:43
the doctor there is no available slot
01:07:45
because of that it is giving me this
01:07:46
particular information. It is adding
01:07:48
some more information inside the hand
01:07:49
message. So you can tweak that according
01:07:51
to your prompt and all. Okay. Now uh
01:07:54
guys if you want the answer only this
01:07:56
particular answer. So what changes you
01:07:58
will have to make inside the code. So uh
01:08:01
just uh look out look into the code and
01:08:05
inside the code go with your streamllet
01:08:06
dot
01:08:08
streamllet_UI. And here instead of this
01:08:10
message write message one. So it will
01:08:12
only give you the last message. Okay.
01:08:14
And you can print the content and all
01:08:15
something like that. so that you will be
01:08:18
able to get your message only right over
01:08:20
here. So I'm leaving it up to you. You
01:08:22
can test it out again with a different
01:08:23
different query. And one more thing here
01:08:26
inside this particular application along
01:08:28
with the exception and logging you can
01:08:30
mention one more concept that is human
01:08:33
in loop. I already shown this thing in
01:08:35
my previous video. So if you will go and
01:08:37
check with my YouTube channel there you
01:08:38
will find out the human in loop concept.
01:08:41
Okay, you can incorporate that human in
01:08:43
loop inside. So just look into this
01:08:45
particular uh uh this particular
01:08:48
basically playlist. Okay, you'll find
01:08:51
out all the videos. So yeah, this is it
01:08:53
for this particular video guys. I hope
01:08:55
you like this session and I created this
01:08:58
project by myself. There are lots of
01:09:00
effort. So if you're liking this content
01:09:02
then you can hit a like button. You can
01:09:04
subscribe the channel and uh soon I'll
01:09:07
be uploading couple of more video with
01:09:08
respect to the multi-agenting and all. I
01:09:10
will try to explore couple of more
01:09:11
framework with a different different
01:09:13
concept of the generative AI. So yeah,
01:09:16
bye-bye. Thank you. Take care. I'll see
01:09:18
you in the next video.

Description:

In this video, we demonstrate a fully automated, end-to-end multi-agent AI system for booking doctor appointments. Using agentic AI, each agent handles a specific part of the process — from understanding the user's request to finding available doctors and scheduling the appointment. This showcases the power of AI agents working together to complete complex tasks without human intervention. What You'll Learn: ✅ Understanding Multi-Agent Systems: How multiple AI agents can collaborate, specialize, and communicate efficiently. ✅ Role of a Supervisor Agent: How a central supervisory agent can oversee and coordinate multiple agents, ensuring task delegation, monitoring, and execution. ✅ LangGraph Implementation: Using LangGraph to design, connect, and control multiple agents with structured workflows. #langchain LangGraph Don't miss out; learn with me! P.S. Don't forget to like and subscribe for more AI content! PDF: https://github.com/sunnysavita10/langgraph-end-to-end/tree/main/multiagent_system End-to-End-Langgraph-Project: https://github.com/sunnysavita10/doctor-appoitment-multiagent Multimodel RAG Playlis: https://www.youtube.com/watch?v=7CXJWnHI05w&list=PLQxDHpeGU14D6dm0rmAXhdLeLYlX2zk7p&pp=gAQBiAQB RAG detailed Playlist: https://www.youtube.com/watch?v=wTVTkOb3SZc&list=PLQxDHpeGU14Blorx3Ps1eZJ4XvKET1_vx&pp=gAQBiAQB GenAI Foundation Playlist: https://www.youtube.com/watch?v=ajWheP8ZD70&list=PLQxDHpeGU14D7NiPgqxC9qhKkx4jMQcDk&pp=gAQBiAQB Connect with me on Social Media- LinkedIn : https://www.linkedin.com/in/sunny-savita/ One to One Call: https://topmate.io/sunny_savita10 GitHub : https://github.com/sunnysavita10 Telegram : https://t.me/aimldlds

Mediafile available in formats

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

question iconHow can I download "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent" video?arrow icon

    http://univideos.ru/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

    The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

    UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

    UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

question iconWhich format of "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent" video should I choose?arrow icon

    The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

question iconWhy does my computer freeze when loading a "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent" video?arrow icon

    The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

question iconHow can I download "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent" video to my phone?arrow icon

    You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

question iconHow can I download an audio track (music) to MP3 "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent"?arrow icon

    The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

question iconHow can I save a frame from a video "LangGraph:21 End-to-End Supervisor Multi-Agentic AI Project for Booking Doctors Appointment #aiagent"?arrow icon

    This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

question iconHow do I play and download streaming video?arrow icon

    For this purpose you need VLC-player, which can be downloaded for free from the official website https://www.videolan.org/vlc/.

    How to play streaming video through VLC player:

    • in video formats, hover your mouse over "Streaming Video**";
    • right-click on "Copy link";
    • open VLC-player;
    • select Media - Open Network Stream - Network in the menu;
    • paste the copied link into the input field;
    • click "Play".

    To download streaming video via VLC player, you need to convert it:

    • copy the video address (URL);
    • select "Open Network Stream" in the "Media" item of VLC player and paste the link to the video into the input field;
    • click on the arrow on the "Play" button and select "Convert" in the list;
    • select "Video - H.264 + MP3 (MP4)" in the "Profile" line;
    • click the "Browse" button to select a folder to save the converted video and click the "Start" button;
    • conversion speed depends on the resolution and duration of the video.

    Warning: this download method no longer works with most YouTube videos.

question iconWhat's the price of all this stuff?arrow icon

    It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.