I was talking to one of my student working in a top product based company,
she mentioned she was working on a Gen AI project where, they need to query a database using natural text.
So, I thought its a really good idea to include this use case as part of my Gen AI program, and in fact I just released this for my students today.
I want to give you all an idea on how to approach this problem.
This is a perfect use case for Agentic approach.
This uses a Agent with access to 2 tools - Schema Getter tool to get the tables in DB with column names and Data types - Query Runner tool to run the SQL query on DB.
when someone gives a query like "I want to know the total sales in last quarter"
step 1 - This query goes to the LLM, Now LLM is intelligent enough to understand that it needs to call the schema getter tool to get the schema.
step 2 - The schema getter tool gives the schema to the LLM.
step 3 - The LLM generates a SQL based on this schema.
step 4 - LLM is intelligent enough to invoke the query runner tool
step 5 - query runner tool runs the query on the DB & returns the output to LLM
step 6 - LLM refines this to make it more presentable & gives back to the user.
so we can see that we binded a few tools (in this case 2 tools) with our LLM.
We are not have a if else kind of logic, rather LLM decides on what to do next.
A important point to note, the tools always give their output back to LLM, and then LLM decides what to do next.
In case if you were thinking what Proof of concept to develop on Gen AI, then you can go with this.
I hope you found this informative!
In my next post I will talk about Multi Agent Architecture.
Sumit Mittal
I was talking to one of my student working in a top product based company,
she mentioned she was working on a Gen AI project where, they need to query a database using natural text.
So, I thought its a really good idea to include this use case as part of my Gen AI program, and in fact I just released this for my students today.
I want to give you all an idea on how to approach this problem.
This is a perfect use case for Agentic approach.
This uses a Agent with access to 2 tools
- Schema Getter tool to get the tables in DB with column names and Data types
- Query Runner tool to run the SQL query on DB.
when someone gives a query like "I want to know the total sales in last quarter"
step 1 - This query goes to the LLM, Now LLM is intelligent enough to understand that it needs to call the schema getter tool to get the schema.
step 2 - The schema getter tool gives the schema to the LLM.
step 3 - The LLM generates a SQL based on this schema.
step 4 - LLM is intelligent enough to invoke the query runner tool
step 5 - query runner tool runs the query on the DB & returns the output to LLM
step 6 - LLM refines this to make it more presentable & gives back to the user.
so we can see that we binded a few tools (in this case 2 tools) with our LLM.
We are not have a if else kind of logic, rather LLM decides on what to do next.
A important point to note, the tools always give their output back to LLM, and then LLM decides what to do next.
In case if you were thinking what Proof of concept to develop on Gen AI, then you can go with this.
I hope you found this informative!
In my next post I will talk about Multi Agent Architecture.
2 months ago | [YT] | 65