Neural narratives in Python #24

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.

We abandoned our team of heroes as they frantically tried to collapse the pocket dimension that contained them, before the multiplying tears in reality overwhelmed them.

As I was preparing the setting for this scene, it became obvious that I needed a new abstraction in my hierarchy of places. You see, many prompts to the large language models get fed the combination of places where the scene happens: story universe > world > region > area, and possibly location as well. But in this case, the characters were in a distinct inner chamber inside a sanctuary. The sanctuary would be the location, while the inner chamber was a sub-location, or a room. So clearly, given that the story has demanded it, instead of “half-assing” such places into the hierarchy, I should modify all the code that touches the hierarchy to have in mind a new type of place: a Room. Perhaps they won’t be used that often, but if a serious playthrough has required it, then I need to program it in. This may take a while; the last time I touched the hierarchy of places, that is almost the spine of the whole app, it took me days to return the app to normal. We’ll see how it goes.