Synthia is a Streamlit-based AI application that allows users to upload PDFs and interact with the documentβs content through natural language queries. The assistant provides answers via video responses from customizable avatars powered by HeyGen API.
π PDF Viewer: Upload and view PDF documents within the app.
π§ AI-Powered Chat: Ask questions about the content of the uploaded PDF and receive relevant answers.
π₯ Avatar Video Responses: Choose from a variety of avatars to deliver answers in a video format using HeyGen.
βοΈ Session Management: Manage video streaming sessions seamlessly (create, start, and close sessions).
π Semantic Search: Retrieve relevant document chunks to generate accurate answers.
You can select one of the following Avatars for this demo.
| Avatar Name | Role | Description |
|---|---|---|
| Judy | Teacher | Formal and professional avatar |
| Bryan | Fitness Coach | Energetic and engaging avatar |
| Silas | Customer Support | Helpful and friendly avatar |
Judy_Teacher_Sitting_public.mp4
Bryan_FitnessCoach_public.mp4
Silas_CustomerSupport_public.mp4
Create_Start_Video_Session.mp4
Question_Response.mp4
1οΈβ£ Installation
-
Clone this repository:
git clone git@github.com:anujdutt9/Synthia.git cd Synthia -
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
2οΈβ£ Setup Environment Variables
Create a .env file in the root directory with the following content:
# HeyGen API Settings
HEYGEN_API_KEY=<your_heygen_api_key>
HEYGEN_SERVER_URL=<your_heygen_server_url>
OPENAI_API_KEY=<your_openai_api_key>3οΈβ£ Run the Application
- Launch the Streamlit app:
streamlit run app.py-
Access the app in your browser: Navigate to the local URL provided in the terminal (e.g., http://localhost:8501).
-
Upload a PDF, select an avatar, and start interacting with Synthia!
- PDF Upload: Users upload a PDF file, which is processed to extract text and create vector embeddings.
- Text Chunking & Retrieval: The document content is split into chunks, and the most relevant chunks are retrieved based on user queries.
- Avatar Video Responses: The HeyGen API is used to create and manage video sessions where avatars deliver AI-generated responses.
| Issue | Solution |
|---|---|
| Missing API Keys | Ensure the HEYGEN_API_KEY is correctly set in the .env file. |
| Video Not Loading | Verify the HeyGen server URL and API key. |
| PDF Processing Error | Ensure the uploaded file is a valid PDF and not empty. |
Contributions are welcome! Please fork this repository, create a new branch for your feature or bug fix, and submit a pull request. For major changes, please open an issue to discuss them first.
This project is licensed under the MIT License. See the LICENSE file for more details.

