๐ธ Create Your Own Interactive Story Worlds ๐ธ
An open-source Chrome extension for AI-driven character interactions, world-building, and immersive storytelling.
Features โข Installation โข Quick Start โข Documentation โข Roadmap
- Create Custom Characters: Design unique NPCs with personalities, greetings, and avatars
- Character Avatars: Upload custom avatars or generate via AI
- Player Character: Set your own character with custom personality traits
- Group Conversations: Organize characters into groups for multi-character interactions
- World Building: Define world settings, backgrounds, and lore with keyword-based worldbook entries
- Avatar & Portrait Management: Upload, preview, and delete character avatars and portraits
- Dynamic Chapters: Create story chapters with custom backgrounds and music
- Auto-Progression: Chapters advance based on:
- Time/dialogue count
- Keyword triggers
- AI-driven story judgment
- Chapter-Specific Media: Each chapter can have unique background images and music
- Background Images: World defaults + chapter-specific backgrounds with stretch-to-fill mode
- Background Music: Atmospheric audio that changes with chapters
- Visual Effects: Enhanced transparency for better background visibility with blur effects
- Sound Effects: Typewriter sound effects for authentic text appearance
- Character Portraits: Display character portraits during conversations with download capability
- Google Gemini: Free API via Google AI Studio (recommended)
- OpenAI Compatible: Support for OpenAI and compatible APIs
- Image Generation: Jimeng (Volcengine) API for character avatars and scene illustrations
- Multi-Language: Built-in support for English, Chinese, and Thai
- Multiple Worlds: Create and switch between different story worlds
- Import/Export: Complete world data export including characters, avatars, backgrounds, and chapters
- World Rename: Easily rename existing worlds
- Local Storage: All data stored locally in IndexedDB
- Example Worlds: Pre-configured example worlds for quick start
Create and manage multiple story worlds
Configure world settings, backgrounds, and music
Manage story chapters with backgrounds and triggers
Talk with diverse AI characters in immersive worlds
Create and customize characters with detailed settings and avatars
Add new characters with personality, greeting, and avatar
Experience immersive chat with beautiful backgrounds and effects
Dynamic storytelling with character interactions and chapter progression
Example character with detailed persona and backstory
Diverse character types for varied interactions
Create characters with different roles and personalities
Beautiful world environments with immersive backgrounds
Craft unique worlds and characters for your stories
Expanded chat view for maximum immersion
Complete interface showing all controls and options
Character and group management with quick access
-
Clone the repository
git clone https://github.com/jhfnetboy/XGarden.git cd XGarden -
Install dependencies
pnpm install
-
Build the extension
pnpm run build
-
Load in Chrome
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distfolder
- Open
-
Get a Free API Key
- Visit Google AI Studio
- Create a free Gemini API key
-
Configure XGarden
- Click the XGarden extension icon
- Go to Settings โ AI Config
- Enter your Gemini API key
- Select your preferred model (e.g.,
gemini-2.0-flash)
-
Create Your First World
- Click "Create New World"
- Add characters, define the world setting
- Start chatting!
- World Description: Overall setting and theme
- Default Background: Image shown when no chapter is active
- Default Music: Ambient music for the world
- Name: Character identifier
- Persona: Personality description for AI
- Greeting: First message
- Player Character: Mark one character as yourself
- Keywords: Trigger words (e.g., "magic system", "The Great War")
- Content: Lore and context injected when keywords appear
- Order: Chapter sequence
- Title & Description: Chapter info
- Background Image/Music: Chapter-specific media
- Trigger Type:
- Time: Advance after N dialogues or minutes
- Keyword: Advance when specific words appear
- AI Judgment: Let AI decide when to progress
For AI-generated character avatars and scene illustrations:
-
Get Jimeng API Keys
- Visit Volcengine Console
- Get Access Key ID and Secret Access Key
-
Configure in Settings
- Settings โ Image API
- Enter your credentials
- Documentation
Music files should be placed in public/assets/music/:
peaceful-forest.mp3calm-piano.mp3ambient-space.mp3medieval-lute.mp3gentle-rain.mp3
Free Music Resources:
Alternatively, modify getMusicUrl() in ChatInterface.tsx to use online URLs.
- React + TypeScript
- Vite - Build tool
- IndexedDB (via
idb) - Local storage - LangChain - AI integration
- TailwindCSS - Styling
src/
โโโ components/ # React components
โ โโโ ChatInterface.tsx
โ โโโ WorldSelector.tsx
โ โโโ Sidebar.tsx
โ โโโ ...
โโโ services/ # Core services
โ โโโ database.ts # IndexedDB operations
โ โโโ ai.ts # AI service
โ โโโ globalConfig.ts # Settings
โ โโโ vector-db.ts # Vector search (RAG)
โโโ App.tsx # Main app
pnpm run dev # Development mode
pnpm run build # Production build
pnpm run preview # Preview build- โ World default backgrounds and music
- โ Chapter system with auto-progression
- โ Character and group management
- โ Worldbook entries
- โ Image API configuration (Jimeng)
- โ Enhanced background image clarity (bg-cover stretching)
- โ Avatar and portrait management with delete functionality
- โ Improved UI transparency for better background visibility
- โ Typewriter sound effects for authentic text appearance
- โ World rename functionality
- โ Multi-language support (English, Chinese, Thai)
- โ Portrait download capability
- โ Sidebar logo branding
- ๐ AI image generation integration
- Character avatar generation
- Scene illustration generation
- Dynamic visual storytelling
- ๐ Enhanced RAG with vector embeddings
- ๐ Performance optimizations
- ๐ Pre-built World Templates
- Romance of the Three Kingdoms (ไธๅฝๆผไน)
- Journey to the West (่ฅฟๆธธ่ฎฐ)
- The Three Musketeers
- Greek Mythology
- Norse Mythology
- And more classic literature worlds
- ๐ญ Historical Characters Integration
- Interact with historical figures in their contexts
- Accurate historical backgrounds and settings
- Educational storytelling experiences
- ๐งโ๐ฌ Scientists & Innovators
- Alan Turing (Computer Science Pioneer)
- Claude Shannon (Information Theory Founder)
- Albert Einstein (Theoretical Physicist)
- Isaac Newton (Mathematician & Physicist)
- Marie Curie (Physicist & Chemist)
- And many more...
- ๐ญ Philosophers & Thinkers
- Socrates, Plato, Aristotle
- Confucius, Laozi
- Modern philosophers
- ๐ผ Economists & Psychologists
- Adam Smith, John Maynard Keynes
- Sigmund Freud, Carl Jung
- Contemporary thought leaders
- ๐จ Artists & Writers
- Shakespeare, Tolstoy, Hemingway
- Da Vinci, Van Gogh, Picasso
- And more cultural icons
- ๐ฎ Community Features
- Share custom worlds and characters
- Community-created content library
- Rating and review system
- ๐ Multiplayer Interactions
- Shared world experiences
- Collaborative storytelling
- Real-time character interactions
- ๐ Gamification
- Achievement system
- Story progression tracking
- Community challenges
- ๐ฌ Video generation for cinematic storytelling
- ๐๏ธ Voice synthesis for character dialogues
- ๐ณ Branching storylines with choice consequences
- ๐ Blockchain integration for NFT characters/worlds
- ๐ฑ Mobile companion app
- ๐ Multi-language support (Chinese, English, Japanese, etc.)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini for free AI API access
- Volcengine Jimeng for image generation capabilities
- LangChain for AI integration framework
- Open-source AI training datasets for historical character data
- All open-source contributors and community members
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with โค๏ธ by the XGarden Team
โญ Star us on GitHub if you find this project useful! โค๏ธ Thanks and inspired by 3000World repo and SillyTavern