Each chapter gets an AI-generated illustration, spoken narration and genre-matched ambient music, and any of four LLM providers (local Ollama, Groq, Hugging Face or OpenAI) can write the text. The student received the web app and code, an IEEE-format paper, a longer single-column paper and a full dissertation.
What is this project, at a glance?
| Item | Details |
|---|---|
| Level | M.Tech |
| Domain | Generative AI, natural language processing |
| Problem type | Personalised, controllable story generation (human–AI co-creation) |
| Core methods | Guided Q&A to capture preferences; keyword and pattern-based context extraction; genre- and phase-aware prompt templates; a five-phase story arc; character and plot-thread tracking with consistency checks; a provider-agnostic LLM layer |
| Stack | Python, FastAPI and Uvicorn, Pydantic, SQLite; HTML, CSS, JavaScript and D3.js; Ollama, Groq, Hugging Face and OpenAI models; an AI image service, browser speech synthesis and ambient music |
| Deliverables | Web app and source code, IEEE-format paper, single-column research paper, M.Tech dissertation in LaTeX, result figures, presentation slides |
What problem does this AI story generator project solve?
Most AI story tools take a single prompt and return a block of text. The reader has little say in what happens, and in longer sessions the model tends to forget characters, drop plot threads or lose its pacing. Many tools also depend on one paid API.
The literature review found that existing systems lean one way or the other: open-ended tools such as AI Dungeon give freedom but lose coherence, while structured tools such as Dramatron keep coherence but offer less interaction. This project combines both, and runs on free or local models.
How does the system turn answers into a story?
The backend is a pipeline of seven modules, each with one job:
- Question flow. Guided questions cover setting, characters, theme and plot. Each offers ready options or a free-text answer, and the reader chooses how many questions to answer, from a quick set to the full one.
- Context extraction. Keyword maps and regular expressions turn the answers into a structured story context: genre, setting, characters and conflict.
- Memory. SQLite stores sessions, answers, story segments and context, so each continuation sees what came before.
- Prompt engineering. Templates change with genre, tone and the current story phase, and a sliding window of recent exchanges keeps prompts within the model’s limit.
- Story generator. One interface wraps four LLM providers, with switching at runtime and automatic fallback.
- Story flow manager. A five-phase arc based on Freytag’s pyramid (introduction, rising action, climax, falling action, resolution) moves the story on by length, while trackers watch characters and plot threads for contradictions and loose ends.
- Output formatter. Cleans and paragraphs the text and exports it as TXT, Markdown or styled HTML.
Three media services sit on top of the text pipeline. A scene description extracted from each chapter drives an AI illustration, the browser’s speech synthesis reads the chapter aloud, and each genre has its own ambient music preset.
What did we build?
The front end is plain HTML, CSS and JavaScript served by FastAPI, so it runs without a build step. A reader can:
- answer the questions or write their own answers, with progress shown as they go;
- read each chapter with its illustration, listen to the narration, and continue by picking one of the generated choices;
- explore a story map and a character-relationship graph drawn with D3.js;
- switch LLM provider and model in settings, bookmark a story and export it.
The dissertation also documents unit, integration, API and end-to-end tests, including how the app behaves when the image service fails.
How was it evaluated, and what did the results show?
The system was tested on stories generated across several genres and in a small user study, where participants created stories and rated them on Likert scales. The paper reports response time per LLM provider, narrative quality by genre, user satisfaction and how well the consistency checker caught problems.
- Speed depends on where the model runs. Hosted free-tier models answered fastest; a local Ollama model was slowest but needs no internet or API key.
- Custom answers and the chapter illustrations rated highest. The usefulness of the continuation choices rated lowest, and the paper names it as a limitation of free-tier models.
- The consistency checker was most reliable on character contradictions and weakest on tone shifts, which simple keyword matching struggles to detect.
- A feature-level comparison with AI Dungeon, Dramatron and NovelAI puts the system ahead on deployment flexibility, cost, multimodal output and openness, while AI Dungeon leads on user control and Dramatron on coherence.
The music presets were analysed too. Horror and thriller put their energy in the low bands, while comedy sits in the mid and upper bands, so each genre sounds distinct.
Shown with student, guide and institute details removed.
What did the student receive?
| Deliverable | What it contains |
|---|---|
| Web app and source code | FastAPI backend with the seven pipeline modules, LLM provider adapters, SQLite storage, and the front end with D3 visualisations |
| IEEE-format paper | Two-column paper with the architecture, method, evaluation figures and a comparison with existing tools |
| Single-column research paper | A longer version with fuller method and implementation detail |
| M.Tech dissertation | LaTeX dissertation: literature survey, problem and objectives, planning, design, implementation, testing, results and future scope |
| Result figures | Plots and diagrams for latency, narrative quality, satisfaction, consistency checks and the music analysis |
| Presentation slides | Slide decks for project reviews and the final presentation |
Need only the write-up for your own project? See dissertation, report and PPT support.
How could you adapt this project to your own topic?
The Q&A-to-prompt pipeline carries over to many M.Tech LLM projects in generative AI and NLP. These are starting points to discuss with your guide.
The ideas below are suggestions. Our delivered work is in the case studies.
- Topic ideaSemantic consistency checkingReplace keyword rules with a natural-language-inference or embedding model and compare how well each catches tone shifts.
- Topic ideaLong-story memory with retrievalStore past chapters in a vector index and retrieve the facts that matter, instead of a fixed window of recent turns.
- Topic ideaGraded readers for language learningAdapt vocabulary and sentence length to a learner’s level, in English or an Indian language.
- Topic ideaLLM-as-judge evaluationScore coherence and creativity automatically and measure agreement with human ratings.
For more options at this level, see M.Tech projects; for a smaller build, see final year projects for CSE.
Frequently asked questions
Can I get a similar interactive storytelling project?
Yes. We plan it with you in the free consultation around your own topic, your guide’s requirements and your deadline, so it is your project rather than a copy of this one. The written quote lists each deliverable, such as code, paper, dissertation and viva preparation.
Do I need a paid API key or a GPU?
No. The app can run a local model through Ollama on a laptop, or use the free tiers of Groq or Hugging Face; OpenAI is optional. Local models answer more slowly, which the project measured and reported.
Which datasets does it use?
No training dataset is needed, because pretrained LLMs write the story through prompts. The evaluation data came from stories generated with the system and a user questionnaire. If your guide asks for a dataset, a fine-tuning or benchmark step on a public story dataset can be added.
What will I need to explain in the viva?
How answers become a structured story context, how prompts change with genre and story phase, how the five-phase arc controls pacing, how the consistency checks work and where they fall short, why the LLM layer is provider-agnostic, and how the user study was run. A walkthrough session covers each point until you can explain it in your own words.
Is this suitable for a B.Tech final-year project?
It was delivered as an M.Tech project. A smaller version, with the question flow, one LLM provider and story export, can be sized for a final-year B.Tech project; the scope is agreed in the free consultation.



