I recommend you to check out the previous parts if you don’t know what this “neural narratives” thing is about. In short, I wrote in Python a system to have multi-character conversations with large language models (like Llama 3.1) in which the characters are isolated in terms of memories and bios, so no leakage to other participants like in Mantella. Here’s the GitHub repo.
I’ve been on a medical leave for five days, a leave that ends tomorrow. I’ve buried my troubles and worries about my life and job by programming my ass off. Right now, the code does the following:
- Generates worlds, regions, areas, and locations, mostly automatically through the large language model (right now Hermes 405B).
- Generates characters mostly automatically, including their portraits.
- Allows the user to chat with them either through the console or with a very fancy web interface programmed in Flask, initially with the invaluable help of the newly released Orion model from OpenAI (I’ve nearly burned through all the allowed chat interactions, which renew in a week).
- It creates rudimentary memories for the characters (summarized conversations). It also saves the transcriptions of the dialogues.
Here’s how the web interface looks like:

Why all of these generated people’s names start with “Z” is a bit of a mystery.

I don’t know how much further I’m going to progress with this little project. The hardest part, being able to have multi-char convos, is already working quite robustly. It wouldn’t be too complicated to create web pages for navigation with the AI as a dungeon master, and displaying AI-generated photos of AI-generated locations. It would probably be quite fun to move around from location to location, talking to generated people who will keep roleplaying according to the background info they get fed about their world, region, area, and location, as well as their own matters such as description and equipment.
Pingback: Neural narratives in Python #3 – The Domains of the Emperor Owl
Pingback: Neural narratives in Python #5 – The Domains of the Emperor Owl