This chatbot uses LangChain Agent, LLM and SQLDatabaseToolkit. Agent uses LLM to decide what to do and uses SQLDatabaseToolkit to get results
- Get OpenAI API key add it to config.toml
- Use makeFile to get chatbot up and running.
- Get Mysql up and running on docker and populate data using .sql in the repo. Or connect to existing Mysql instance by adding connection string to config.toml
- Hit localhost:5000 will take you to search form, and you can search database.
- Does not perform DML.
- Handles SQL injection.
- Can answer questions which require joins. And can perform aggregate functions on data.
- Can tell how to join tables.
- Understanding the table structure helps write good prompts.
- Formatting can off for responses.
- SQL generated to get answers are not always optimized.
- Uses SQLAlchemy under the hood.
- Watch the console output to see how Agent is deciding what to do .