An AI Doctor Chat Bot powered by SmolLM2-1.7B-Instruct, featuring a Java desktop UI with a full registration/login system and a Python AI backend.
A desktop application where users can chat with an AI Doctor bot. The app includes a secure registration and login system before accessing the chat. The AI model was custom trained to act as a medical assistant.
project/
├── brain_api/ # Python backend
│ ├── chat_lung_model/ # AI model files (not included, see Setup)
│ ├── main.py # Runs the API server
│ ├── train.py # Training script for the AI model
│ └── db_manager.py # Database helper (connects to Java's database)
│
└── chat_app/ # Java desktop frontend
├── src/java/chat_ui/
│ ├── ChatWindow.java # Main app window (chat with AI Doctor)
│ ├── Database.java # Creates and manages the database
│ ├── Login.java # Login window (called by ChatWindow)
│ ├── Registration.java # Registration system (email, password, birthdate, email verification)
│ ├── PasswordUpdateDialog.java # Password reset request (email input)
│ └── RequestResetDialog.java # Password reset process window
├── src/resources/
└── pom.xml
- 🔐 Secure Auth System — Register, Login, Email Verification, Password Reset
- 🤖 AI Doctor Bot — Powered by SmolLM2-1.7B-Instruct (custom trained)
- 💬 Chat — Users can text the AI Doctor
- 🗄️ Integrated Database — Java manages the DB, Python connects to it
- User launches
ChatWindow.java - Login screen appears (always, for security)
- New users can Register with email, password, and birthdate → email verification required
- Forgot password? → Request reset via email
- Once logged in → Chat with the AI Doctor Bot 🩺
- Python 3.12+
- Dependencies:
pip install -r requirements.txt- Download or train the AI model and place it in
brain_api/chat_lung_model/
- Java 17+
- Maven
cd brain_api
python main.pycd chat_app
mvn install
mvn exec:javaOr simply run ChatWindow.java from your IDE.
⚠️ AI model files are not included in this repository due to size limitations. Download or train the model separately and place it inbrain_api/chat_lung_model/
This app uses Gmail SMTP for email verification and password reset.
- Open
brain_api/main.py - Fill in your Gmail credentials:
SENDER_EMAIL = "your_email@gmail.com"
SENDER_PASSWORD = "your_app_password"- Go to your Google Account → Security
- Enable 2-Step Verification (if not already)
- Go to Security → App Passwords
- Select app: Mail → Select device: Windows/Mac
- Google will generate a 16-character password → paste it into
SENDER_PASSWORD
⚠️ Never share or commit your email credentials to GitHub! Consider using a.envfile to store them securely:
import os
SENDER_EMAIL = os.getenv("SENDER_EMAIL")
SENDER_PASSWORD = os.getenv("SENDER_PASSWORD")Then add
.envto your.gitignore✅
- ✅ Python LLM backend (SmolLM2-1.7B-Instruct)
- ✅ Custom AI model training
- ✅ Java Chat UI
- ✅ Registration & Login system
- ✅ Email verification & Password reset
- ✅ Persistent chat history — all conversations saved to database and reloaded per user
- ✅ Async AI requests — UI never freezes while AI is responding
- Flutter mobile app integration (Android & iOS)
- Flutter web app integration
- Upgrade to a more sophisticated LLM model (Mistral 7B / LLaMA)
- AI Food & Recipe Coach — user inputs available ingredients, AI suggests meals and acts as a nutrition coach
- Voice input — user speaks to the AI Doctor (Speech-to-Text)
- Voice output — AI Doctor responds with voice (Text-to-Speech)
- Conversation memory — AI remembers previous messages in session
- User health profile — store age, weight, medical history
- Dark / Light mode toggle
MIT