Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

I need to retrieve my data from my database using Gemini AI

I need to retrieve my data from my database using Gemini AI. I need to pass my cloud data to Gemini AI and need  to get the data.

1 5 2,362
5 REPLIES 5

You can use Vertex AI function calling to retrieve data from different sources to your model prompt.

https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling?hl=en

For example, you can create an API for your database and a function with the needed parameters. Or even you can create a function to generate and execute an SQL query and retrieve the results

If i have some cloud data in my DB ,using Gemini AI can i retrieve the data .

I agree with fenrir85 that function calling is what is needed here.  You can use the LLM to generate the sql query as well. see link below for more detail.

https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/function-calling/sql-talk-app

This is what agents are for. You can:

1. User gemini built in function calling wrapper which essentially just provides gemini a description of what each of your functions do, as well as a format to build a json response that will allow you to use the "isFunction" method to determine if the response is a function call or not.

2. Using geminis logic, you can build your own function calling capability through the use of agents via 3rd party wrappers (ie. LangChain) or via your own code which will unstruct gemini on the structure of your data and what it is and if asked a question about it, to construct a very specific JSON response. You then take that JSON response, look for a function you have specified in there, and call on it (this is the route I took as I use many LLM/Models and need it to be agnostic and some LLM's like Ollama do not have native function calling capability). 

I have used all of these options (gemini function calling, LangChain, and building my own) and I have to say that the only consistent working solution that gives me the same exact reliable results every time is the one I built myself. So take that for what its worth.

Who can I call to help retrieve the data I uploaded into the cloud? I am not a programmer and way out of my league. Thank you in advance.