A smart chatbot that can answer questions about any website's content using Google's Gemini AI and LangChain.
- Scrapes and processes website content through sitemaps
- Uses state-of-the-art embeddings for semantic search
- Powered by Google's Gemini AI for natural responses
- Automatic PDF generation for offline access
- Intelligent context chunking for better comprehension
- Clone the repository
git clone https://github.com/yourusername/website-qa-chatbot.git
cd website-qa-chatbot
- Install requirements
pip install -r requirements.txt
- Set up your Gemini API key
# Create a .env file and add your API key
GEMINI_API_KEY=your_api_key_here
- Run the chatbot
python main.py
website-qa-chatbot/
├── main.py # Main application file
├── utils/
│ ├── document_processor.py # Document processing utilities
│ ├── embeddings.py # Embedding functions
│ └── chat_interface.py # Chat interface functions
├── requirements.txt # Project dependencies
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
└── README.md # Project documentation
from chatbot import WebsiteQABot
# Initialize the bot
bot = WebsiteQABot(api_key="your_gemini_api_key")
# Process a website
bot.process_website("https://example.com/sitemap.xml")
# Start chatting
bot.start_chat()
- Python 3.8+
- Gemini API key
- Internet connection for website scraping