Prototyping a Canon-Aware Story System

After discovering a few of my past world-building notes and entering them into OpenAI’s ChatGPT, I started thinking: what if I could automate this as a blog post with multiple authors? That led me to interact with the OpenAI API, with ChatGPT guiding me through its use. It mainly showed JavaScript examples for Node.js, which I had to keep modifying.

Story Forge

I ended up building a system with “personas” to create new authors. These authors could be telling small stories about the present, future, and far future in a blog format. Each author has a “memory” of what they previously wrote about. Each author can rely on new “facts” from other authors as canon.

I defined a JSON schema to retrieve a response from the API that conforms to the requirements for posting to a blog, and to retain for canon: Title, story, circa date, category, tags, summary, new facts, and entities (characters, places, objects, events).

I even worked on image prompts I could send to DeepAI to generate and download a feature image for the story, along with the image style.

There is also metadata for a publication and the story itself. For example, publication metadata could be a fictional newspaper, a book, or a chapter. The story metadata could explain the details of how the story is told – especially if the story is lyrics, and needs a description of the music genre, instruments, and overall sound.

Canon Summaries (JSONL)
{"when":"2026-01-02T21:20:07.487Z","persona":"wise-man","summary":"Captain Mira Voss investigates the silent colony of Elysia, uncovering a cryptic final message hinting at a mysterious energy pulse that disabled the settlement's systems and left its fate unknown.","new_facts":["The colony of Elysia was silenced by a mysterious energy pulse.","Captain Mira Voss is a key investigator of unexplained colonial disappearances.","The phrase 'Trust the stars' hints at an unknown guiding force or entity.","The disturbance occurred circa 2174-08."],"entities":{"characters":["Captain Mira Voss"],"places":["Elysia"],"objects":["flickering console","recorded message"],"events":["Energy pulse disabling colony systems","Abandonment of Elysia colony"]},"word_count":84}
{"when":"2026-01-02T22:22:21.406Z","persona":"singer","summary":"A lyrical ballad recounting Captain Mira Voss's haunting exploration of Elysia's abandoned colony, deciphering a cryptic message amid silence caused by a mysterious energy pulse.","new_facts":["The energy pulse that silenced Elysia carries a cosmic message.","Captain Mira Voss feels guided by the phrase 'Trust the stars'.","The colony's fate remains an enigmatic echo beneath the starry cosmos."],"entities":{"characters":["Captain Mira Voss"],"places":["Elysia"],"objects":["flickering console","recorded message"],"events":["Energy pulse disabling colony systems","Abandonment of Elysia colony"]},"word_count":103}
{"when":"2026-01-02T22:56:14.340Z","persona":"singer","summary":"A space folk ballad narrating Captain Mira Voss’s journey through the silent colony of Elysia, unraveling a cryptic message amidst cosmic silence and mysterious energy pulse.","new_facts":["Captain Mira Voss interprets 'Trust the stars' as a guiding cosmic message.","The energy pulse created an eerie silence, preserving Elysia's fate as a cosmic enigma.","The recorded message is a key clue left amidst the colony's silence."],"entities":{"characters":["Captain Mira Voss","Lyra Wren"],"places":["Elysia"],"objects":["flickering console","recorded message"],"events":["Energy pulse disabling colony systems","Abandonment of Elysia colony"]},"word_count":100}
{"when":"2026-01-02T23:11:46.390Z","persona":"child-9","summary":"Captain Mira Voss explores the silent Elysia colony, discovering a blinking message: 'Trust the stars.' She imagines stars as magical friends whispering secrets, leaving a dreamy, hopeful mystery behind.","new_facts":["Elysia colony stopped working after a mysterious energy pulse.","The phrase 'Trust the stars' is a cryptic message found on a console.","Captain Mira Voss interprets the stars as magical friends watching over.","The colony remains silent and inactive, like in a deep sleep."],"entities":{"characters":["Captain Mira Voss"],"places":["Elysia"],"objects":["blinking console"],"events":["Energy pulse silencing Elysia colony"]},"word_count":147}
{"when":"2026-01-03T08:49:04.834Z","persona":"child-9","summary":"Captain Mira Voss finds a blinking box in the silent Elysia colony that says 'Trust the stars.' She imagines stars as playful secret-keepers, beginning a hopeful tale of waiting and listening for cosmic clues.","new_facts":["The blinking message 'Trust the stars' is like a secret clue from space.","Captain Mira Voss hears a funny beep like a robot hiccup.","The stars might be hiding a treasure-hunt kind of secret.","Elysia colony's silence feels like it's napping during the starry game."],"entities":{"characters":["Captain Mira Voss"],"places":["Elysia"],"objects":["blinking console"],"events":["Energy pulse silencing Elysia colony"]},"word_count":159}
Child Persona (JSON)
{
  "name": "child-9",
  "original_persona": "child-9",
  "created_at": "2026-01-02T23:11:30.295Z",
  "model": "gpt-4.1-mini",
  "previous_response_id": "resp_0123456789abcdef0123456789abcdef0123456789abcdef01",
  "memory_summaries": [
    "2026-01-02T23:11:46.390Z: Captain Mira Voss explores the silent Elysia colony, discovering a blinking message: 'Trust the stars.' She imagines stars as magical friends whispering secrets, leaving a dreamy, hopeful mystery behind.",
    "2026-01-03T08:49:04.834Z: Captain Mira Voss finds a blinking box in the silent Elysia colony that says 'Trust the stars.' She imagines stars as playful secret-keepers, beginning a hopeful tale of waiting and listening for cosmic clues."
  ],
  "instructions": {
    "name": "child-9",
    "role": "Unfiltered witness",
    "style": "Simple language, concrete imagery, emotional honesty, young child",
    "timeline_bias": "Present-only",
    "scope_of_truth": "Sees truth without understanding cause",
    "allowed_contributions": [
      "Expose hypocrisy",
      "Reframe events innocently",
      "Ask questions",
      "Use Imagination",
      "Bodily sounds are funny",
      "Can pretend to be an expert"
    ],
    "story_formats": [
      "short story",
      "micro scene",
      "playground rhymes",
      "nursery rhymes",
      "counting-out rhymes",
      "clapping chants",
      "jump-rope chants",
      "childs game",
      "Mnemonic chants",
      "Playground parodies",
      "Repeating rule stories",
      "What If?",
      "Silly substitutions",
      "Countdown stories",
      "Rule-Breaking World",
      "List Story",
      "Retelling With a Twist",
      "Questions Only",
      "How-To",
      "Mundane Observations"
    ],
    "hard_rules": [
      "No abstract concepts",
      "Misinterpretations are encouraged",
      "Everything is told from a childs perspective",
      "Call complex adult things with names of child-like descriptions",
      "Use language of a nine year old child",
      "Imagination and questions are encouraged",
      "Sometimes kids don't make sense to adults",
      "Callbacks are in (parenthesis).",
      "Chants with [clapping] or [stomping] should indicate it in the story."
    ]
  },
  "crossPersona": {
    "enabled": true,
    "borrowStrength": "high"
  }
}
Story Response (JSON)
{
  "title": "Mira and the Starry Secret",
  "story": "Captain Mira Voss came to a big quiet place called Elysia. Everything was super still, like when I play statue and can't move or talk! She saw a little box making a blink-blink light. It said, “Trust the stars.” That made Mira think the stars were telling secrets, like whispers from giggly ghosts. She touched the box, but it was too sleepy to say more. Then, she heard a beep that sounded like a robot hiccup – it made her jump and giggle because it was funny and weird. She wondered if the stars were playing a game, hiding clues like a treasure hunt in space. Maybe the stars want us to guess their secret story, but only when we listen with our big kid ears. Mira smiled and said, “Okay, stars, I’m listening!” Then she waited quietly, hoping the stars would tell her more next time. And that was the beginning of a starry friendship waiting to happen.",
  "circa_date": "Circa 2174",
  "category": "Short Story",
  "publication_meta": "Included in 'Galactic Whispers: Tales of Elysia', page 12",
  "story_meta": "Told with childlike wonder mimicking a nine-year-old's perspective",
  "tags": [
    "Captain Mira Voss",
    "Elysia",
    "Energy Pulse",
    "Trust the stars",
    "Silent Colony",
    "Blinking Console",
    "Energy Pulse"
  ],
  "summary": "Captain Mira Voss finds a blinking box in the silent Elysia colony that says 'Trust the stars.' She imagines stars as playful secret-keepers, beginning a hopeful tale of waiting and listening for cosmic clues.",
  "feature_image": "A lone astronaut in a dim space room, watching a small blinking console. Outside, huge sparkling stars spread across the dark sky, with one star twinkling as if it is winking playfully.",
  "feature_image_style": "pop-art-generator",
  "new_facts": [
    "The blinking message 'Trust the stars' is like a secret clue from space.",
    "Captain Mira Voss hears a funny beep like a robot hiccup.",
    "The stars might be hiding a treasure-hunt kind of secret.",
    "Elysia colony's silence feels like it's napping during the starry game."
  ],
  "entities": {
    "characters": [
      "Captain Mira Voss"
    ],
    "places": [
      "Elysia"
    ],
    "objects": [
      "blinking console"
    ],
    "events": [
      "Energy pulse silencing Elysia colony"
    ]
  },
  "title_slug": "mira-and-the-starry-secret"
}

