An AI-powered agent that translates Natural Language into SQLite queries for hospital management.
- LLM: Google Gemini 2.0 Flash
- Framework: Vanna.ai
- Backend: FastAPI
- Database: SQLite
Install the necessary libraries and create a .env file with your API key.
pip install vanna[sqlite,gemini] fastapi uvicorn python-dotenv pandas
Run the script to create clinic.db and populate it with sample data (Patients, Doctors, Appointments).
python setup_database.py
Train the RAG model with "Golden SQL" pairs and generate the RESULTS.md accuracy report.
python seed_memory.py
Start the FastAPI server to handle live queries.
uvicorn main:app --port 8000
Once running, visit http://127.0.0.1:8000/docs to test the /chat endpoint.
Sample Question:
"Show me the top 5 patients by total spending"
Benchmark results for 20 complex business questions are stored in RESULTS.md.