Elektrine lite

← Feed

@nopatience@swecyb.com

Post #1421947

2026-04-19 13:56 UTC

Has anyone experimented with intent based SQL query statements? I did this, because of... reasons. Have all this semi-structured data in JSON. Lots of fields for different purposes. Used a cheap LLM to generate descriptions of what each field contains. Now I have a table with fields and a textual description for what is contained (typically) within the field. Then I used an LLM to translate user intent to appropriate fields and constructed appropriate SQL queries based on best match for the intent. It worked surprisingly well. Was cool to try, not sure it will be useful. But perhaps someone else has been experimenting with similar stuff?

Replies (2)

  • @nopatience@swecyb.com 2026-04-19 13:59

    The data is stored in a PostgresSQL as JSONB, so I can use pretty decent methods to get at the data. But the fields available are not predetermined and new fields can be added and removed, or changed. So as long as I keep the table with descriptive matches updated I can use the "intent based LLM" translator to create reasonably fast queries to get to the data available only as JSONB data structures. I have absolutely no idea if this is incredibly stupid and whatnot. But hey, it's exploration and learning if anything!

    Open ##2226267

  • @owlex@tech.lgbt 2026-04-19 14:13

    @nopatience@swecyb.com I use Claude with Postgres MCPs at work Documented some useful queries and Domain knowledge in the Claude.md Then I gave this to my non technical employees. Now they ask Claude questions to get Data. Questions they normally would’ve asked me. And also questions they would have never bothered to ask me I think this is a much underrated usecase of LLMs

    Open ##2226268