Skip to content

About

Shakescript โ€“ Where AI Weaves Tales Worthy of the Bard. ๐ŸŽญโœจ

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

200 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽญ ShakeScript - An AI-Based Story Creation Platform

Python Version Framework Frontend License Stars Badge

ShakeScript Introduction

ShakeScript is a cutting-edge, AI-powered storytelling system designed to generate immersive, multi-episode narratives with rich characters, evolving plots, and long-term memory. By blending the strengths of GPT-4o and Google Gemini, it overcomes traditional limitations in AI storytelling, such as token constraints and narrative inconsistencies.


๐Ÿ” The Problem

Traditional AI-generated stories often struggle with:

Challenge Description
๐Ÿ”„ Narrative Coherence Maintaining seamless connections between episodes.
๐Ÿง  Token Limitations Handling the restricted context windows of large language models.
๐Ÿ‘ค Character Consistency Preserving character traits, relationships, and emotional states.
๐Ÿ“š Extended Narratives Structuring long stories into coherent, episodic chunks.
๐Ÿ’พ AI Memory Retaining relevant story context across multiple episodes.

๐Ÿš€ ShakeScript: Your AI Storytelling Engine

ShakeScript enables long-form storytelling with AI memory, human feedback integration, and cultural nuance.

โœ… Core Capabilities

  • Accepts brief prompts, including genres, tropes, or plotlines.
  • Generates multi-episode stories with detailed world-building and character arcs.
  • Maintains narrative continuity using metadata and embeddings.
  • Supports Hinglish storytelling.
  • Offers both AI-driven and human-in-the-loop episode refinement.
  • Utilizes a robust database and Gemini-based semantic embeddings for memory.

๐Ÿ“‚ Architecture & Workflow

1๏ธโƒฃ Prompt-to-Metadata Extraction (via Google Gemini)

  • Endpoint: /stories
  • Gemini extracts:
    • Characters: Names, roles, relationships, and emotions.
    • Settings: Detailed location descriptions.
    • Structure: Exposition โ†’ Climax โ†’ Denouement.
    • Theme & Tone: (e.g., Suspenseful, Romantic).
  • Data is stored in Supabase in the stories and characters tables.

2๏ธโƒฃ Episode Generation (via GPT-4o)

Initial Episode

  • Uses structured metadata to generate an episode that aligns with the story's outline (e.g., Exposition).

Subsequent Episodes

  • Retrieves up to three past episodes for context.
  • Gemini-generated embeddings fetch relevant story chunks to ensure long-form continuity.
  • Ensures character consistency, thematic alignment, and narrative progression.

Storage

  • Saves episode content, titles, summaries, and emotional states in the episodes table.
  • Splits episodes into semantic chunks using SemanticSplitterNodeParser.
  • Vectorizes and stores these chunks in the chunks table using Gemini Embeddings.

3๏ธโƒฃ Memory Management

Supabase (db_service.py)

  • Tracks the current_episode, key_events, timeline, and character evolution.

Embedding Service (embedding_service.py)

  • Uses Google Gemini Embeddings (models/embedding-001) to vectorize story chunks.
  • Scores relevance based on the characters involved and episode order, enabling memory-aware story generation.

4๏ธโƒฃ API & Frontend Integration

FastAPI Backend

  • Endpoints:
    • /stories โ€“ Create a new story.
    • /generate-batch โ€“ Generate a batch of episodes.
    • /refine-batch โ€“ Handle human feedback and refinement.
  • Uses Pydantic models for structured data (schemas.py).

Frontend

  • A React/Next.js user interface.
  • Features:
    • Episode display.
    • Character profiles.
    • Hinglish support.
    • Real-time story updates.

๐Ÿ› ๏ธ Tech Stack

AI & NLP
GPT-4o Google Gemini Gemini Embedding

Backend
FastAPI Pydantic Asyncio

Database & Embeddings
Supabase PostgreSQL LlamaIndex


๐ŸŽฏ Key Achievements

  • ๐Ÿ† Multi-Episode Consistency โ€“ Maintains coherent and evolving narratives.
  • ๐Ÿ’ก Token Limit Workaround โ€“ Smart retrieval using Gemini Embeddings.
  • ๐Ÿ‘ค Character Evolution โ€“ Tracks character traits, arcs, and relationships.
  • ๐Ÿ” Human Refinement โ€“ Combines LLM polish with user feedback.
  • ๐ŸŒ Hinglish Support โ€“ Culturally tuned storytelling.

๐Ÿ–ผ๏ธ Visuals & Evaluations

๐Ÿงฉ Model Pipeline

Model Pipeline


๐Ÿ“ˆ Radar Chart - Story Attribute Comparison

Radar Chart


๐Ÿชฑ Worm Graph - Evaluation Metrics (out of 10)

Worm Chart


๐Ÿ”ฎ Future Enhancements

Feature Description
๐ŸŽง TTS Narration Add audio playback with Text-to-Speech.
๐Ÿง  Custom AI Models Fine-tune LLMs for specific genres or styles.

๐Ÿ’ฌ Final Thoughts

ShakeScript redefines AI-powered storytelling by:

  • Solving token limitation challenges.
  • Supporting long-form, culturally nuanced narratives.
  • Seamlessly blending LLMs, embeddings, and human input.

๐ŸŽ‰ Let the stories unfold โ€” with ShakeScript, your narrative has no limits.


Made with โค๏ธ by the ShakeScript AI Team

About

Shakescript โ€“ Where AI Weaves Tales Worthy of the Bard. ๐ŸŽญโœจ

Resources

Stars

4 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages