A sophisticated AI-powered skincare consultant using LangChain LangGraph, FastAPI, and Pinecone. This chatbot provides personalized skincare advice, analyzes images, and suggests routines based on AI-driven assessments. It also supports voice-based conversations using Whisper for speech recognition and ElevenLabs for speech synthesis.
- AI-Powered Skincare Assistant: Provides personalized skincare recommendations based on user input.
- Image-Based Skin Analysis: Uses AI to analyze skin conditions from uploaded images.
- Voice Conversation Support: Integrates Whisper for voice input processing and ElevenLabs for natural-sounding voice responses.
- Agentic Framework: Utilizes an agentic approach, chaining different tools together for enhanced interactions.
- Vector Database Integration: Utilizes Pinecone for efficient similarity search and knowledge retrieval.
- Web Search Capability: Integrates with Tavily for real-time skincare-related searches.
- FastAPI Backend: High-performance API with automatic OpenAPI documentation.
- Streamlit Frontend: User-friendly web interface for chatbot interaction.
- Comprehensive Logging: Detailed logs for monitoring and debugging.
- Python 3.12+
- Poetry (for dependency management)
- API Keys:
GROQ_API_KEYPINECONE_API_KEYTAVILY_API_KEYOPENAI_API_KEYELEVEN_LAB_API_KEY
-
Clone the repository:
git clone https://github.com/Gershonbest/support-agent.git cd skincare-ai-chatbot -
Install Poetry if you haven't already:
pip install poetry
-
Install dependencies using Poetry:
poetry install
-
Activate the virtual environment:
- For older versions of Poetry:
poetry shell
- For the latest version of Poetry:
eval $(poetry env activate)
- For older versions of Poetry:
-
Set up environment variables: Create a
.envfile in the root directory with the following variables:GROQ_API_KEY=your_groq_api_key PINECONE_API_KEY=your_pinecone_api_key TAVILY_API_KEY=your_tavily_api_key OPENAI_API_KEY=your_openai_api_key ELEVEN_LAB_API_KEY=your_eleven_lab_api_key
To start both the FastAPI backend and Streamlit frontend, simply run:
python main.pyThis will automatically start the backend and frontend together.
GET /health
Returns the current health status of the service.
POST /chat
Accepts chat messages and returns AI responses.
Request body:
{
"message": "string",
"thread_id": "optional[int]"
}-
Create a new tool function in
src/agent_tools.py:@tool def new_tool(parameter: str): """Tool description""" # Implementation return result
-
Register the tool in
src/agent.py.
- Add new methods to
PineconeManagmentclass insrc/vector_database/vector_db.py. - Update validators in
src/validators/pinecone_validators.pyif needed.
This project is licensed under the Apache-2.0 License.
