Conversational AI Prompts

Piggybacking on some of the stuff we talked about in Multi-Agent Interactions, I’ve been able to use generative AI to ask a series of questions that it generates itself to meet multi-element criteria. Which is just a fancy way of saying “keep talking until you have the info we’re looking for”. I’ll show you how it works with my Mythic AI Game Master and talk about some uses at work as well.

One of the first things I’ve done with my Mythic AI Game Master was add the ability for the user to come up with their own story. I had originally seeded it with the idea of escaping a hotel full of zombies, but after running that scenario dozens of times while testing I got sick of it pretty quick. So, it was time to prompt the user for some scenario cues!

I was inspired by some of the interactions modeled by the Copilot AIs, where a MS Copilot agent can ask users for all the information it needs to perform an action, finally confirming if it should proceed. You can see a neat demo of that functionality here.

I picked out a few aspects that I think every good RPG needs: a setting, a plot or objective, the tone of the story (i.e. serious, funny, dark, etc.), and where the story begins. Using those, I crafted my prompt:

You are a game master, setting up a new roleplaying game for the user.  You will ask them details about the setting, plot, tone, and initial location of the adventure they would like to have.  Ask them one question at a time until there is enough information to continue.

You’ll notice here I don’t get too prescriptive about the type of information I want. I could get real specific on some of these things and perhaps get some better, more specific results, but I don’t really have to, and in this case it’s actually better because it leaves some room for interpretation for both the language model and the end user. You’ll see the results of this below.

This is a good starting prompt, but this will continue indefinitely (language models will never shut up of their own accord, they’ll always generate a response). So I added a check after each user input using the same mid-conversation system prompt approach I used for other aspects of the AI GM system.

Do we have enough information to establish the setting, plot, tone, and starting location of the adventure?  Reply with only 'yes' or 'no'.

All this runs within a do...while loop, continuing the conversation until we’ve reached the point where the language model is convinced we’ve checked all the boxes. Here’s an example conversation.

Let's get started! What's the setting of your adventure? Would you like it to be in a fantasy world, a futuristic sci-fi universe, a modern-day city, or something else?

> sci-fi universe

Great choice! A sci-fi universe opens up a lot of exciting possibilities.

Next, what type of plot are you interested in? Here are a few options to consider:
1. Space exploration
2. Galactic warfare
3. Alien diplomacy
4. Cybernetic revolutions
5. A mysterious artifact discovery

Feel free to choose one of these or suggest your own!

> mysterious artifact

What tone do you want for the adventure? Should it be dark and serious, light-hearted and fun, or something else?

> light-hearted

Great! We're creating a light-hearted sci-fi adventure involving a mysterious artifact. Now, let's determine the initial location of your story.

What kind of setting would you prefer for the starting location? For example, a bustling space station, a vibrant alien marketplace, or a quirky spaceship?

> quirky spaceship

--------
As you lounge in the brightly lit common area of the Spunky Starship, a kaleidoscope of colors dances across the walls, courtesy of the holographic projections swirling around. The smell of freshly baked Glorp Nuggets wafts through the air, making your stomach rumble with excitement. A quirky assortment of furniture-beanbag chairs shaped like asteroids and a lounge couch that bounces when you sit on it-fills the space, inviting all to...

As you can see, the language model does a great job of taking that prompt and running with it, providing suggestions that the user can select from and taking in whatever input the user gives. Once the second system prompt decides that it has enough information to continue, we break out of the do...while loop and generate a plot summary based on the conversation that’s used as the conversation seed for the actual gameplay.

Thinking in a more professional context, it’s not hard to extend this to actions that a language model can guide a user to perform. For example, if someone wanted to add a new product to their website, a language model could guide them through the product name, selecting (or generating!) an image, a description, and an initial price. Combining it with some RAG patterns it could even make intelligent suggestions based on internet searches or existing products in the catalog.

Another neat benefit of this approach is the fact that we’re in the context of a conversation - we can change our minds and the language model won’t even blink.

Let's get started with setting up your adventure!

First, what kind of setting would you like? You can choose from fantasy, sci-fi, horror, modern day, or something entirely different!

> fantasy

Great choice! What kind of fantasy setting are you interested in? For example, do you prefer classic high fantasy with elves and dragons, dark fantasy with grim elements, or something more whimsical like a fairy-tale realm?

> actually can we change the setting to horror?

Sure! A horror setting can create a unique and thrilling atmosphere.

Next, what kind of horror are you interested in? For example, do you prefer psychological horror, supernatural horror, survival horror, or something else?

All of this is happening in the context of a conversation, similar to threaded interactions with ChatGPT, so the language model takes in the entire context every time we ask it to generate a response (at least up until its context limit anyways). Having natural conversations like this allow the end user to modify their responses without a lot of complicated programming on the developer’s side.