Neural narratives in Python #20

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. Here’s the GitHub repo, that now even features a proper readme.

The last part ended with our team of heroes begrudgingly agreeing to partake in the trials of a shadowy, shady alien from the dimension they had ventured into.

For this part, I decided to implement a Grow Event button in the chat interface. Basically, the user writes the guideline for what they would like to happen at that point of the dialogue. Then, a dedicated prompt sent to a large language model will cause the AI to expand the suggested event into a literary form. There are two or three examples of that in the audio you may have listened to. Great for when you don’t want to bother behaving as both the narrator and the player character.

I’ve already played through most of the scene that will be featured in the next part. Man, it was emotionally taxing.