An agentic speech-to-speech RPG game master powered by OpenAI GPT-4o and speech technologies. This application allows you to play tabletop RPGs using voice commands and receive spoken responses from an AI game master.
- Speech-to-Speech Interaction: Talk to the AI game master and hear responses
- Persistent Game State: Games are saved in a ChromaDB database
- PDF & Text Game File Support: Import RPG content from various file formats
- Voice Character Generation: Different character voices for NPCs and monsters
- Dice Rolling: Support for various dice notations (d20, 2d6+3, etc.)
- Game History: Track and review game events
- Web Interface: Browser-based GUI for easier interaction
- Install the required dependencies:
pip install -r requirements.txt- Add your OpenAI API key to a
.envfile in the project root:
OPENAI_API_KEY=your_api_key_here
- Add game files to the
game_filesdirectory (PDF, TXT files work best)
Run the application in terminal mode:
python rpg_gameweaver_core.pyRun the web server for browser access:
python rpg_gameweaver_server.pyThen open your browser and navigate to:
http://localhost:5000
help- Show this help messagestart- Start or resume a gameplayers- List current playersgames- List and select available game filesvoice on- Enable speech recognitionvoice off- Disable speech recognitionsave- Save current game statehistory- Show recent game historyroll <dice>- Roll dice (e.g., "roll d20" or "roll 2d6")exitorquit- Exit the application
rpg_gameweaver_core.py- Main application entry point (CLI version)rpg_gameweaver_server.py- Flask web server for browser interfacetemplates/- HTML templates for web interfacestatic/- CSS and JavaScript files for web interfaceutils/- Utility modules:audio_utils.py- Audio recording and playbackdb_utils.py- ChromaDB database operationsfile_utils.py- File import and parsingvoice_utils.py- Speech-to-text and text-to-speech processing
game_files/- Directory for game content (PDF, TXT)chroma_db/- ChromaDB persistence directory (created on first run)
Place your RPG game files in the game_files directory. Both PDF and text files are supported. When starting a new game, you'll be prompted to select from available game files.
The web interface provides a more user-friendly way to interact with the RPG Game Master:
- Rich text display for game interactions
- Easy command input through a text box
- Voice selection dropdowns for character voices
- One-click access to common commands (start, save, etc.)
- Modal displays for player information and game history
- Voice toggle button for enabling/disabling speech input/output