irthomasthomas / undecidability

2 stars 2 forks source link

"Yes, that exact niche thing you want does exist!" And other hallucinations #50

Open irthomasthomas opened 10 months ago

irthomasthomas commented 10 months ago

llm "Is there an equivalent tool to fzf for sql? Sqlite3 in particular? Sqlite-extensions? fuzzy search and instant feedback"

Yes, there is an equivalent tool to fzf for SQL queries called "fzf+sqlite-extensions". It combines fuzzy search functionality provided by the fzf tool with SQLite's full-text search extensions. This allows you to perform fuzzy searches on SQL queries and get instant feedback. Here is an example of how to use it:

  1. Install SQLite extensions: First, you need to install SQLite's full-text search extensions. You can find the installation instructions in the SQLite documentation or use a tool like sqlite-utils to install them.

  2. Install fzf+sqlite-extensions: Next, you can install the fzf+sqlite-extensions tool. It is available as a plugin for popular text editors like Vim and Emacs. You can also find standalone versions of the tool on GitHub.

  3. Run fuzzy searches: Once installed, you can start using fuzzy searches with SQLite. For example, if you have a SQLite database file called "data.db" and want to search for a specific value in a table, you can use the following command:

cat data.db | fzf+sqlite-extensions -d

This command will open the fzf interface where you can start typing your fuzzy search query. As you type, the tool will provide instant feedback and show the matching rows from the SQLite database.

Note: Make sure to adjust the command based on your specific setup and requirements. The above example assumes that you have a SQLite database file named "data.db" and want to search the entire database.

irthomasthomas commented 10 months ago

Admittedly, my carefree phrasing of the prompt and lack of context where probably the cause. A PICNIC problem, then. It's hard to adapt to the non-determinism in these things. Especially in programming, you can go on a winning streak, like in poker, and think it's easy, but the law of averages always wins, and the accuracy of an llm always regresses to the mean. For CGPT-3.5 that's about 50-60%.

For this type of question "does a tool exist to do X?", I think something like RAG will be best. Maybe use Kagi's hydration search api to search for related terms and include summary of them in prompt.