A collection of AI-powered chatbot applications built with LangChain, Streamlit, and OpenRouter API.
Location: Q&A_chatbot/
A simple question-answering chatbot with a clean Streamlit interface.
Features:
- Direct conversational interface
- Powered by free OpenRouter models (Google Gemini Flash, Mistral)
- Clean and intuitive UI
- Configurable response parameters
Files:
app.py- Main Streamlit applicationtest_api.py- API connection testingfind_free_models.py- Discover available free modelsollamaapp.py- Ollama integration variant
Run:
cd Q&A_chatbot
streamlit run app.pyLocation: rag_q&a_chatbot/
A Retrieval-Augmented Generation (RAG) chatbot that answers questions from uploaded PDF documents.
Features:
- PDF document upload and processing
- FAISS vector store for efficient retrieval
- Custom embeddings implementation
- Context-aware responses from documents
- Question answering with source context
Files:
ragapp.py- Main RAG applicationpdfs/- Directory for PDF documents
Run:
cd rag_q&a_chatbot
streamlit run ragapp.pyLocation: conversational_q&a_chatbot/
An advanced conversational chatbot with PDF support and persistent chat history.
Features:
- Upload and query PDF documents
- Session-based chat history
- Conversational memory (remembers previous messages)
- RAG-based responses with context
- Streamlit Cloud ready
- Free AI models via OpenRouter
Files:
app.py- Main applicationrequirements.txt- Python dependenciesREADME.md- Project-specific documentationDEPLOYMENT.md- Streamlit Cloud deployment guide.streamlit/config.toml- Streamlit configuration.gitignore- Git exclusions
Run:
cd conversational_q&a_chatbot
streamlit run app.pyDeploy to Streamlit Cloud:
See conversational_q&a_chatbot/DEPLOYMENT.md for detailed deployment instructions.
- Python 3.13.7
- Streamlit - Web UI framework
- LangChain - LLM framework and chains
- OpenRouter - AI model API with free tier
- FAISS - Vector database for embeddings
- PyPDF - PDF document processing
- NumPy - Numerical operations for embeddings
- python-dotenv - Environment variable management
- Python 3.13 or higher
- OpenRouter API key (get it free at openrouter.ai)
- Virtual environment (recommended)
git clone https://github.com/itsmeayan45/gen-ai.git
cd gen-aipython -m venv genvenv
genvenv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file in the project root:
OPENROUTER_API_KEY=your_openrouter_api_key_here
LANGCHAIN_API_KEY=your_langchain_api_key_here # OptionalNavigate to the project folder and run:
streamlit run app.pyOr for the RAG chatbot:
streamlit run ragapp.pyAll projects use free OpenRouter models:
google/gemini-2.0-flash-exp:freemistralai/mistral-7b-instruct:free
No API costs required for basic usage!
Gen-ai-projects/
├── Q&A_chatbot/ # Basic Q&A chatbot
│ ├── app.py
│ ├── test_api.py
│ └── find_free_models.py
├── rag_q&a_chatbot/ # RAG chatbot with PDF
│ ├── ragapp.py
│ └── pdfs/
├── conversational_q&a_chatbot/ # Advanced conversational chatbot
│ ├── app.py
│ ├── requirements.txt
│ ├── README.md
│ ├── DEPLOYMENT.md
│ └── .streamlit/
├── genvenv/ # Virtual environment
├── .env # API keys (not in git)
├── .gitignore
├── LICENSE
├── requirements.txt
└── README.md
The Conversational Q&A Chatbot is ready for deployment on Streamlit Cloud:
- Push to GitHub
- Connect to share.streamlit.io
- Add
OPENROUTER_API_KEYin Streamlit secrets - Deploy!
See conversational_q&a_chatbot/DEPLOYMENT.md for detailed steps.
Feel free to fork this repository and submit pull requests for improvements!
This project is licensed under the MIT License - see the LICENSE file for details.
Ayan
- GitHub: @itsmeayan45
- LangChain for the amazing framework
- OpenRouter for free AI model access
- Streamlit for the easy-to-use web framework
Star ⭐ this repository if you find it helpful!