This repository contains the group project for the TU Delft DSAIT4065 (previously CS4270) Conversational Agents course. The project implements a psychological doctor agent system powered by conversational AI technologies.
- Conversational Agents
- Docker and Docker Compose
- Python 3.10 or higher (for local deployment)
- OpenAI API key (for conversation capabilities)
The psychological doctor agent features a Streamlit-based web interface that provides the following functionality:
- User registration and login system
- Text-based conversation with the agent
- Audio input capability via microphone
- Real-time facial emotion detection (Not shown in the demo figure below)
- Text-to-speech response playback
Below is a screenshot of the user interface:
Create a .env file in the ./conversation directory based on the provided ./conversation/.env.default template.
Note: Since camera access is challenging within Docker containers, this service runs locally with Docker mapping localhost to internal container hosts through
extra_hosts.
To set up the facial emotion detection component, follow one of the options below:
-
Create a Python virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
For Windows:
venv\Scripts\activate
-
For macOS/Linux:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r deepface/requirements.txt
-
Run the facial emotion detection service:
python deepface/app.py
-
Create a Conda environment with Python 3.10:
conda create -n emotion_detection python=3.10 conda activate emotion_detection
-
Install the required dependencies:
pip install -r deepface/requirements.txt
-
Run the facial emotion detection service:
python deepface/app.py
-
Start all services (MongoDB and conversation) using Docker Compose:
docker-compose up -d
To rebuild images when changes are made:
docker-compose up -d --build
-
Once deployed, access the Streamlit conversation interface at: http://localhost:8501
-
Connect to the MongoDB database:
docker exec -it mongo mongosh -u admin -p password --authenticationDatabase admin -
View conversation data:
use conversations db.users.find().pretty()
Common Docker commands for troubleshooting:
-
Access container shell:
docker exec -it <container_id_or_name> /bin/bash
-
View container logs:
docker logs <container_id_or_name>
-
Restart services:
docker-compose restart
-
View logs for all services:
docker-compose logs -f
-
View logs for a specific service:
docker-compose logs -f <service_name>
