Documentation

Installation Guide

AI After Life — AI-Powered Memorial Persona Chat System with Voice Cloning and WhatsApp Training

Step-by-step Setup Verified Instructions Chat Support
Back to Project
Complete Guide

AI After Life — Installation Guide

Prerequisites

Before you begin, make sure you have the following installed on your system:

  • Python 3.10 or higher
  • Redis server (used as the Celery message broker)
  • FFmpeg (required for audio file processing)
  • espeak text-to-speech engine — install using sudo apt install espeak on Ubuntu/Linux or brew install espeak on macOS
  • A CUDA-capable NVIDIA GPU is recommended for faster voice cloning, though CPU mode works as well

Step 1 — Clone the Repository

Open your terminal and run the following commands to download the project:

git clone <repo-url>
cd "AI-After-Life"

Step 2 — Create and Activate a Virtual Environment

Setting up an isolated Python environment prevents dependency conflicts with other projects on your machine:

python -m venv venv
source venv/bin/activate

If you are on Windows, use this activation command instead:

venv\Scripts\activate

Step 3 — Install Python Dependencies

Install all required libraries listed in the requirements file:

pip install -r requirements.txt

This will install Django, Django REST Framework, Groq client, Coqui TTS, Bark, librosa, PyTorch, and all other dependencies. The installation may take several minutes depending on your internet speed and whether PyTorch needs to download CUDA binaries.

Step 4 — Configure Environment Variables

The application requires certain sensitive configuration values. Set them as environment variables before running the server:

export SECRET_KEY="your-django-secret-key-here"
export GROQ_API_KEY="your-groq-api-key-here"
export DEBUG=True
export ALLOWED_HOSTS="localhost,127.0.0.1"

On Windows, replace export with set. Alternatively, you can create a .env file in the project root directory and use a package like python-decouple or django-environ to load the values automatically.

To get a Groq API key, sign up at console.groq.com and generate a free API key from the dashboard.

Step 5 — Run Database Migrations

Create the database tables required by the application:

python manage.py migrate

Step 6 — Create a Superuser Account

Create an admin account that you can use to log in:

python manage.py createsuperuser

Follow the terminal prompts to enter a username, email address, and password.

Step 7 — Start the Redis Server

Open a separate terminal window and start Redis, which is used as the message broker for background tasks:

redis-server

Keep this terminal running throughout your session. If Redis is not installed, you can install it on Ubuntu with sudo apt install redis-server or on macOS with brew install redis.

Step 8 — Configure Voice Clone Engine (Optional)

Open the file memorial_ai/settings.py and configure your preferred voice cloning engine:

VOICE_CLONE_ENGINE = "coqui"
MAX_VOICE_SAMPLE_DURATION = 120

Available options are coqui for Coqui TTS XTTS v2 (highest quality), bark for Bark TTS (experimental), or fallback which returns silent audio if voice cloning is not needed.

Step 9 — Start the Development Server

Run the Django development server:

python manage.py runserver

Step 10 — Access the Application

Open your web browser and navigate to:

http://127.0.0.1:8000

Log in with the superuser credentials you created in Step 6. You will be taken to the Dashboard where you can begin creating memorial personas.

Using the Application

Follow these steps to create and interact with your first persona:

  1. Create a Persona — Click "Create New Persona" on the Dashboard. Enter the person's name and your relationship to them.
  2. Upload Training Data — Go to the persona's Upload Data page. Upload a WhatsApp chat export as a .txt file. You can export this from WhatsApp by going to any chat, tapping the three-dot menu, selecting "Export Chat," and choosing "Without Media." Optionally upload a voice recording in WAV, MP3, or M4A format. Ten to thirty seconds of clear speech without background noise gives the best results.
  3. Train the Persona — Click "Start Training" and wait for the nine-step automated pipeline to complete. You can watch the progress in real time. Once training finishes, the system will display the overall accuracy score.
  4. Start Chatting — Open the Chat page for the trained persona. Toggle between Voice Mode and Text Mode. In voice mode, click the microphone button to speak and hear the cloned voice response. In text mode, type your message and receive a text reply styled to match the persona's communication patterns.

Troubleshooting Common Issues

  • If you see an error about espeak not found, make sure you have installed it using the appropriate package manager for your operating system.
  • If voice cloning is extremely slow, you are likely running on CPU. For faster processing, install the CUDA version of PyTorch that matches your NVIDIA GPU driver.
  • If the Groq API returns rate limit errors, wait a few minutes and try again. The free tier has request limits that reset periodically.
  • If Redis connection errors appear, ensure the Redis server is running in a separate terminal before starting the Django server.
  • If WhatsApp messages are not being parsed correctly, verify that your export file is in plain text format and not a ZIP archive. The parser expects the raw .txt file.

Production Deployment Notes

For deploying this project beyond local development, make the following changes:

  • Set DEBUG=False in your environment variables
  • Generate a strong random SECRET_KEY
  • Configure ALLOWED_HOSTS with your actual domain name
  • Switch from SQLite to PostgreSQL for a production-grade database
  • Serve static files using Nginx or a CDN
  • Run Celery workers for background task processing
  • Add file type and size validation for all uploads

Need Help?

Our team is here to assist you with installation and setup.

Chat with Us
Chat with us