Skip to content

stoicma/ai-satoshi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fireside DAM - Satoshi Nakamoto AI

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.

๐ŸŽญ Features

Character Switching System

  • 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

Enhanced Audio Experience

  • 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

Special Effects

  • 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

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • OpenAI API key with Realtime API access

Installation

  1. Clone the repository

    git clone https://github.com/stoicma/ai-satoshi.git
    cd fireside-dam
  2. Install dependencies

    npm install
  3. 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
    
  4. Start the development server

    npm run dev
  5. Open your browser Navigate to http://localhost:3000

๐ŸŽฎ Usage

Basic Operation

  1. Start Recording: Click the microphone button to begin voice chat
  2. Speak Naturally: The AI will respond in character as the current persona
  3. 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?"

Controls

  • ๐ŸŽค Microphone: Start/stop voice recording
  • ๐Ÿ‘ฅ Character Switch: Manually trigger character change
  • ๐Ÿ”„ Auto-Rotate: Toggle automatic character switching
  • ๐Ÿ”Š Sound Effects: Enable/disable audio effects

Personas

Hal Finney

  • Voice: Echo
  • Style: Technical, optimistic, clear explanations
  • Background: Early Bitcoin developer, received first Bitcoin transaction

Nick Szabo

  • Voice: Echo
  • Style: Academic, complex terminology, historical references
  • Background: Smart contracts creator, Bit Gold inventor

Dorian Nakamoto

  • Voice: Ash
  • Style: Confused about crypto, broken English, denies being Satoshi
  • Background: Engineer mistakenly identified as Satoshi by Newsweek

Craig Wright

  • Voice: Verse
  • Style: Authoritative, combative, claims to be Satoshi
  • Background: Australian computer scientist, Bitcoin SV advocate

Jack Dorsey

  • Voice: Ash
  • Style: Calm, minimalist, Bitcoin maximalist
  • Background: Twitter founder, Square/Block CEO

AI Satoshi

  • 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

๐Ÿ›  Technical Details

Architecture

  • 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

Key Components

  • TrueRealtimeVoiceUI.tsx: Main voice interface with character switching
  • PersonaSelector.tsx: Character selection component
  • soundEffects.ts: Audio effects system
  • personas/index.ts: Character definitions and configurations

API Routes

  • /api/realtime-chat: Creates OpenAI Realtime API sessions with persona context

๐Ÿ”ง Configuration

Environment Variables

OPENAI_API_KEY=your_openai_api_key_here

Persona Customization

Edit src/personas/index.ts to modify:

  • Character personalities and speaking styles
  • Voice assignments
  • Rotation durations
  • System prompts

Sound Effects

Modify src/utils/soundEffects.ts to customize:

  • Character switch sounds
  • Privacy alert tones
  • Transition effects

๐ŸŽฏ Use Cases

  • 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

๐Ÿ”’ Security

  • โœ… API keys stored server-side only
  • โœ… No client-side secret exposure
  • โœ… Environment variables properly configured
  • โœ… WebRTC secure connections

๐Ÿ“ License

MIT License - see LICENSE file for details

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

๐Ÿ› Troubleshooting

Common Issues

"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)

Debug Mode

Enable debug logging by checking the browser console for [DEBUG] messages.

About

An example app built with the Realtime API from OpenAI that goes through different Satoshi characters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors