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โlike token constraints and inconsistent narratives.
Traditional AI-generated stories often struggle with:
| Challenge | Description |
|---|---|
| ๐ Narrative Coherence | Maintaining seamless connections between episodes |
| ๐ง Token Limitations | Handling restricted context windows in large language models |
| ๐ค Character Consistency | Preserving character traits, relationships, and emotional states |
| ๐ Extended Narratives | Structuring long stories into coherent, episodic chunks |
| ๐พ AI Memory Integration | Retaining relevant story context across episodes |
ShakeScript enables long-form storytelling with AI memory, human feedback integration, and cultural nuance.
- Accepts brief prompts (genre, trope, or plotline)
- Generates multi-episode stories with world-building and character arcs
- Maintains narrative continuity via metadata & embeddings
- Supports Hinglish storytelling
- Offers both AI-driven and human-in-the-loop episode refinement
- Uses a robust database + semantic embeddings for memory
- Endpoint:
/stories - Gemini extracts:
- Characters: Names, roles, relationships, emotions
- Settings: Detailed location descriptions
- Structure: Exposition โ Climax โ Denouement
- Theme & Tone: (e.g., Suspenseful, Romantic)
- Data stored in Supabase:
stories,characterstables
- Uses structured metadata
- Generates the episode aligned to outline (e.g., Exposition)
- Retrieves up to 2-3 past episodes for context
- Embeddings fetch relevant content chunks for long-form continuity
- Ensures:
- Character consistency
- Thematic alignment
- Narrative progression
- Saves episode content, title, summary, emotion in
episodestable - Splits episode into semantic chunks using
SemanticSplitterNodeParser - Vectorizes & stores in
chunkstable
- Checks:
- Timeline alignment
- Character location/motivation consistency
- Dialogue and tone coherence
- Refines up to 3 times if inconsistencies found
- Users can refine via
/refine-batch - Gemini regenerates while preserving core elements
- Default batch size: 2 episodes
- Intermediate state stored in
current_episodes_content
- Tracks:
current_episodekey_events,timeline- Character evolution
- HuggingFace embeddings vectorize story chunks
- Relevance scored based on:
- Characters involved
- Episode order
- Enables memory-aware story generation
- Endpoints:
/storiesโ Create new story/generate-batchโ Batch generate episodes/validate-batchโ AI validation/refine-batchโ Human feedback and refinement
- Uses Pydantic models for structure (
schemas.py)
- React/Next.js UI
- Features:
- Episode display
- Character profiles
- Hinglish support
- Real-time story updates
| Category | Technologies Used |
|---|---|
| AI & NLP | GPT-4o, Google Gemini, HuggingFace Embeddings |
| Backend | FastAPI, Pydantic, Asyncio |
| Database | Supabase (PostgreSQL) |
| Embeddings & Retrieval | LlamaIndex (SemanticSplitterNodeParser), Supabase Vector DB |
| Language | Python 3.13 with type hints |
- ๐ Multi-Episode Consistency โ Maintains coherent, evolving narratives
- ๐ก Token Limit Workaround โ Smart retrieval with embeddings
- ๐ค Character Evolution โ Tracks traits, arcs, and relationships
- ๐ AI + Human Refinement โ Combines LLM polish with user feedback
- ๐ Hinglish Support โ Culturally tuned storytelling
| Feature | Description |
|---|---|
| ๐ฎ Interactive Storylines | Let users influence story direction via input parameters |
| ๐ง TTS Narration | Audio playback support with Text-to-Speech |
| ๐ง Custom AI Models | Fine-tune LLMs for specific genres or styles |
| ๐ฑ Frontend UI | Responsive, real-time React/Next.js interface |
| ๐ Smart Retrieval | Advanced hybrid/cosine similarity chunk search |
ShakeScript redefines AI-powered storytelling by:
- Solving token limitation challenges
- Supporting long-form, culturally nuanced storytelling
- Seamlessly blending LLMs, embeddings, and human input
๐ Let the stories unfold โ with ShakeScript, your narrative has no limits.


