Deterministic State-Driven Interactive Narrative Engine SDK
Project description
🚀 Story Builder Engine
Story Builder is an AI-powered branching narrative engine for games and interactive fiction.
Story Builder is a framework-agnostic Python SDK that provides a deterministic, state-driven engine for executing branching narratives with built-in validation and performance tracking.
Unlike "vibes-based" AI wrappers, Story Builder provides a rigorous mathematical model for story traversal, ensuring logical consistency and reliable state management.
🚀 Quickstart
1. Install the SDK
pip install story-builder-sdk
2. Generate a story
story-builder generate "Cyberpunk detective story"
3. Run the AI demo
story-builder demo-ai
This will generate a branching story graph and visualize it automatically.
🏗 Key Features
- AI-Powered Generation: Create complex branching stories from a single prompt.
- Deterministic Execution: No AI hallucinations in your core story logic.
- Unified Schema: Pydantic-driven story graphs and node structures.
- Stat-Based Branching: Transition between nodes based on complex condition evaluations.
- Mutable State Engine: Snapshot and rollback support with isolated state variables.
- Developer-First: Built-in CLI, JSON export, Ink support, and visualization.
🕹️ CLI Usage
Play an interactive story, generate new ones, or visualize graphs.
# Initialize a starter project
story-builder init
# Play a story
story-builder play story.json
# Visualize a story
story-builder visualize story.json
# Validate a story
story-builder validate story.json
# Export to Ink
story-builder export story.json --format ink
🎨 AI Features
Story Builder integrates with OpenRouter for high-quality narrative generation.
export OPENROUTER_API_KEY="YOUR_KEY"
story-builder generate "A space horror odyssey" --nodes 10
📜 Installation
# Basic installation
pip install story-builder
# With AI features (Pro)
pip install "story-builder[ai]"
# With Visualization features
pip install "story-builder[viz]"
Structure Your Story, Control Your World.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file story_builder_sdk-0.1.2.tar.gz.
File metadata
- Download URL: story_builder_sdk-0.1.2.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
937fbc124aba7ead3b71383724de47998815243249b40e50f70b95ae10dba987
|
|
| MD5 |
c5d03edfb928ca2e548fe45c0632e770
|
|
| BLAKE2b-256 |
03688d57adb52482cd77b1ac650dca84bc0a4f4f724e3f7ca0b376db59981827
|
File details
Details for the file story_builder_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: story_builder_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b84e28f7642d1308cd1558a928dba5bcdc888f2f01b9377ded699f1f850133c
|
|
| MD5 |
72cfc2721573fbb934ff1fb6dbf7d0b1
|
|
| BLAKE2b-256 |
141d014dcfb975f43e80fc3812e604f168650455a22b5ce0931ba426aad7731c
|