A character-switching conversational AI agent for fireside chat conference presentations using OpenAI's Realtime API with WebRTC. Features multiple Satoshi Nakamoto personas with automatic rotation, sound effects, and special privacy detection.
- 6 Unique Personas: Hal Finney, Nick Szabo, Dorian Nakamoto, Craig Wright, Jack Dorsey, and AI Satoshi
- Automatic Rotation: Characters switch every 2-4 messages or based on conversation cues
- Manual Control: Dedicated button for instant character switching
- Theatrical Effects: Visual transitions with animations and sound effects
- Real-time Voice Chat: Direct WebRTC connection to OpenAI's Realtime API
- Sound Effects: Character switch sounds, privacy alerts, and system notifications
- Voice Variety: Each persona has a unique voice (echo, ash, verse, shimmer, etc.)
- Audio Controls: Toggle sound effects on/off
- Privacy Detection: Visual and audio alerts when privacy topics are mentioned
- AI Satoshi Glitch: Special glitch effects for the AI Satoshi persona when privacy is discussed
- Visual Overlays: Dramatic transition effects during character switches
- Node.js 18+
- OpenAI API key with Realtime API access
-
Clone the repository
git clone https://github.com/stoicma/ai-satoshi.git cd fireside-dam -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Add your OpenAI API key to
.env.local:OPENAI_API_KEY=your_openai_api_key_here -
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
- Start Recording: Click the microphone button to begin voice chat
- Speak Naturally: The AI will respond in character as the current persona
- Character Switching:
- Automatic: Characters rotate every 2-4 messages
- Manual: Click the ๐ฅ button to switch immediately
- Conversation Cues: AI detects handoff phrases like "what do you think?"
- ๐ค Microphone: Start/stop voice recording
- ๐ฅ Character Switch: Manually trigger character change
- ๐ Auto-Rotate: Toggle automatic character switching
- ๐ Sound Effects: Enable/disable audio effects
- Voice: Echo
- Style: Technical, optimistic, clear explanations
- Background: Early Bitcoin developer, received first Bitcoin transaction
- Voice: Echo
- Style: Academic, complex terminology, historical references
- Background: Smart contracts creator, Bit Gold inventor
- Voice: Ash
- Style: Confused about crypto, broken English, denies being Satoshi
- Background: Engineer mistakenly identified as Satoshi by Newsweek
- Voice: Verse
- Style: Authoritative, combative, claims to be Satoshi
- Background: Australian computer scientist, Bitcoin SV advocate
- Voice: Ash
- Style: Calm, minimalist, Bitcoin maximalist
- Background: Twitter founder, Square/Block CEO
- Voice: Shimmer
- Style: Futuristic AI claiming to be real Satoshi, glitches on privacy topics
- Background: AI from the future with regrets about Bitcoin's limitations
- Frontend: Next.js 14 with React 18
- Styling: Tailwind CSS
- Audio: Web Audio API with custom sound effects
- Real-time: WebRTC connection to OpenAI Realtime API
- Voice Processing: OpenAI's gpt-4o-realtime-preview model
TrueRealtimeVoiceUI.tsx: Main voice interface with character switchingPersonaSelector.tsx: Character selection componentsoundEffects.ts: Audio effects systempersonas/index.ts: Character definitions and configurations
/api/realtime-chat: Creates OpenAI Realtime API sessions with persona context
OPENAI_API_KEY=your_openai_api_key_hereEdit src/personas/index.ts to modify:
- Character personalities and speaking styles
- Voice assignments
- Rotation durations
- System prompts
Modify src/utils/soundEffects.ts to customize:
- Character switch sounds
- Privacy alert tones
- Transition effects
- Conference Presentations: Engaging fireside chats with dynamic character switching
- Educational Demos: Teaching about Bitcoin history through different perspectives
- Entertainment: Interactive conversations with Bitcoin personalities
- Research: Exploring different viewpoints on cryptocurrency topics
- โ API keys stored server-side only
- โ No client-side secret exposure
- โ Environment variables properly configured
- โ WebRTC secure connections
MIT License - see LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
"Module not found" errors: Ensure all dependencies are installed with npm install
API connection failures: Verify your OpenAI API key has Realtime API access
Audio not working: Check browser permissions for microphone access
Character switching not working: Ensure WebRTC connection is established (check browser console)
Enable debug logging by checking the browser console for [DEBUG] messages.