An AI-powered PDF navigator and insight generator.
Upload multiple PDFs, highlight relevant content, perform semantic search with embeddings, enjoy podcast-style readouts, and get context-rich AI insights — all in a locally runnable, privacy-friendly stack.
- Project Structure
- Features
- Embedding Model: all-MiniLM-L6-v2
- Installation
- API Keys (Gemini & Azure TTS)
- Running the Application
- User Flow: How the Platform Works
- Notes
- Example Commands
- Troubleshooting
- Docker Setup
- License
- Credits
| File/Folder | Purpose |
|---|---|
frontend1.py |
Streamlit web app for PDF upload, selection, highlighting, and UI |
highlight.py |
Utility to highlight specified text inside PDFs |
insight_final.py |
Flask API for generating insights using Google Gemini |
insight.py |
Additional Flask service for complementary insight generation |
relevantSectionnew.py |
FastAPI backend for semantic (vector) search using MiniLM embeddings |
all-MiniLM-L6-v2/ |
Pretrained embedding model (used for vector representations) |
models/ |
Stores FAISS index, embeddings, and section metadata |
uploaded_pdfs/ |
Uploaded PDF storage (optional, used by app and APIs) |
requirements.txt |
Python dependencies |
- 📂 Drag-and-drop PDF upload
- 🔍 Semantic search across PDFs (MiniLM + FAISS)
- 🖍️ Precise snippet highlighting
- 🎙️ Podcast Mode with Azure TTS (if configured)
- 💡 Gemini AI Insights (structured JSON output with takeaways, facts, contradictions, examples)
- Purpose: Maps sentences/paragraphs into a 384D dense vector space
- Efficiency: ~80MB, fast (~14k pairs/sec), supports inputs ≤ 256 tokens
- Quality: Fine-tuned on 1B+ sentence pairs for robust clustering/matching
- 🔗 Official HuggingFace Model Card
- Clone repo and create a virtual environment:
- git clone
- cd
- python -m venv venv
- source venv/bin/activate # On Windows: venv\Scripts\activate
##Install dedencies: pip install -r requirements.txt
##Download MiniLM model (if missing):
- from sentence_transformers import SentenceTransformer
- SentenceTransformer('all-MiniLM-L6-v2').save('all-MiniLM-L6-v2')
##API Keys (Gemini & Azure TTS) ###Gemini API Key
- Location: Top of insight_final.py
- api_key = "YOUR_GEMINI_API_KEY"
###Azure TTS Key (for Podcast Mode)
- AZURE_TTS_KEY = "YOUR_AZURE_TTS_KEY"
- AZURE_TTS_REGION = "YOUR_AZURE_TTS_REGION"
⚠️ Tip: Use environment variables in production for safety.
##Running the Application ###Start each service in separate terminals:
- Gemini Insight API (Flask) python insight_final.py # Runs at localhost:5000
- Additional Insight Service (Flask) python insight.py # Runs at localhost:5001
- Semantic Search Backend (FastAPI) uvicorn relevantSectionnew:app --reload # Runs at localhost:8000
- Streamlit Frontend streamlit run frontend1.py # Opens at localhost:8501
- Upload PDFs → Drag & drop multiple files
- Read & Highlight → Select snippets or search across PDFs
- Highlight PDFs → Match exact & semantically related passages
- Podcast Mode → Listen via Azure TTS
- Insight Bulb → Get Gemini-powered AI insights (takeaways, facts, contradictions, etc.)
docker build --platform linux/amd64 -t yourimageidentifier .
docker run --rm -v Path/credentials:/credentials -e GEMINI_API_KEY="Your_API_Key" -e GEMINI_MODEL=gemini-2.5-flash -e TTS_PROVIDER=azure -e AZURE_TTS_KEY="Your_API_KEY" -e AZURE_TTS_ENDPOINT=https://centralindia.tts.speech.microsoft.com/cognitiveservices/v1 -p 8080:8080 finalbitbybit
- Frontend : 8080
- Insight : 5000
- RelevantSections : 8000
- This project is for educational, personal, and hackathon purposes only.
- PDF Processing : PyMuPDF
- Semantic Search : FAISS + SentenceTransformer
- UI : Streamlit
- AI Instight : Google Gemini API
- TTS : Azure Cognitive Services