Magical, AI-powered Dragon Stories

The Problem

One day, my then-8 year old, dragon-obsessed daughter had been playing with random name generators, and she asked me if I could make one for dragons. So I did. She gave me a list of words to use as the different parts of the dragon’s name, and I used a simple random number generator to pick a good name.

She was delighted, and asked if a random number generator like that could be used to generate a whole story. At first I said no way, you’d need a lot more words to make a whole story, even a short one. Then I realized that, actually, you could do it if you had a large language model.

The Solution

The first version of the dragon generator used my random number generator to create a name, then fed the name into OpenAI’s API to generate a story. As we went, my daughter kept wanting to stop and read the stories, and also wanted to send them to her friends. So I added a lightweight MySQL database layer to save each story, and a little admin page so she could browse and read all of them.

In addition to the MySQL database hosted at Planetscale, the site was based on Next.js and hosted on Vercel, with Tailwind CSS for styling and Google Fonts for, well, the fonts.

Since the dragon generator was first deployed in 2023 there have been a lot of advancements in AI models from both OpenAI and Anthropic. On the less fun side, Planetscale discontinued their free tier in 2024 and I ran out of OpenAI credits, so the site was left in an unusable state…

UNTIL NOW! Version 2.0 of the dragon generator uses Anthropic’s Claude 3.5 Sonnet model to generate stories, and unlike the first version it uses input from the user to customize the prompt and generate a more interesting story. Our Claude API calls also incorporate a system prompt with context about our AI author’s style and influences, as well as parameters to control the length and creativity of the generated story.

Dragon Stories is live at dragongenerator.fun.

Launched
2023
Company
Bits & Letters
Roles
  • Designer
  • Full Stack Developer
  • Product Manager