jschm42/taleweaver
关于
A next-generation AI-powered text adventure engine featuring dynamic storytelling, procedural world-building, and immersive visual/auditory generation.
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文TaleWeaver
Weave Living Stories. Craft and Play Immersive AI Adventures.
An open-source, local-first interactive fiction engine combining adaptive AI storytelling with deterministic Python game mechanics, cinematic voices, and agent authoring tools.
Features · Quick Start · Agent Skills · AI Ecosystem · Docker · Scripting
For detailed descriptions and feature breakdowns of each screen, see the Screenshot Guide.
🎯 The Core Concept: Determinism Meets Narrative
Pure LLM text games often suffer from hallucinated world states: keys unlock doors that never existed, inventory items vanish, and puzzles can be bypassed with arbitrary persuasion prompts.
TaleWeaver separates mechanics from prose via a strict 2-pass architecture:
- Pass 1 (Deterministic Mechanics): A local RPG engine validates movements, locked exits, inventory states, dice rolls, and custom Python scripts.
- Pass 2 (Atmospheric Narration): The LLM translates the validated state transition into evocative prose, dynamic NPC dialogue, and comic-style panels.
The result is a responsive narrative where player choices carry genuine mechanical consequences.
✨ Key Features
🧠 Adaptive Game Master & Gameplay
|
🛠️ Authoring Studio & AI Tools
|
🤖 Create with AI Agents (Claude Code, Cursor, Antigravity)
TaleWeaver includes first-class support for coding agents to design, modify, and package complete adventures directly from the terminal or IDE:
# Equip Claude Code with all TaleWeaver authoring skills
npx taleweaver-skills --all /path/to/project --format claude
# Or install for Antigravity / Cursor (.agents/skills/)
npx taleweaver-skills --all /path/to/project --format antigravity
With these skills installed, your agent can:
- Generate valid, structured blueprints (
taleweaver-adventure-concept-creator). - Apply atomic JSON change sets and sandbox-tested scripts (
taleweaver-adventure-editor). - Validate room reachability, locks, and progression logic before release.
🚀 Quick Start
Automatic Setup (Recommended)
The setup script checks dependencies, sets up virtual environments, runs database migrations, and initializes configuration:
Linux / macOS:
git clone https://github.com/jschm42/taleweaver.git
cd taleweaver
chmod +x setup.sh && ./setup.sh
./run.sh
Windows (PowerShell):
git clone https://github.com/jschm42/taleweaver.git
cd taleweaver
.\setup.ps1
.\run.ps1
Open http://127.0.0.1:8000 in your browser. Configure your preferred LLM provider keys under Administration → Provider Vault and launch an adventure!
Manual Development Setup
Requirements: Python 3.11–3.13, Poetry 2.x, Node.js 18+
# 1. Install backend dependencies
git clone https://github.com/jschm42/taleweaver.git
cd taleweaver
poetry install
git config core.hooksPath .githooks
# 2. Environment setup & encryption keys
cp .env.example .env
poetry run python scripts/generate_fernet_key.py
# 3. Database migrations
poetry run alembic upgrade head
# 4. Frontend build
cd frontend && npm ci && npm run build && cd ..
# 5. Start backend
poetry run taleweaver
For hot-reloading during development:
- Backend:
poetry run taleweaver-dev - Frontend:
cd frontend && npm run dev
🐳 Running with Docker
Deploy frontend and backend in a unified container with persistent data storage:
git clone https://github.com/jschm42/taleweaver.git
cd taleweaver
bash scripts/docker-setup.sh # Windows: scripts\docker-setup.bat
Persistent data (taleweaver.db, logs, custom assets, and downloaded adventures) is stored in DOCKER_DATA_DIR (default ./data-docker).
Docker ports are configured separately from local dev ports in .env via DOCKER_HTTPS_PORT (default 5173) and DOCKER_HTTP_PORT (default 80), so you can run a Docker container and a local dev instance (FRONTEND_PORT / BACKEND_PORT) side by side without port conflicts.
On a slow display (for example a dev instance used over Remote Desktop), set REDUCED_EFFECTS=true in .env and restart the Vite dev server: the login and register pages then show a still background and no background music plays. Each player can also switch music off in their profile (Account → Music).
🔌 Supported AI Ecosystem
TaleWeaver leverages LiteLLM and direct provider adapters to support both cloud and self-hosted inference:
| Role / Capability | Recommended Models | Recommended Providers | Requirements & Notes |
|---|---|---|---|
| World Generation (Pass 3) | Claude 5 Opus, GPT-6 Sol/Astra, Gemini 4 Argon, DeepSeek-V4 Pro | Anthropic, OpenAI, DeepSeek, OpenRouter, vLLM / Ollama | Deep reasoning and large context to synthesize valid adventure manifests |
| Mechanics & Rules (Pass 1) | Gemini 3.8 flash, GPT-6 Luna, Claude 5.5 Haiku, DeepSeek-V4 flash, gpt-oss-120b | Google Gemini, OpenAI, Anthropic, DeepSeek, OpenRouter | Strict JSON schema compliance and fast entity resolution |
| Narrative & Dialogue (Pass 2) | Claude 5.5 Sonnet, GPT-6 Luna, DeepSeek-V4 Flash, Cydonia 24B, Qwen 3.8 27B | Anthropic, OpenAI, DeepSeek, OpenRouter, Ollama | Nuanced prose, narrator voice tone, and strict adherence to secret rules |
| Play-Agent & Memory (Pass 4 & 5) | Gemini 3.5 Flash-Lite, gpt-oss-120b, Qwen 3.8 27B | Google Gemini, OpenAI, Mistral, OpenRouter | Fast decision-making and token-efficient historical summarization |
| Text-to-Speech (TTS) | Gemini Flash TTS, ElevenLabs, Kokoro-82M (offline), Browser WebSpeech | Google Gemini, ElevenLabs, OpenAI-compatible TTS, Local Kokoro | Per-character voice mapping and cinematic storytelling |
| Speech-to-Text (STT) | faster-whisper (Base / Small / Medium, int8) | Local Whisper (background thread) | Zero-latency Push-to-Talk via keyboard shortcuts (V, B, T, Shift) |
| Visual Scene Art | FLUX 3 (BFL / Schnell), GPT Image 2.5, Stable Diffusion, ComfyUI | Black Forest Labs, Fal.ai, Local WebUI, ComfyUI | Contextual illustrations for locations, items, and NPCs |
🐍 Sandboxed Python Scripting
TaleWeaver runs deterministic game logic in an isolated AST interpreter (backend/engine/scripting), preventing arbitrary code execution while giving authors direct control:
# Example: Triggering a secret exit when an altar is examined with an item
def on_interact(tw, target, actor):
if target.id == "ANCIENT_ALTAR" and tw.player.has_item("RUBY_EYE"):
tw.exits.unlock("CRYPT_DOOR")
tw.flags.set("altar_activated", True)
tw.story.narrate("The ruby fits the hollow. Stone grinds against stone.")
- Lifecycle Hooks:
on_enter_scene,on_interact,on_turn_start,on_turn_end,on_time_reached. - API Runtime (
tw.*): Full control over scenes, exits, container inventories, flags, dialogue choices (tw.dialog), in-game clock (tw.time), and dynamic audio triggers. - See the full Scripting Engine Guide.
🛠️ Adventure Packages & Formats
Adventures are portable and shareable:
.adv/.adzPackages: Versioned archives containing complete manifests, entity definitions, audio files, and generated imagery.- In-Game Adventure Catalog: Direct access to the Community Adventure Repository with automatic versioning and update notifications.
- MCP Server Support: Native Model Context Protocol endpoint for inspecting state and executing edits remotely (setup guide).
📜 License & Community
- Engine Code: MIT License
- Adventure Content: CC-BY-NC 4.0
- Community Adventures: Submit or browse adventures at taleweaver-adventures.
探索相关项目
加载中…








