AskMyNotes is a RAG-based study assistant. Upload a lecture PDF and:
- Ask questions about it and get answers with page citations.
- Generate a 5-question MCQ quiz from the content.
┌────────────────┐ ┌──────────────────────┐ ┌───────────────┐
│ React UI │ ───▶ │ FastAPI Backend │ ───▶ │ ChromaDB │
│ (Vite+Tailwind) │ ◀─── │ (LangChain + OpenAI) │ ◀─── │ (vector store) │
└────────────────┘ └──────────────────────┘ └───────────────┘
- Upload: PDF is parsed with
PyPDFLoader, split into 500-char chunks (50 overlap), embedded with OpenAItext-embedding-3-small, and stored in ChromaDB. - Ask: User question is embedded, top-4 relevant chunks retrieved, answered by GPT-4o with page numbers returned.
- Quiz: Top chunks retrieved and sent to GPT-4o, which returns 5 MCQs as strict JSON.
Add screenshots here
docs/screenshot-upload.pngdocs/screenshot-qna.pngdocs/screenshot-quiz.png
- Python 3.11
- Node.js 20
- Docker (optional, for containerized run)
- OpenAI API key
cd backend
cp .env.example .env # add your OPENAI_API_KEY
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reloadcd frontend
cp .env.example .env
npm install
npm run devdocker compose up --build- Provision an EC2 instance (Ubuntu, Docker installed).
- Create
/home/<user>/askmynotes.envwithOPENAI_API_KEYandALLOWED_ORIGINS. - Configure GitHub Secrets:
DOCKERHUB_USERNAME,DOCKERHUB_TOKEN,EC2_HOST,EC2_USER,EC2_SSH_KEY. - Push to
main— GitHub Actions builds, pushes to Docker Hub, and redeploys via SSH. - Open port 8000 in the EC2 security group.
- Import the
frontenddirectory as a Vercel project. - Set environment variable
VITE_API_URLto your EC2 backend's public URL. - Deploy.
| Variable | Location | Description |
|---|---|---|
OPENAI_API_KEY |
backend | OpenAI API key |
ALLOWED_ORIGINS |
backend | Comma-separated CORS origins |
CHROMA_DIR |
backend | ChromaDB persistence path |
VITE_API_URL |
frontend | Backend API base URL |
- Install Python 3.11 from python.org
- Install Node.js 20 from nodejs.org
- Install Docker Desktop (optional)
- Get an OpenAI API key from platform.openai.com
Extract this project to a folder called askmynotes.
- Open a terminal in
askmynotes/backend - Run:
cp .env.example .env - Open
.envand paste your OpenAI key afterOPENAI_API_KEY= - Create a virtual environment:
python -m venv venv- Activate it:
source venv/bin/activate(Mac/Linux) orvenv\Scripts\activate(Windows)
- Install dependencies:
pip install -r requirements.txt - Start the server:
uvicorn main:app --reload - Visit
http://localhost:8000/health— you should see{"status": "ok"}
- Open a new terminal in
askmynotes/frontend - Run:
cp .env.example .env(leaveVITE_API_URL=http://localhost:8000) - Install dependencies:
npm install - Start the dev server:
npm run dev - Open the URL shown (usually
http://localhost:5173)
- Go to the "Upload" tab and upload a PDF of lecture notes
- Switch to "Ask Questions" and type a question — note the cited page numbers
- Switch to "Quiz" and click "Generate 5 MCQs" — click an option to see if it's correct
- From the project root:
docker compose up --build - Backend runs on port 8000, frontend on port 5173
- Push your code to a GitHub repository
- Set up an AWS EC2 instance with Docker installed
- Add the required secrets in GitHub repo settings → Secrets and variables → Actions:
DOCKERHUB_USERNAME,DOCKERHUB_TOKENEC2_HOST,EC2_USER,EC2_SSH_KEY
- Push to the
mainbranch — the GitHub Action will build and deploy automatically - Deploy the frontend to Vercel, setting
VITE_API_URLto your EC2 backend URL