A Retrieval-Augmented Generation (RAG) AI assistant for breast cancer information and support, powered by Qdrant and web search fallback.
Important Mental Health Statement:
This chatbot is designed to provide information and emotional support for individuals affected by breast cancer. However, it is NOT a substitute for professional medical or mental health care.
- 🤝 Emotional Support: The chatbot can provide comfort, information, and a listening ear during difficult times
- 🎭 Emotion Detection: Real-time emotion analysis from voice and facial expressions to better understand your emotional state
- 💬 Conversational Support: Natural conversations to help you feel heard and supported
- 📚 Educational Resources: Reliable information about breast cancer to reduce anxiety and uncertainty
If you're experiencing severe emotional distress, please reach out to:
- Your healthcare provider
- A licensed mental health professional
- Crisis helplines in your area
- Support groups for breast cancer patients and survivors
Remember: You're not alone, and it's okay to seek professional help when needed.
- Recommended: Python 10.x (personally tested and working)
- Supported: Python 3.8 - 3.10
- Not supported: Python 11+ (due to compatibility issues with some dependencies)
git clone https://github.com/hejerayadi/chatbot.git
cd chatbotpython --version
# Should show Python 3.x.x where x < 11# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtNote: If you encounter any installation errors, try upgrading pip first:
pip install --upgrade pipCreate a .env file in the project root with your API keys and Qdrant URL:
TOGETHER_API_KEY=your_together_api_key
QDRANT_URL=https://your-qdrant-url
QDRANT_API_KEY=your_qdrant_api_key
QDRANT_DOCS_COLLECTION=docs_collection
QDRANT_FAQ_COLLECTION=faq_collection
SERPER_API_KEY=your_serper_api_keyRequired API Keys:
- TOGETHER_API_KEY: Get from Together AI
- QDRANT_URL & QDRANT_API_KEY: Get from Qdrant Cloud
- SERPER_API_KEY: Get from Serper (optional, for web search fallback)
python vectorStore__hajer.pyThis will create the vector database with your FAQ and knowledge base documents.
python api.pyThe application will start on http://localhost:5000
-
Language & Relevance Detection:
The chatbot detects the user's language and checks if the question is about breast cancer. -
FAQ Lookup:
It first tries to answer using a curated FAQ database. -
Knowledge Base Search:
If not found in FAQ, it searches a broader knowledge base of breast cancer documents. -
Web Search Fallback:
If no relevant answer is found, the chatbot uses a web search agent to find and summarize up-to-date information. -
Continuous Learning:
Any answer generated by the web search agent is automatically stored in the knowledge base for future queries.
- Multilingual support (English, Arabic, French)
- Voice and text input modes with emotion detection
- Semantic search with Qdrant vector database
- Web search fallback for new/unseen questions
- Automatic knowledge base enrichment
- Real-time emotion detection from voice and facial expressions
- Text-to-speech with dynamic accent matching based on detected language
-
Python Version Error
Error: This project requires Python < 11Solution: Use Python 10.x or earlier
-
Installation Errors
Error: Failed to install some packagesSolution:
pip install --upgrade pip pip install -r requirements.txt --no-cache-dir
-
Missing API Keys
Error: TOGETHER_API_KEY not foundSolution: Make sure your
.envfile is in the project root and contains all required API keys -
Qdrant Connection Error
Error: Could not connect to QdrantSolution: Check your QDRANT_URL and QDRANT_API_KEY in the
.envfile
If you encounter any issues:
- Check that you're using Python < 11
- Ensure all dependencies are installed correctly
- Verify your
.envfile is properly configured - Check the console output for specific error messages
- Make sure your
.envfile is set up with all required API keys. - The chatbot will automatically expand its knowledge base as users ask new questions.
- For best results, keep your knowledge base and FAQ up to date.
- The application supports both voice and text input with real-time emotion detection.
Pull requests and suggestions are welcome!
MIT License