ndhanvina/research-paper-explainer
1
Research Paper Explainer with Gemini & FAISS ๐
An intelligent Streamlit-based application that leverages Google's Gemini AI and FAISS vector storage to help users understand research papers through interactive Q&A. Upload any research paper in PDF format and ask questions to get concise, context-aware answers.
๐ Key Features
- PDF Processing & Analysis
- Upload and process any research paper in PDF format
- Automatic document chunking with optimal overlap for context preservation
- Smart text splitting using RecursiveCharacterTextSplitter
- Advanced Vector Storage
- Local vector storage using Facebook AI Similarity Search (FAISS)
- Efficient similarity search for relevant context retrieval
- In-memory storage for quick access and data privacy
- Intelligent Q&A System
- Powered by Google's Gemini 1.5 Flash model
- Semantic understanding and context-aware responses
- Precise answer length control (40-100 words)
- Professional and concise response format
- User-Friendly Interface
- Clean and intuitive Streamlit interface
- Real-time processing status updates
- Easy API key configuration
- Progress indicators and success/error messages
๐ ๏ธ Technical Stack
- Frontend: Streamlit
- AI/ML:
- Google Gemini AI (for text generation)
- FAISS (for vector similarity search)
- LangChain (for RAG pipeline)
- Document Processing: PyPDF Loader
- Text Processing: RecursiveCharacterTextSplitter
๐ Prerequisites
- Python 3.7 or higher
- Google Gemini API key (Get it here)
- Sufficient RAM for FAISS in-memory operations
๐ Installation
- Clone the repository:
git clone https://github.com/yourusername/research-paper-gpt.git
cd research-paper-gpt- Create and activate a virtual environment (recommended):
python -m venv venv
.\venv\Scripts\activate # Windows- Install required packages:
pip install -r requirements.txtโ๏ธ Configuration
- Get your Google Gemini API key from Google AI Studio
- Launch the application and enter your API key in the sidebar
- The key is stored only for the current session
๐ฏ Usage Guide
- Start the Application:
streamlit run app.py- Configure API Key:
- Enter your Gemini API key in the sidebar
- Click "Save Gemini API Key"
- Upload Research Paper:
- Click "Browse files" or drag and drop your PDF
- Wait for the upload confirmation
- Process the Document:
- Click "Process PDF" to start document chunking
- Monitor the progress in the status messages
- Create FAISS Store:
- Click "Create FAISS Store" to generate embeddings
- Wait for the completion message
- Ask Questions:
- Type your question in the text area
- Click "Get Answer" for AI-generated responses
๐ How It Works
- Document Processing Pipeline:
- PDF is loaded and split into manageable chunks
- Chunks overlap by 200 characters to maintain context
- Each chunk is processed for optimal information retrieval
- Embedding Generation:
- Text chunks are converted to vector embeddings
- Uses Google's Generative AI embedding model
- Vectors capture semantic meaning of text
- Vector Storage:
- FAISS creates an efficient index of embeddings
- Enables fast similarity search
- Maintains all data in local memory
- Question Answering:
- User query is processed and vectorized
- FAISS retrieves most relevant context
- Gemini AI generates precise, contextual answers
โ ๏ธ Important Notes
- The application maintains all data in memory (no permanent storage)
- API key is only stored in session state
- Large PDFs may require significant RAM
- Answer length is optimized for readability (40-100 words)
๐ Security Considerations
- No data is stored permanently
- All processing happens locally
- API key is never saved between sessions
- PDF files are processed in temporary storage
๐ค Contributing
Feel free to:
- Open issues
- Submit pull requests
- Suggest improvements
- Report bugs
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
โจ Acknowledgments
- Google Gemini AI for the language model
- Facebook Research for FAISS
- LangChain for the RAG framework
- Streamlit for the web interface
๐ Support
For issues and questions:
- Open a GitHub issue
- Check existing documentation
- Review closed issues for solutions
