This is my implementation for a RAG + SQL chatbot app for Delhi Police - written in Python. It provides quick answers to queries related to police operations and policies, and also handles SQL queries to retrieve data from the database.
ive streamlit for building the interface for this app
-
SQL Query Processing: Perform non-destructive SQL computations on the database and return results. It has been tested and comes with a SQLValidator that ensures no SQL injection attempt passes through to damage the database
-
Answering Queries: The chatbot answers questions based on the provided source texts, such as
.txt
or.pdf
files, making it ideal for referencing policy documents or manuals.
before running the code, you would be required to install the requirements for this project
pip install -r requirements.txt
followed by
streamlit run app.py
this will open a localhost window on your browser that runs this application
create a separate class that calls all utilities and presents the user with a singular class with the necessary methods exposed. my current implementation is just procedural code (pretty messy) written for streamlit
im fine with contributions but note that certain variables, methods, and the vector database have been removed from this repository owing to security purposes in the inherent nature of this app. Demo can be run using a sample text file supplied by user.