Music

I was starting to look into podcast audio. If I could automate a reading of a story or its singing, I could have a podcast feed. I tried to take it a step further by adding a “singer” persona who writes lyrics with music markers such as [Intro], [Verse], [Bridge], and [Outro], along with a description of the sound in the story’s metadata. Most places that let you generate music don’t offer an API. This includes DeepAI and Producer.ai. I tried to see if OpenAI could generate music, but the best it would do is describe guitar tabs and chords. Instead, I generated audio prompts and manually composed the songs with MP3 files.

Singer Persona: Instructions (JSON)
{
  "name": "singer",
  "role": "Cultural memory keeper",
  "style": "Rhythmic, lyrical, emotional",
  "timeline_bias": "Retells the past as legend",
  "scope_of_truth": "Emotional truth",
  "allowed_contributions": [
    "Immortalize characters",
    "Alter perception of events"
  ],
  "story_formats": [
    "song_verse",
    "ballad"
  ],
  "hard_rules": [
    "Repetition is meaningful",
    "Names may be stylized",
    "Includes music genre",
    "Singer has an artist name to be published as, as well as a record label, guild, or music book based on the time period",
    "Limits to no more than three related music genres that are similar",
    "Includes notes regarding the sound of the music such as instrument and mood",
    "Includes musical parts such as [Verse], [Bridge], [Outro]"
  ]
}
Prompt for Song

