A Retrieval-Augmented Generation (RAG) Document Assistant powered by Google Gemini and LangChain FAISS.
Developed as part of the Launched Global internship program.
Students, researchers, and professionals frequently struggle to quickly search, synthesize, and extract accurate answers from lengthy, fragmented information distributed across multiple documents (PDFs, DOCX, TXT). Manual searching is time-consuming, prone to oversight, and standard keyword search lacks deep semantic understanding.
IntelliAssist AI is an end-to-end Retrieval-Augmented Generation (RAG) system that:
- Ingests and processes custom documents in multiple formats.
- Generates semantic embeddings to index document chunks into a vector database.
- Retrieves the most relevant contextual passages using similarity search.
- Synthesizes factual, grounded answers using Google Gemini while strictly citing source documents and page numbers.
This project was built and submitted as part of the Launched Global internship. It demonstrates production-ready RAG system design, document indexing, fallback-resilient LLM integration, and interactive Streamlit UI implementation.
Documents (PDF / DOCX / TXT)
↓
Document Loader
↓
Text Preprocessing & Cleaning
↓
Recursive Character Chunking
↓
HuggingFace Embeddings (sentence-transformers/all-MiniLM-L6-v2)
↓
FAISS Vector Store
↓
Similarity Search (Top-K Context Retrieval)
↓
Retrieved Document Context + Conversation History
↓
Google Gemini (LLM Generation with Fallback & Retry)
↓
Grounded Answer + Source Citations
- Language & UI: Python, Streamlit
- Framework & Orchestration: LangChain (langchain-core, langchain-community, langchain-text-splitters)
- Vector Database: FAISS (Facebook AI Similarity Search)
- Embeddings: HuggingFace Embeddings (
sentence-transformers/all-MiniLM-L6-v2) - Large Language Model (LLM): Google Gemini API (
gemini-3.6-flash,gemini-3.5-flash,gemini-flash-latest) - Document Parsers: pypdf (PDF), python-docx (DOCX)
- Environment Management:
python-dotenv
- 📁 Multiple Document Formats: Supports PDF, DOCX, and TXT files with clean text parsing and page-level metadata tracking.
- 🔍 Semantic Search: Fast and accurate vector similarity retrieval using FAISS and HuggingFace MiniLM embeddings.
- 🧠 RAG-Based Answers: Answers are synthesized directly from retrieved context, minimizing hallucinations.
- 📌 Source Attribution: Transparent citations showing exact document names and page numbers for every generated response.
- 📤 Dynamic Document Upload: Upload custom documents via the sidebar to instantly create isolated vector stores for the uploaded files.
- 🛡️ Grounded Responses & Out-of-Context Handling: Clear rejection and graceful handling when information is not present in the indexed documents.
- 🔄 Auto-Retry & Model Fallback: Built-in exponential backoff retry mechanism with multi-model fallback to handle high-demand API spikes (503 / 429 errors).
- 🔁 Regenerate & Retry Controls: One-click regeneration and in-chat retry options.
- 🧹 Cache & Reset Management: Complete cache and artifact clearing controls to ensure clean document isolation across runs.
git clone https://github.com/Shounak-programmer/IntelliAssist_AI.git
cd IntelliAssist_AI# Windows
python -m venv .venv
.venv\Scripts\activate
# Linux / macOS
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory (or copy from .env.example):
GEMINI_API_KEY=your_actual_gemini_api_key_here
GEMINI_MODEL=gemini-3.6-flashObtain your API key from Google AI Studio.
streamlit run src/app.pyOpen your browser and navigate to http://localhost:8501.
IntelliAssist_AI/
│
├── Documents/ # Default sample documents
├── uploaded_documents/ # Directory for user-uploaded documents (auto-cleaned)
├── src/
│ ├── __init__.py
│ ├── app.py # Streamlit web application & UI
│ ├── document_loader.py # Multi-format document parser (PDF, DOCX, TXT)
│ ├── rag_pipeline.py # Retrieval-augmented generation pipeline & Gemini client
│ └── vector_store.py # FAISS indexing and vector store management
│
├── .env.example # Example environment variables template
├── .gitignore # Ignored files (secrets, venv, vector db caches)
├── requirements.txt # Project dependencies
├── LICENSE # GNU AGPLv3 License
└── README.md # Project documentation
This project is licensed under the GNU Affero General Public License v3.0 [GNU AGPLv3]. See the LICENSE file for details.