UniMate is an AI-powered assistant that lets you query your PDF documents in natural language. Upload reports, notes, or resumes; ask a question; and get a clear, well-formatted answer grounded in your files. If the answer is not in your PDFs, UniMate falls back to a high‑quality general answer using Google Gemini.
- 📂 Multi-PDF support across all uploaded documents
- 🔍 Hybrid retrieval (FAISS dense vectors + BM25 lexical)
- 🧠 LLM answers via Google Gemini 1.5‑Flash;
text-embedding-004for embeddings - 💬 Chat-style Streamlit UI with conversational history
- 📝 Clean formatting with numbered lists, bullets, and inline citations (page numbers)
- 🗂 Topic management with persistent history
- ⚡ Vector index caching for previously uploaded PDFs
- 🔐 Secure .env-based configuration (keys not tracked in git)
- Streamlit – web app framework
- Google Gemini API – LLM + embeddings
- FAISS – dense vector search
- rank-bm25 – lexical retrieval
- PyMuPDF – PDF parsing
- regex – text cleanup and formatting
unimate-ai-assistant/
├─ app.py # Streamlit entrypoint
├─ core/ # Core logic (backend code)
│ ├─ config.py # Constants, paths, env loader
│ ├─ pdf_utils.py # PDF parsing + chunking
│ ├─ embeddings.py # Gemini embeddings
│ ├─ vector_store.py # FAISS + BM25 hybrid search
│ ├─ llm.py # Gemini text generation
│ ├─ retrieval.py # Prompting & context builder
│ ├─ formatting.py # Answer formatting utilities
│ └─ history.py # Persistent chat history/topics
├─ backend/ # Stored data
│ ├─ vector_store/ # Cached FAISS indices
│ └─ history/ # Saved chat threads
├─ data/
│ └─ uploaded_files/ # Uploaded PDFs
├─ requirements.txt # Python dependencies
└─ .env # Your Gemini API key (not tracked in git)
git clone https://github.com/anshtrivediaiml/UniMate-AI-University-Assistant.git
cd UniMate-AI-University-Assistantpython -m venv .venvOn Windows PowerShell:
.venv\Scripts\Activate.ps1On Linux / macOS:
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
GOOGLE_API_KEY=your_gemini_api_key_herestreamlit run app.pyThen open http://localhost:8501 in your browser.
- Never commit
.envfiles or API keys. - The repository’s
.gitignoreis configured to keep secrets and cache files out of Git.