Hey there! I built this study assistant to help students actually learn stuff instead of just getting quick answers. It's powered by Hack Club AI and runs on Flask.
Heads up: The bot might take a moment to think before responding - just be patient with it!
This thing is pretty cool - it basically acts like a really patient tutor:
- Actually talks with you: Remembers what you've been discussing so conversations flow naturally
- Handles your PDFs: Drop in a document and it'll use that info to help answer your questions
- Math that doesn't suck: All those fancy equations render properly with LaTeX support
- Teaching approach: Won't just give you answers - guides you to figure things out yourself
- Looks decent: Clean interface that works on your phone too
- Remembers your chat: Keeps track of your conversation while you're using it
The bot walks you through problems step by step. It'll ask you questions that make you think, show math equations that actually look right, and remember what you talked about earlier. If you upload a PDF, it uses that content to give better answers.
- Python 3.7 or newer
- The usual pip stuff
Grab the code:
git clone https://github.com/AathilFelix/study-ai-bot.git
cd study-ai-botSet up a virtual environment (trust me, you want this):
python -m venv .venv
source .venv/bin/activate # Windows folks: .venv\Scripts\activateInstall the stuff it needs:
pip install -r requirements.txtFire it up:
python app.pyCheck it out: Go to http://127.0.0.1:5000 in your browser
Type your question, hit "Ask", and it'll walk you through the solution. No shortcuts - it actually helps you understand.
Hit "Choose File", pick a PDF, and now the bot can reference that document when answering questions. Pretty handy for homework help.
It handles LaTeX math notation like:
- Regular inline:
$$x = 5$$ - Big display equations:
$$E = mc^2$$ - Standard notation:
$x^2 + y^2 = z^2$
There's a reset button when you want to clear everything and start fresh.
- Backend: Flask because it's simple and works
- AI: Hack Club's Qwen 3-32B model (no API keys needed!)
- PDF stuff: PyPDF2 pulls text out of documents
- Math rendering: MathJax makes equations look professional
- Frontend: Bootstrap 5 for the UI
- Text processing: Full markdown support
app.py- Main Flask app with all the routeshackclub_ai.py- Talks to the AI and handles promptstemplates/index.html- The web interfaceuploads/- Where uploaded PDFs live
Uses Flask sessions to keep track of your conversation and any PDFs you've uploaded. When you have a document uploaded, it automatically includes relevant chunks in the AI's context.
Since it uses Hack Club AI, you don't need to mess with API keys or anything.
- Change the teaching style by editing prompts in
hackclub_ai.py - Adjust how much PDF content gets included in
get_rag_context() - Customize the look in
templates/index.html
study-ai-bot/
├── app.py # Main Flask app
├── hackclub_ai.py # AI interface
├── requirements.txt # What Python needs
├── setup.sh # Setup script
├── templates/
│ └── index.html # The web page
├── uploads/ # PDF storage
└── README.md # You're reading it
ding it
- New pages: Add routes in
app.py - Change AI behavior: Edit the prompts in
hackclub_ai.py - Frontend changes: Update
templates/index.html - New dependencies: Add them to
requirements.txt
Main packages:
flask- The web frameworkmarkdown- Text processingPyPDF2- PDF text extractionwerkzeug- Security utilitiesmarkupsafe- Safe string handling
Want to help make this better?
- Fork it
- Make a branch for your feature
- Do your thing
- Test it thoroughly
- Send a pull request
It's open source - use it, modify it, learn from it. That's what it's for.
Run into issues?
- Open a GitHub issue
- Check the troubleshooting section below
Bot's not responding
- Make sure Flask is actually running
- Check your internet connection
- Give it a few seconds - sometimes it's just thinking
PDF upload failing
- Make sure the PDF isn't password protected
- Big files take longer to process
- Try a smaller PDF first
Math not showing up right
- Check if MathJax loaded (look in browser dev tools)
- Use proper LaTeX:
$$inline$$or$$display$$
Conversation getting weird
- Clear your browser cookies
- Hit the reset button
- Refresh the page
Ideas I'm thinking about:
- Support for Word docs and PowerPoint slides
- Better PDF processing with vector embeddings
- User accounts so conversations persist
- Export chat transcripts
- Mobile app version
- More advanced math solving
- Integration with Canvas/Blackboard
Built this because I got tired of students just wanting quick answers instead of actually learning. Hope it helps!