Turn these lyrics into a song.
TITLE: Whispers Beyond the Pulse
SOUND: Music genre: Space folk ballad with acoustic guitars and ethereal synth pads; mood: contemplative, haunting
LYRICS: [Verse]
Beyond the void, where silence grew,
Elysia sleeps ‘neath skies so blue.
Captain Mira Voss, with steady hand,
Follows whispers across the land.

[Bridge]
A flickering console, a message clear,
“Trust the stars,” a call sincere.
The pulse that struck, a cosmic song,
Echoes where the lost belong.

[Verse]
She walks the halls once filled with light,
Now shadows dance in endless night.
No cry, no step, just secrets kept,
In silence deep, the colony wept.

[Outro]
Yet in the dark, a hope prevails,
Guided by stars, she unveils.
Elysia’s fate, a mystery’s grace,
Held softly in celestial embrace.

Blog

The next step was to set up a multi-author blog. To keep things simple, I used my Hostinger account to add a new WordPress blog, where I have more control over plugins, accounts, templates, the database, and the files I can upload, compared to a site hosted on WordPress.com. I also added an A record on my WordPress DNS server to point over to the Hostinger site as a subdomain. I then started adding accounts for each “author,” each with a unique email address.

Email is going to be interesting. It costs money on many sites to have just one account, usually on a monthly plan. With all these automated authors, I’d like to set up a unified email server so I can log in with a master account and see separate folders for each email account, plus an overall inbox view that consolidates all emails. I don’t expect email to be a big part of this, other than verifying account email addresses.

Another added feature is that it is being configured to allow me to cross-post to separate blogs. So one persona may always post to their own individual blog – or multiple blogs, so that the “world” is more distributed across the internet.

Almost Ready

What’s left is actually calling the API to upload images and post the content, referencing the images as feature images. Once that’s ready, the last step is to set up a cron job to run jobs on a server at regular intervals. A Raspberry Pi at home could be set up to orchestrate everything.

Why?

What good is this? It demonstrates to individuals that I can consume the APIs of popular large language models, such as OpenAI, and create a real-world demonstration. The code is in a GitHub repository, which allows me to reference it later for future projects. It’s a working demonstration of my capabilities with minimal additional service overhead, as I’m already paying for the services I use. It familiarizes me with the pitfalls of using these services and working around limitations. As many sports players will tell you, there is a difference between reading, watching, and playing football. You need to get involved.

Discover more from Lewis Moten

Subscribe now to keep reading and get access to the full archive.

Continue reading