An interactive AI-powered roleplay system that brings characters to life through dynamic conversations and story-driven experiences.

![]() |
![]() |
git clone https://github.com/Jit-Roy/RoleRealm.git
cd RoleRealm
pip install -r requirements.txt
.env file and add your OpenRouter API key:
OPENROUTER_API_KEY=your_api_key_here
Simply run the main script:
python main.py
RoleRealm/
├── main.py # Main entry point
├── [Story Name]/ # Story-specific folders (e.g., "Pirate Adventure")
│ ├── characters/ # Character definition JSON files for this story
│ ├── story/ # Story JSON file (single file per story)
│ └── [story_name]_chat.json # Saved conversation history for this story
├── managers/ # Core system managers
│ ├── characterManager.py
│ ├── timelineManager.py # Unified timeline management (messages + scenes)
│ ├── storyManager.py
│ └── turn_manager.py
├── loaders/ # Data loaders
│ ├── character_loader.py
│ └── story_loader.py
├── helpers/ # Helper utilities
│ └── response_parser.py
└── config.py # Configuration settings
For more info visit docs/README.md
My Adventure)characters/ - For character JSON filesstory/ - For the story JSON file (single file only)Define characters in JSON format in the [Story Name]/characters/ folder. Each character should include:
Design your story in JSON format in the [Story Name]/story/ folder with:
Contributions are welcome! Feel free to submit issues or pull requests.
This project is open source and available under the MIT License.