Find answers from the community

Updated last year

Hi all I ve recently experimented with

Hi all, I've recently experimented with the SQLDatabase and NLSQLTableQueryEngine features from llama-index and found them to be impressively effective. These features appear to convert natural-language queries into SQL statements, but I'm uncertain about the underlying processes that make this possible. Could you guide me towards resources where I might better understand how this functionality is implemented?
L
s
2 comments
(cc @SeaCat )

Under the hood, we send the LLM the table schemas + the user query

In the prompt, we ask it to write a SQL query to answer the query (or whichever syntax the db is in)

Then we send the query, sql query, and sql result to the LLM again, and ask it to write a natural language answer

Overall it's not too complicated
Thx for kind explanation! I was expecting that was the mechanism and now I got reaffiremd. Thansk again!
Add a reply
Sign up and join the conversation on Discord