A full-stack RAG (Retrieval-Augmented Generation) application that allows students to upload PDFs of course materials (lecture slides, syllabi, textbooks, assignments) and ask questions about them using AI.
- PDF Upload & Processing: Upload multiple PDF files for analysis
- AI-Powered Q&A: Ask questions about your course materials
- Conversational Interface: Chat-like experience with your documents
- Real-time Processing: Instant document processing and querying
- Beautiful UI: Modern interface built with Next.js and Shadcn/ui
- File Management: Upload, delete, and manage your course materials
- Frontend: Next.js 15 with TypeScript, Tailwind CSS, Shadcn/ui
- Backend: Python FastAPI service
- AI/ML: Google Gemini 2.5 Flash LLM, RAG
- Vector Database: Pinecone for document embeddings
- Document Processing: LangChain for text extraction and chunking
- Node.js 18+
- Python 3.8+
- Pinecone account (free tier available)
- Google AI Studio account (free tier available)
- Go to Pinecone Console
- Sign up for a free account
- Get your API key and environment from the console
- In Pinecone Console, click "Create Index"
- Index Name: Choose a unique name (e.g., "pagepal-docs")
- Dimensions: 768 (for the embedding model we use)
- Metric: Cosine
- Cloud: Choose your preferred region
- Click "Create Index"
git clone https://github.com/yourusername/pagepal-ai.git
cd pagepal-aicd frontend
npm installcd backend/python-service
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtBackend (.env):
cd backend/python-service
cp .env.example .env
# Edit .env with your API keysFrontend (.env.local):
cd frontend
cp .env.example .env.local
# Edit .env.local if neededPINECONE_API_KEY: Your Pinecone API keyPINECONE_INDEX_NAME: Your Pinecone index name (e.g., "pagepal-docs")GEMINI_API_KEY: Your Google AI Studio API key
NEXT_PUBLIC_API_URL: Backend API URL (default: http://localhost:8000)
cd backend/python-service
source venv/bin/activate # On Windows: venv\Scripts\activate
python rag_service.pyBackend will run on: http://localhost:8000
cd frontend
npm run devFrontend will run on: http://localhost:3000
- Open http://localhost:3000
- Upload your PDF files (lecture slides, syllabi, etc.)
- Wait for processing to complete
- Start asking questions about your materials!
POST /process-pdf: Upload and process PDF filesPOST /query: Ask questions about uploaded documentsDELETE /delete-file/{file_name}: Delete file chunks from databaseGET /health: Health check endpoint
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- UI components from Shadcn/ui
- AI powered by Google Gemini
- Vector database by Pinecone

