An intelligent study assistant that combines the power of Google's Gemini API with web search capabilities to provide comprehensive answers to your questions. The application features a modern web interface with support for both text and voice interactions, along with flashcard generation, summary creation, and export capabilities for enhanced learning. Designed specifically for students and researchers, Study Sage helps you process PDF documents, generate study materials, and interact with your content in new ways.
- Upload and process multiple PDF documents
- Intelligent text extraction with page metadata preservation
- Advanced text chunking for optimal processing
- Vector store indexing using FAISS for efficient similarity search
- Real-time chat with streaming responses
- Voice input support with speech recognition
- Text-to-Speech capability for voice responses
- Formatted HTML responses with proper citations
- Combined context from both PDF content and web search results
- Export chat history for future reference
- Integration with Google Custom Search for web context
- Intelligent context merging from PDFs and web results
- Properly formatted citations for both PDF and web sources
- Automatic flashcard generation from PDF content
- Focus on key concepts and relationships
- Export flashcards for offline study
- Smart summary generation with key points extraction
- Downloadable summaries for quick review
- Python 3.x
- Google API Key for Gemini AI
- Custom Search API Key and Search Engine ID
- Modern web browser with microphone support (for voice features)
- Clone the repository:
git clone https://github.com/manahiliqbal/study-sage.git
cd study-sage- Install required packages:
pip install -r requirements.txt- Create a
.envfile in the project root with your API keys:
GOOGLE_API_KEY=your_gemini_api_key
API_KEY=your_custom_search_api_key
CSE_ID=your_search_engine_id
SECRET_KEY=your_flask_secret_key- Start the application:
python app.py-
Open your web browser and navigate to
http://localhost:5000 -
Upload PDF documents using the interface
-
Choose your preferred mode:
- Study Assistant for interactive Q&A
- Flashcards for active recall practice
- Summary for quick content overview
-
Use the export options to download:
- Chat history
- Generated flashcards
- Created summaries
- Uploads and processes PDF files
- Returns success message and processed file names
- Generates flashcards from uploaded PDFs
- Returns JSON array of flashcard objects
- Creates comprehensive summaries from uploaded PDFs
- Returns formatted summary content
- Handles real-time question answering
- Supports both text and voice input
- Streams responses with proper formatting
- Serves generated audio files for voice responses
- Flask & Flask-SocketIO: Web application framework
- PyPDF2: PDF processing
- Langchain: LLM framework
- Google Generative AI: Gemini integration
- FAISS: Vector similarity search
- gTTS: Text-to-speech conversion
- Additional dependencies listed in
requirements.txt
- Chrome (Recommended)
- Edge
- Safari
- Firefox
Note: Voice features require browser support for Web Speech API.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.