4 ms·
Off topic: is there a way to use one of the LLMs and have it ingest data from a SQLite database and ask it questions about it?
by oaththrowaway 3y ago
Off topic: is there a way to use one of the LLMs and have it ingest data from a SQLite database and ask it questions about it?
- thisisit 3y agoYou can but what you’ll end up trading precise answers while querying to a chance of hallucinations.
- seanthemon 3y agoYou can, but as a crazy idea you can also ask chatgpt to write select queries using the functions parameter they added recently - you can also ask it to write jsonpath. As long as it understands the schema and general idea of data, it does a fairly good job. Just be careful to do too much with one prompt, you can easily cause hallucinations
- simonw 3y agoI've experimented with that a bit. Currently the absolutely best way to do that is to upload a SQLite database file to ChatGPT Code Interpreter. I'm hoping that someone will fine-tune an openly licensed model for this at some point that can give results as good as Code Interpreter does.
- siquick 3y agoYou can migrate that data to a vector database (eg Pinecone or pgVector) and then query it. I didn’t write it but this guide has a good overview of concepts and some code. In your case your just replace the web crawler with database queries. All the libraries used also exist in Python. https://www.pinecone.io/learn/javascript-chatbot/ https://www.pinecone.io/learn/javascript-chatbot/ Edit: this might also be of use https://python.langchain.com/docs/modules/chains/popular/sqlite https://python.langchain.com/docs/modules/chains/popular/sql...
- politelemon 3y agoHave a look at this too, it's just an integration which langchain can be good at : https://walkingtree.tech/natural-language-to-query-your-sql-database-using-langchain-powered-by-llms/ https://walkingtree.tech/natural-language-to-query-your-sql-...