An AI-powered Study Assistant that answers academic questions and remembers conversation history by session.
- Frontend: https://study-bot-seven.vercel.app/
- Backend Docs: https://study-bot-bs6x.onrender.com/docs
- AI answers for study topics (Maths, Science, History, English, Programming)
- Session-based chat memory with MongoDB Atlas
- Modern chat UI with Local/Production mode switch
- View previous history by session ID
- Clear chat conversation instantly
- FastAPI backend with Swagger docs
- Frontend: Static web app (
frontend/) deployed on Vercel - Backend: FastAPI API (
app.py) deployed on Render - LLM: Groq (LLaMA 3.3 70B)
- Database: MongoDB Atlas
study-bot/
├── app.py
├── requirements.txt
├── runtime.txt
├── gitignore
├── README.md
├── frontend/
│ ├── index.html
│ ├── styles.css
│ └── app.js
└── screenshots/
└── image.png
- Clone repo
git clone https://github.com/AshishCherian15/study-bot.git
cd study-bot- Create and activate env
python -m venv venv
venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Create
.env(orenv) file
GROQ_API_KEY=your_groq_api_key
MONGO_URI=your_mongodb_connection_string
FRONTEND_ORIGINS=http://127.0.0.1:5500- Start backend
uvicorn app:app --reload --host 127.0.0.1 --port 8000- Open frontend
- Open
frontend/index.htmlvia VS Code Live Server (e.g.,127.0.0.1:5500) - Keep Environment =
Localin sidebar
- Import repository in Vercel
- Set Root Directory =
frontend - Framework =
Other - Deploy
- Build command:
pip install -r requirements.txt - Start command:
uvicorn app:app --host 0.0.0.0 --port $PORT - Required env vars:
GROQ_API_KEYMONGO_URIFRONTEND_ORIGINS=https://study-bot-seven.vercel.app
GET /— Health checkPOST /chat— Send message to Study BotGET /history/{session_id}— Get session historyDELETE /history/{session_id}— Clear session history
{
"session_id": "student123",
"message": "Explain Newton's second law"
}- Frontend UI
- Never commit real API keys
- Rotate keys immediately if leaked
- Keep local secrets only in
.env/env
Educational and demonstration use.
