The final step is to create.
An agent brings everything together now with the FastTrack as agent and tools manager.
We're also adding conversational memory if there is any.
So in this case here we have generator.
We first have this agent as the base class.
It needs generator.
That is the generator we have defined up here.
The FY 35 vision generator.
Then here we have the prompt template which is the prompt template here.
And then the tool that we have specified is a nutritional tool all the way up here which uses this description
to invoke this tool.
And then the conversational memory.
And then we invoke this multimodal agent and we ask a question what is the fat content of the protein
bar.
And then we get the response back and we print this.
So let's go ahead and run this.
So we got the response back.
Let's analyze this.
So the thought was I need to find out the fat content of the protein bar.
That was the question being asked.
So now it invoked the tool which is nutrition tool here.
It determined that this is the right tool for me to find the data, and then it passed the input to
the tool as protein bar.
It determined from this entire content that I need to pass protein bar as an input.
And then internally this is the prompt.
This is what the retrieval fetch from the in-memory vector storage with image that we went through before.
Now once it processed all of this it there was another thought I have found the fat content of the protein
bar.
So what happened here is it found the necessary information.
And I got the final answer here.
As the protein bar has eight grams of fat per serving.
And then this is how the entire execution of the agent went through.
So going back to the media Amazon.com image, I noticed that total fat is eight gram, which matches
our response from the model that the protein bar has eight grams of fat per serving.
So now let's go ahead and try a more complex query that requires some multi-hop reasoning.
So here I'm asking a little more complex question.
That is which one has more protein?
Protein bar or yogurt?
So technically what the model has to do is is has to first get the protein information from the protein
bar image, then get the information about the yogurt.
And then compare the two and then give the result right.
So let's see how well it performs in a multi-hop execution.
The final answer is that the yogurt has 18g of protein per serving, which is more than protein bars
14g per serving.
So let's go first here and see how much of the protein the bar has.
It's 14g.
And then I'll open the image for yogurt.
So this is another image.
Let me zoom in.
And here's a protein 18 gram versus the protein bar has 14 gram.
So now let's go ahead and understand and analyze the output.
The agent here said the thought I had to compare the protein content of protein bar and yogurt.
So the first step it took was it took the protein nutritional tool as a tool and passed the protein
bar and found the response as yogurt has 18g of protein per serving.
Then it invoked the same tool for protein content of yogurt.
Then for that, it figured out that it has 14g per serving.
Now, in second step is I need to compare the protein content of a protein bar and yogurt where it compared
the two, and then the yogurt has 18g of protein per serving, which is more than protein bars 14g per
serving.
So it did a lot of hops here by going first to the yogurt.
Sorry, protein bar extracted the data and then went to the yogurt image, extracted the data, and
then compared the two and give up with the final answer.
We in this particular video, we went through the entire execution of a multi agentic application with
Multi-hop and react reasoning.
In our next video, we will go over executing multiple tools and have a follow up on this particular
example.
And then we'll have one more tool.
Then the agent will be able to effectively invoke the correct tool that is needed for the task to be
done.
Thank you.
I'll see you in the next.