Generic Bot is a lightweight, modular chatbot framework designed to help researchers deploy and experiment with text-based conversational agents efficiently. Built with a Django backend, a React frontend, the Kani Framework for LLM integration, and a MariaDB database, it is fully containerized using Docker for seamless deployment.
Researchers can easily customize in config.json file:
- Language model selection
- Anthropomorphism settings
- Bot-specific prompts
- And more to come
The project streamlines research workflow with integration with tools like Qualtrics, and allows efficient data collection and analysis. For detailed design specifications, see the link
HUMANLIKE-CHATBOT/
├── generic_chatbot/
├── generic_chatbot/
├── settings.py
├── urls.py
├── chatbot/
├── urls.py
├── views.py
├── models.py
├── server/
├── engine.py
├── config.json # Custom Chatbot configuration
├── Dockerfile
├── manage.py
├── Pipfile
├── Pipfile.lock
├── wait-for-db.sh
├── generic_chatbot_frontend/
├── public/
├── index.html/
├── src/
├── utils/
├── api.js
├── App.js
├── Dockerfile.local
├── docker-compose.yml
├── .env # Replace .env_template with .env and add API keys
├── init.sql
├── README.md
- Docker
- Docker Compose
-
Branch Information:
mainbranch is the stable production branchstagingbranch is the development environment branch- Other branches are feature branches
-
Create .env file: Copy example.env and add required API for your chosen LLM model:
cp example.env .env
-
Build and run the containers for the bot:
make start
-
Access the Application:
- Run a quick session at http://localhost:3000/
- Access admin interface at http://localhost:8000/api/admin/ for defining bots and tracking conversations
- For admin interface credential setup, see the Admin Interface section at the end of this file
-
Available Commands:
make start- Start the containers (builds if needed)make stop- Stop the containersmake stop-clean- Stop and remove volumes (clean slate)make test- Run all django app backend tests (requires containers to be running)
Date:26/12/2024
- Language model selection and bot/prompt management via config.json
- Chat interaction logging (stored in MariaDB).
- Dockerized for easy setup and deployment.
- N/A
- Build and integrate the React-based frontend.
- Implement user ID tracking and storage (consider user-flow for chat page entry).
- Create a script to convert SQL conversation data to ConvoKit-formatted JSON.
- Host the project on AWS EC2.
- Develop comprehensive API documentation for integration.
- Add voice interaction support.
- Create adaptable UX/UI for various research case
- HuggingFace Support: Compatibility issues with PyTorch libraries and GPU support in Docker need to be resolved to integrate HuggingFace models.
- How can user authentication and tracking be best integrated with Qualtrics?
- The name of the project Humanlike chatbot does not intuitively describe what this project does do I need to keep this repository name?
-
Access your Django instance (run inside the backend container):
docker exec -it humanlike-chatbot-backend-1 bash cd /app
-
Create a superuser
python manage.py createsuperuser # follow the prompts to set username, email, and password -
Log in to the admin panel
Open your browser and go to:https://<your-domain>/api/admin/(or
http://localhost:8000/api/admin/when running locally)
Enter the superuser credentials you just created.