#Kusto cluster database with gemini
1 messages · Page 1 of 1 (latest)
Hi @storm violet thanks for responding, I want to use a kusto cluster as database which gemini should use to answer my questions... The cluster has many tables currently I pass a kusto query to fetch 1 table and store it as a dataframe and then pass that dataframe as context to the model instead I want the model to convert the natural language into KQL
ok
If you get a chance please try to help me I would appreciate it
Help you with what.
You've said what you want to do, not what you've tried, or what isn't working, or anything.
Approach 1:
Manually wrote a kusto query to query the database stored the result in a dataframe->passed the dataframe as context to the LLM -> passed a question and LLM answered correctly based on the context
Problem with this approach is I have 150+ tables I can’t pass so much data as dataframe to the LLM
Approach 2:
Wrote a json about contents of the database like metadata or database schema -> passed json as context to LLM -> asked which table will be required to answer {question} based on the json then the LLM gave table_name -> created a function which accepted table_name as parameter and wrote a query->after having the query I have the required table then asked the question and gave context of this table
From the sounds of it, it sounds like approach 2 is the right avenue to take. Have multiple functions that can provide information about what tables are available, what the schema is for each table, etc, and finally a function that take the query and runs it and provides the answer back for summary
Here's an example that does similar with BigQuery:
https://sql-talk-r5gdynozbq-uc.a.run.app/