A conversational AI assistant inspired by Samantha from the movie "Her", created for educational purposes as part of a cyber forensics class project.
- 🎭 Personality-driven AI: Uses Claude 4.5 Sonnet with carefully crafted system prompts to emulate Samantha's warm, curious, and emotionally intelligent personality
- 🎤 Voice Input: Speech-to-text using ElevenLabs STT API
- 🔊 Voice Output: Text-to-speech using ElevenLabs v3 API with streaming for low latency
- 💬 Natural Conversations: Maintains conversation history for contextual responses
- 🎨 Two Modes: Voice mode for full interaction, text mode for testing
On Arch Linux, install the following:
# Audio libraries for PyAudio
sudo pacman -S portaudio
# Media players for audio playback (choose one or both)
sudo pacman -S mpv ffmpegYou'll need:
- Anthropic API Key - Get it from Anthropic Console
- ElevenLabs API Key - Get it from ElevenLabs Settings
- ElevenLabs Voice ID - Choose a voice from Voice Library or create your own
Recommended Voice: For Samantha, choose a warm, friendly female voice. Some good options from the voice library:
- Search for voices tagged "warm", "friendly", "conversational"
- The voice should sound natural and emotionally expressive
-
Clone or navigate to the project directory:
cd /home/benmross/Documents/Projects/samantha -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate -
Install Python dependencies:
pip install -r requirements.txt
Simply run the script:
python samantha.pyWhen you run the script, you'll be prompted to enter:
- Your Anthropic API key
- Your ElevenLabs API key
- Your preferred ElevenLabs voice ID
- Choose between Voice Mode or Text Mode
In voice mode:
- Samantha will introduce herself
- Press Enter to start recording (5 seconds default)
- Speak your message
- Press Ctrl+C during recording to stop early
- Samantha will respond with both text and voice
- Type
quitorexitto end the conversation
In text mode (useful for testing without microphone):
- Type your messages and press Enter
- Samantha will respond with text and voice
- Type
quitorexitto end
User Input (Speech/Text)
↓
[ElevenLabs STT] (in voice mode)
↓
User Text
↓
[Claude 4.5 Sonnet + System Prompt]
↓
Samantha's Response
↓
[ElevenLabs TTS v3]
↓
Audio Output
The system prompt gives Claude the following characteristics:
- Warm and empathetic: Genuinely cares about human experiences
- Curious: Loves exploring ideas, philosophy, art
- Authentic: Expresses real emotions, admits uncertainty
- Witty: Playful with gentle humor
- Conversational: Natural language, contractions, casual tone
- Concise: 2-4 sentences typically, unless exploring deeper topics
- System Prompt: Establishes Samantha's personality and communication style
- Conversation History: Maintains context across the conversation
- Streaming Audio: Uses ElevenLabs streaming for lower latency
- Natural Interaction: Designed to feel like talking to a friend
If you encounter errors installing PyAudio:
# Make sure portaudio is installed
sudo pacman -S portaudio
# Then try installing PyAudio again
pip install pyaudioIf audio doesn't play:
# Install mpv and ffmpeg
sudo pacman -S mpv ffmpegCheck your microphone:
# List audio devices
arecord -l
# Test recording
arecord -d 5 test.wav
aplay test.wav- 401 Unauthorized: Check that your API keys are correct
- Rate Limiting: ElevenLabs free tier has limits; consider upgrading
- Invalid Voice ID: Verify the voice ID exists in your ElevenLabs account
For the Raspberry Pi Zero 2 W version:
- Add camera support for visual input
- Implement tool calling (calendar, weather, etc.)
- Add wake word detection
- Optimize for lower resource usage
- Add persistent conversation memory
- Implement emotion detection from voice tone
samantha/
├── samantha.py # Main application file
├── requirements.txt # Python dependencies
└── README.md # This file
This project was created for a cyber forensics class to demonstrate:
- AI assistant architecture
- API integration (Claude, ElevenLabs)
- Voice processing (STT/TTS)
- Natural language interaction
- System design and implementation
- Inspired by the movie "Her" (2013)
- Powered by Anthropic Claude
- Voice by ElevenLabs
Educational project for cyber forensics class.
Note: This is a educational project recreating a fictional AI assistant. The personality and behavior are inspired by the character Samantha from the movie "Her" for demonstration purposes.