A beautiful, modern voice-activated AI assistant that narrates Bible stories with cinematic detail. Features a stunning web interface with gradient orb animations and 100% voice control using macOS native speech.
- Wake Word Activation: Just say "Hey Bible" to activate
- 100% Voice-Only Interface: No typing required
- Interrupt Speech: Click "Stop Speaking" to pause AI mid-sentence
- macOS Native TTS: Uses built-in
saycommand for natural speech
- Ultra-Premium Design: Gradient orb with breathing animations
- Responsive Layout: Works on desktop, tablet, and mobile
- Real-Time Updates: WebSocket communication for instant feedback
- Dark Theme: Easy on the eyes with purple/blue gradients
- Google Gemini 2.5 Flash: Latest AI model for biblical narratives
- Cinematic Descriptions: Vivid, immersive storytelling
- Contextual Understanding: Answers questions about biblical figures and events
- First-Time Setup: Beautiful modal for entering Gemini API key
- Persistent Storage: Saves key locally in JSON config
- Easy Updates: Click "🔑 Edit API Key" anytime to change
- Secure: Stored locally, never transmitted except to backend
- macOS (required for voice features)
- Python 3.13 or higher
- Google Gemini API Key (free from Google AI Studio)
- Microphone for voice input
git clone https://github.com/siiiidddexe/The-Bible-Ai-Python-Project.git
cd bible-ai-chatbotpython3 -m venv venv
source venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtRequired packages:
google-generativeai==0.8.5- Google Gemini AI SDKSpeechRecognition==3.14.3- Voice recognition with Python 3.13 supportwebsockets==15.0.1- WebSocket server for web UIaudioop-lts- Audio processing for Python 3.13
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy your API key (starts with
AIza...)
python3 bible_ai_with_web.pyWhat happens:
- Backend server starts on
ws://localhost:8765 - Web UI opens automatically in your default browser
- First-time users see API key setup modal
- Enter your Gemini API key and click "Save Key"
- Click "Start Listening" to begin
python3 bible_ai_app.pyFeatures:
- Traditional tkinter GUI window
- Same voice features as web version
- No browser required
- Gradient orb with animations
python3 bible_ai_with_web.py- Modal appears automatically
- Enter your Gemini API key
- Click "Save Key"
- Key is saved to
bible_ai_config.json
- Click "Start Listening" button (turns red)
- Status shows "Listening for 'Hey Bible'..."
- Say: "Hey Bible"
- AI responds: "Yes, how can I help?"
- Ask your question or request a story
- AI responds with cinematic narration
- While AI is speaking, button shows "Stop Speaking"
- Click to interrupt and resume listening
- AI stops immediately and waits for next "Hey Bible"
- Click "Stop" button to deactivate completely
- Button turns blue and shows "Start Listening"
You: "Hey Bible"
AI: "Yes, how can I help?"
You: "Tell me the story of David and Goliath"
AI: [Cinematic narration with vivid details...]
You: "Hey Bible"
AI: "Yes, how can I help?"
You: "Who was Moses?"
AI: [Clear, biblical explanation...]
You: "Hey Bible"
AI: "Yes, how can I help?"
You: "Tell me about the crossing of the Red Sea"
AI: [Immersive, atmospheric description...]
bible-ai-chatbot/
│
├── bible_ai_with_web.py # Main web app (RECOMMENDED)
├── bible_ai_app.py # Standalone desktop app
├── web_frontend.html # Web UI with gradient orb
├── bible_ai_config.json # API key storage (auto-created)
├── requirements.txt # Python dependencies
├── README_NEW.md # This file
└── .gitignore # Ignore config files
Automatically created on first run:
{
"require_api_key_setup": false,
"api_key": "AIza..."
}Important: Add this to .gitignore to keep your API key private!
Via Web UI:
- Click "🔑 Edit API Key" (top-right corner)
- Enter new API key
- Click "Save Key"
Via Config File:
- Open
bible_ai_config.json - Replace
api_keyvalue - Restart the app
| State | Orb Animation | Status Color | Button |
|---|---|---|---|
| Idle | Gentle breathing | Gray | "Start Listening" (Blue) |
| Listening | Breathing | Green | "Stop" (Red) |
| Speaking | Dynamic waves | Blue | "Stop Speaking" (Red) |
- Desktop (>768px): Full-size orb, wide layout
- Tablet (768px): Medium orb, adjusted spacing
- Mobile (<480px): Compact orb, stacked buttons
- Breathing Effect: Smooth 4s ease-in-out infinite
- Speaking Waves: Rotating particles with pulsing glow
- Sparkles: Floating ✦ symbols with dynamic movement
- Button Hovers: Smooth color transitions
pip install --upgrade google-generativeaipip install websocketspip install --upgrade SpeechRecognition audioop-lts# Kill existing Python processes
pkill -9 python3
# Then restart
python3 bible_ai_with_web.py- Check your API key is correct (starts with
AIza...) - Ensure you have internet connection
- Try regenerating API key at Google AI Studio
- Grant microphone permissions to Terminal/IDE in System Preferences
- macOS: System Preferences → Security & Privacy → Microphone
- Check your default microphone is selected
- Updated in v2.0 with subprocess control
- Uses
terminate()andkill()for instant stopping - Fallback with
killall sayfor lingering processes
- Stored locally in
bible_ai_config.json - Never transmitted to third parties
- Add to
.gitignorebefore committing
- Processed via Google Speech Recognition API
- Audio sent to Google for transcription
- No local storage of voice recordings
- Generated by Google Gemini API
- Sent over HTTPS to Google servers
- No local caching of responses
# Activate virtual environment
source venv/bin/activate
# Run with verbose output
python3 bible_ai_with_web.py
# Check WebSocket connection
# Browser console should show: "Connected to backend"Edit the system_instruction in bible_ai_with_web.py:
model = genai.GenerativeModel(
model_name='gemini-2.5-flash',
system_instruction="""Your custom instructions here..."""
)Modify the detection in listen_and_process():
if "hey bible" in text: # Change "hey bible" to your wake word- macOS 10.14 or higher
- 4GB RAM minimum (8GB recommended)
- Internet connection for AI and speech recognition
- Microphone for voice input
google-generativeai>=0.8.5
SpeechRecognition>=3.14.3
websockets>=15.0.1
audioop-lts-
Python 3.13 Compatibility
- Resolved: Using
SpeechRecognition==3.14.3withaudioop-lts
- Resolved: Using
-
WebSocket Handler
- Resolved: Updated to
websockets==15.0.1API (removedpathparameter)
- Resolved: Updated to
-
Speech Interruption
- Resolved: Switched from
os.system()tosubprocess.Popen()for proper process control
- Resolved: Switched from
This project is open source and available under the MIT License.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Having issues? Try these steps:
- Check Troubleshooting section
- Ensure all dependencies are installed
- Verify your API key is valid
- Check microphone permissions in System Preferences
- Restart the application
- Multiple language support
- Voice customization (speed, pitch, voice selection)
- Offline mode with local AI model
- Bible verse search and reference
- Daily devotional notifications
- Multi-user API key support
- Custom wake word configuration
- Speech-to-text history log
- Export conversations to PDF
- Google Gemini AI - Powering the biblical storytelling
- Google Speech Recognition - Voice transcription
- macOS
saycommand - Natural text-to-speech - WebSockets - Real-time web communication
- ✅ Added API key management modal
- ✅ Fixed "Stop Speaking" with subprocess control
- ✅ Enhanced responsive web design
- ✅ Added real-time WebSocket communication
- ✅ Improved error handling and logging
- Initial release with voice control
- Tkinter desktop interface
- Basic AI integration
Questions or feedback? Open an issue on GitHub!
Made with ❤️ for spiritual exploration through modern technology