Skip to content

ArnavM21git/CHATBOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NoteBot - PDF Question Answering ChatBot

Deployed on Streamlit View on Streamlit Cloud

A Streamlit-based chatbot that allows you to upload PDF documents and ask questions about their content using Google's Gemini AI.

🚀 Live Demo

Try the live app here: NoteBot on Streamlit Cloud

Features

  • 📄 Upload and process PDF documents
  • 🤖 Ask questions about your PDF content
  • 🔍 Semantic search using FAISS vector database
  • ✨ Powered by Google Gemini AI
  • 💬 Intelligent context-aware responses

Prerequisites

  • Python 3.8+
  • Google AI API Key (Gemini)

Installation

  1. Clone the repository:
git clone https://github.com/ArnavM21git/CHATBOT.git
cd CHATBOT
  1. Create and activate a virtual environment (recommended):
python -m venv venv
# On Windows PowerShell:
.\venv\Scripts\Activate.ps1
# On Windows CMD:
.\venv\Scripts\activate.bat
# On Linux/Mac:
source venv/bin/activate
  1. Install required packages from requirements.txt:
pip install -r requirements.txt
  1. Set up your environment variables:
    • Create a .env file in the project root
    • Add your Google AI API key:
      GEMINI_API_KEY=your_api_key_here
      

Usage

  1. Run the Streamlit app:
streamlit run ChatBot.py
  1. Upload a PDF file using the sidebar

  2. Ask questions about the PDF content in the text input

  3. Get AI-powered answers based on the document context

How It Works

  1. PDF Processing: Extracts text from uploaded PDF files
  2. Text Chunking: Splits text into manageable chunks for processing
  3. Embedding: Converts text chunks into vector embeddings
  4. Vector Storage: Stores embeddings in FAISS vector database
  5. Similarity Search: Finds relevant chunks based on user questions
  6. Answer Generation: Uses Gemini AI to generate contextual answers

Configuration

  • Chunk Size: 250 characters (adjustable in code)
  • Chunk Overlap: 50 characters
  • Model: Gemini 2.5 Flash
  • Max Output Tokens: 300
  • Embedding Model: models/embedding-001
  • Vector Database: FAISS

Deployment on Streamlit Cloud

This app is deployed on Streamlit Cloud. To deploy your own version:

  1. Fork this repository
  2. Go to share.streamlit.io
  3. Connect your GitHub account
  4. Select your forked repository
  5. Add your GEMINI_API_KEY in the Secrets section (Settings → Secrets):
    GEMINI_API_KEY = "your-api-key-here"
  6. Click Deploy!

Contributing

Feel free to submit issues and enhancement requests!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2025 ArnavM21git


Made with ❤️ using Streamlit and Google Gemini AI

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors