Albums that marked me, Pt. 1

As a solitary dude, all my life I have relied on music to connect with the world at large, to feel that my feelings weren’t that unique or detached from the rest of humanity. Over the years, I’ve returned to certain albums that have spoken to me in ways that can’t be fully put into words. I love discovering new albums, and perhaps that’s also the case for whoever is reading these words, so I’ll spend some of my limited time on Earth sharing some specifics about the albums that have marked me, and that in many ways changed me.

Today’s album is Palabras más, palabras menos, by Los Rodríguez. A bit weird for me to start with this album; even though Spanish is my mother tongue, this one is the only album in Spanish that I have listened repeatedly over the years. I like the entire thing, but I find myself repeating four songs in particular.

“Todavía una canción de amor”

The song speaks of a love already dead and gone, but that has never let the narrator go. I discovered this album back in 1995, when I was ten years old, and I only came to fully understand the song years later, when I found myself sleepwalking to places that I had shared with a past lover, hoping but also dreading to see her appearing there as if summoned.

Death is a spurned lover
Who plays dirty and doesn’t know how to lose.

I’m trying to tell you I’m desperate waiting for you.
I don’t go out to look for you because I know I risk finding you.
I keep biting my nails of resentment day and night.
I still owe you a love song.

Singing is shooting against forgetting,
Living without you is sleeping at the station.

“Mucho mejor”

A song that praises losing oneself in sex and general debauchery, for when you don’t give shit about anything else but making love in the balcony with your likely quite underage lover; the ideal state of mind.

Sweet like wine, salty like the sea,
Princess and vagabond, deep throat,
Save me from this loneliness.

Honeymoon, paper moon,
Full moon, cinnamon skin, give me nights of pleasure.
Sometimes I’m bad, sometimes I’m good.
I’ll give you my heart for you to play with it
.

They could accuse me, she’s underage.
We’ll go to a hotel, we’ll go to dinner,
But we’ll never go together to the altar.

“La puerta de al lado”

A haunting song about a man who has given up on life, has detached himself from anyone who knows him, and is staying at a motel that he expects will be the last place that sees him alive. Beautifully written, depicting very well that suicidal state, and ends the song powerfully by mirroring a previous symbol in an understated manner: he had mentioned someone having hanged himself next door, the door itself marked with a “Please do not disturb sign.” Now, the same sign hangs on the narrator’s door.

Let time pass
With a wandering gaze, no direction to follow,
A book always open,
Pages torn one by one, filled with resentment.

In some place,
On a secondary provincial road,
The light in the window
Shining with the noise of passing trucks.

And at the front desk, there’s a fake name.
No one in the world knows where I am,
Not knowing, not knowing where I am,
And now that I’m alone with my thoughts,
I’ll wait for the wind to come and find me.

There’s someone out there,
Talking in the hallway as if mocking me.
Laughter is heard,
And the sound of spoons, and a girl says “yes.”

And at the door, there’s a sign hanging,
That says: “Please do not disturb,”
Never again, never again, never again.

“Diez años después”

My favorite of their songs, it speaks to unresolved grief, regret, and other complicated feelings for a past love that he wishes yet dreads that it could restart. This song played in my mind many times as I wrote my latest novella, Motocross Legend, Love of My Life. I’ve been in love for more than twenty years with the lyrics of this song.

If ten years later I find you again in some place,
Remember I’m different now, but almost the same.
If chance brings us together again ten years later,
Something will flare up; I won’t be polite.

Ten years later, who can go back?
We’re here on earth for only a few days,
And heaven doesn’t offer any guarantees:
Ten years later, better to start anew.

If your trust has eroded somewhere,
Don’t forget I’m a casual witness to your solitude.
If ten years later we’re not the same, what can you do,
Another ten years and then, start together again.

That was a lovely spring,
But it was only the first one.
Ten years later, time starts to take its toll.
I still have bullets left in my chamber,
But I always save the first one for you.
Ten years later, better to laugh than to cry.

I gave you a letter I never wrote, unread by anyone.
Today, ten years later, everything remains the same:

It never reached you.

Within my heart, nowadays, there’s no room left.
If I lost my mind, it wasn’t because of love, but loneliness.

Life is a grand waiting room,
The other is a wooden box.
Ten years later, better to sleep than to dream.
You can’t live any other way,
Because otherwise, people don’t notice.
Ten years later, who can go back?

Ten years later, better to speak than to stay silent.

We’re Fucked, Pt. 128 (Fiction)


Here I am, at the threshold of the apocalypse, in this chamber of interrupted dreams where my boss, the vilest of swines, stands between me and the ripper of reality. I’ve been ordered to take a seat, so I shuffle towards the oasis among cables and machinery. A workbench supports a soldering iron, a hot glue gun, and a clutter of transistors, capacitors, and electronic components whose purpose eludes me. Screws and circuit boards surround a dismantled desktop PC. Affixed between cabinets and shelves littered with tools, a long-forgotten whiteboard bears the faded scribbles of equations and diagrams. Beside it, unknown hands have tacked to a corkboard printouts along with photos of men in nineties’ garb, posing in front of the office building, as well as with the spiral device. A yellowed note yells in all-caps, “DON’T GO IN TWICE, YOU WILL DISAPPEAR!” Anyway, that’s all I care to notice about my surroundings. I’m not one for poetic descriptions, perhaps as a result of having my mind stuffed with thoughts of creampies.

I leave my notebook and ballpoint atop a stack of manuals. Then, I slide aside with my foot a metallic trash bin that stands sentry over the dust bunnies, and I plunk my butt down onto a swivel chair. Its plastic, cheap and flimsy, creaks under my weight.

A headache pounds at the inside of my skull as if a tiny prisoner were hammering the bone with a miniature ice pick to escape from confinement, and I have a hard time calming down while sitting in this dungeon, a lair that reeks like raw sewage mixed with rotting flesh and burned dust, a stink that scratches my lungs with every breath. I wish I could fire a laser from my forehead to vaporize this contraption, which emanates a miasma that makes the molecules of oxygen vibrate with hostility. A laser would have a higher energy density than a bullet, and thus it would penetrate that silvery-white shell, incinerating the spirally innards. Instead of a laser, though, my forehead only sweats, and my armpits feel like they’re about to soak.

I need a more realistic plan to rid the world of this machine. Maybe I could set it on fire, or better yet, blow it up. But how? I’m a coder, not a demolitionist. I don’t know where to get my hands on explosives, and even if I did, the police wouldn’t take kindly to a woman carrying around dynamite and detonators. Maybe I could ask my interdimensional harassers for a bomb, or a nuke.

I imagine a fiery cataclysm tearing through my workplace, engulfing every shred of existence, from my boss to the computer that taunts me daily. When the smoke cleared and only cinders remained, I would strut amidst the ashes, the mistress of a barren wasteland, with mommy’s arm snuggly hooked to my elbow. After I’d finished cackling, we would raise our fists triumphantly, and bask in our victory together. We would then move to a farm and raise alpacas.

Ramsés, the man who stands in the way of my alpaca-farming utopia, the man whose mustache is a crime, puffs on the last of his cigarette, then tosses the butt and grinds it with a twist of his heel.

I shake my head.

“Is it an inherent trait of smokers to pollute whatever place they’re in? You’re sucking on concentrated carcinogens and disseminating them, so I guess it’s too much to ask that you have some respect for the environment.”

My boss frowns, revealing weary crow’s feet.

“I’m not a fan of being lectured, especially by someone with your disgusting habits.”

“Wh-what’s with that unfounded accusation?”

Ramsés runs his nicotine-stained fingers through his graying hair, ruffling it. The fluorescent lamps highlight the greasiness of his face, the sallow bags under his eyes, and the sagging of his cheeks, while shadows pool in the wrinkles and folds of his flesh. He’d benefit from a stint at a beauty salon, or an encounter between his face and a sledgehammer.

“You weren’t just hallucinating about the machine, were you…?” my boss asks. “You knew about it.”

“You could say so, because it would be true. Indeed, I knew that this reality-raping contraption was lurking down here, waiting to devour the universe, although I didn’t know where ‘here’ was in relation to this rotten planet of ours.”

“Who blabbered about it? Was it… Jacqueline?”

His piggish lips should never have dared to form mommy’s sacred name. I’m tempted to grab the hot glue gun and squirt molten goo down his throat, but I must prioritize the fate of the world over satisfying my bloodthirst.

“Blabbered? More like blubbered. And not just any blubber, but a blobby blubber of black goo, studded with slimy eyeballs.”

“At least try to make sense, Leire.”

“Alberto, that crotchety prick.”

Ramsés takes a step back. His expression has dropped as if I had announced his bank account’s PIN to a roomful of identity thieves.

“Alberto…?”

“You know, he used to work here, or up at the office anyway, before you hired our intern. I’m not sure if he ever told you about his wife, but she cheated on him and then divorced him, so he became a bitter bastard. I wouldn’t blame you if you forgot about the guy, though, as I’d rather not remember him either.”

“He told you… before quitting?”

I squint as I tilt my head at him.

“Stop bullshitting, sir. Alberto didn’t quit; he vanished without a trace. That greedy bastard walked into the machine a second time, and got yeeted into another dimension. That’s why you looked for a new programmer to replace him. You couldn’t tell anyone the truth, could you? That the previous coder had been swallowed by a spiraling deathtrap. You’d have to admit that you own a machine that fucks up reality, and there probably are laws against that.”

Ramsés’ voice sounds hoarse and dry.

“You’re telling me that Alberto contacted you after he disappeared?”

“That’s right. You wouldn’t have recognized him, though; he got out of shape. In any case, let’s focus on what’s important: this machine is bound to tear apart the universe unless I stop it. That sentient horse pal of mine tried to warn me about it from the beginning, but I refused to listen, because I’m an asshole. I would have been done with all this nonsense long ago if I cared enough about our world. Whatever horrors have been unleashed in the meantime are sadly on me.”

Ramsés massages his temples, his eyes squeezed shut. He’s not taking the revelation of the supernatural well. A shame I’m too busy saving the world to enjoy his distress.

“Leire, you’re mentally ill. You’re delusional.”

“Am I the one who keeps the apocalypse in his basement? What are you planning to do with this thing, anyway?”

“Alright, I’ll tell you, but don’t you dare interrupt me. I’m not in the mood for more of your antics.”

“Sure, I’ll just sit here and pretend that I haven’t been tormented by interdimensional abominations who harassed me until I agreed to save the fucking universe, and that the fate of all existence doesn’t hang on me destroying this spiraling death machine. What is it exactly, other than a reality-eroding piece of junk that I wish to obliterate as soon as possible?”


Author’s note: today’s song is Modest Mouse’s “Cowboy Dan.”

I keep a playlist with all the songs mentioned throughout this novel. A total of 212 videos so far. Check them out.

Getting through this part took me fucking ages. I feel like I haven’t recovered from a medical episode that sent me to the ER; I have trouble reading, and processing words in general. I’m waiting for a call that will schedule an MRI to confirm if I’ve ended up with brain damage. Such is my life, it seems. Anyway, thanks for reading and all that.

Neural narratives in Python #31

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.

In the last episode of this thing, our suave protagonist, Japanese teenager Takumi Arai, thanked the irritated half-humanoid, half-scorpion guardian for her help, then set off along with gender-ambiguous Sandstrider Kael Marrek back to the desert sun, to figure out how to make money in this new world.

That’s all for today, I’m afraid, because I had to do a major restructuring of my app. As I was adding a fact to the playthrough (facts being any more-or-less objective notions that the characters know about their reality), I started thinking about scalability. All the facts introduced relate to this deserty part of the fantasy world, and they would be generally useless if the protagonist were to travel somewhere else. However, all the prompts that involve facts grab them from the corresponding text file, so the more facts the user adds, the more it fills the limited context window that the large language models have to work with, potentially with unrelated stuff. How to solve this?

Well, I knew what used to be the best idea for how to solve the issue: vector databases. They are a fancy way of decomposing text into multidimensional vectors of floating numbers. When you query that database with any text, the query gets decomposed into vectors. Then, the distance of those vectors to the vectors stored in the database gets calculated, and the database returns the closest vectors. Those closest vectors happen to be the semantically closest data stored in the database. That’s the hard way of saying that when you ask a vector database a question, it returns the contents that are more closely related to the question. It’s almost like magic. It doesn’t search for specific keywords exactly; if you query it with the word “desert,” it may return stuff that involves the word “oasis,” “camel,” “sun,” etc. If I implemented this into my app, the descriptions of the places, some character info, etc. would be sent as the query to the database, and the corresponding facts or character memories would get returned, up to an arbitrary limit of results. It fixes all the problems.

The issue is implementing such a thing. The last time I attempted it, a couple of years ago, it was a mess, and never got it to work as I had expected. After interviewing OpenAI’s Orion preview model for a bit, it turns out that last time I may have picked the worst Python library to work with vector databases, or else many advances have been made since then. This time I chose the chromadb library, specialized in working with large language models. Implementing the database turned out to be very intuitive. Here’s the entire code of that implementation:

from enum import Enum
from typing import List, Optional, Dict, Any

import chromadb
from chromadb.api.types import IncludeEnum  # noqa
from chromadb.config import Settings
from chromadb.utils import embedding_functions

from src.base.validators import validate_non_empty_string
from src.databases.abstracts.database import Database
from src.filesystem.path_manager import PathManager


class ChromaDbDatabase(Database):

    class DataType(Enum):
        CHARACTER_IDENTIFIER = "character_identifier"
        FACT = "fact"
        MEMORY = "memory"

    def __init__(
        self, playthrough_name: str, path_manager: Optional[PathManager] = None
    ):
        validate_non_empty_string(playthrough_name, "playthrough_name")

        self._path_manager = path_manager or PathManager()

        # Initialize Chroma client with per-playthrough persistent storage.
        self._chroma_client = chromadb.PersistentClient(
            path=self._path_manager.get_database_path(playthrough_name).as_posix(),
            settings=Settings(anonymized_telemetry=False, allow_reset=True),
        )

        # Use a single collection for all data types within the playthrough
        self._collection = self._chroma_client.get_or_create_collection(
            name="playthrough_data"
        )

        self._embedding_function = embedding_functions.DefaultEmbeddingFunction()

    def _determine_where_clause(
        self, data_type: str, character_identifier: Optional[str] = None
    ) -> Dict[str, Any]:
        where_clause = {"type": data_type}
        if character_identifier:
            # Must use the "$and" operator.
            where_clause = {
                "$and": [
                    where_clause,
                    {self.DataType.CHARACTER_IDENTIFIER.value: character_identifier},
                ]
            }

        return where_clause

    def _insert_data(
        self, text: str, data_type: str, character_identifier: Optional[str] = None
    ):
        data_id = str(self._collection.count())
        metadata = {"type": data_type}
        if character_identifier:
            metadata[self.DataType.CHARACTER_IDENTIFIER.value] = character_identifier

        # Upsert updates existing items, or adds them if they don't exist.
        # If an id is not present in the collection, the corresponding items will
        # be created as per add. Items with existing ids will be updated as per update.
        self._collection.upsert(
            ids=[data_id],
            documents=[text],
            embeddings=self._embedding_function([text]),
            metadatas=[metadata],
        )

    def _retrieve_data(
        self,
        query_text: str,
        data_type: str,
        character_identifier: Optional[str] = None,
        top_k: int = 5,
    ) -> List[str]:
        results = self._collection.query(
            query_embeddings=self._embedding_function([query_text]),
            n_results=top_k,
            where=self._determine_where_clause(data_type, character_identifier),
            include=[IncludeEnum.documents],
        )

        return results["documents"][0] if results["documents"] else []

    def insert_fact(self, fact: str) -> None:
        self._insert_data(fact, data_type=self.DataType.FACT.value)

    def insert_memory(self, character_identifier: str, memory: str) -> None:
        self._insert_data(
            memory,
            data_type=self.DataType.MEMORY.value,
            character_identifier=character_identifier,
        )

    def retrieve_facts(self, query_text: str, top_k: int = 5) -> List[str]:
        return self._retrieve_data(
            query_text, data_type=self.DataType.FACT.value, top_k=top_k
        )

    def retrieve_memories(
        self, character_identifier: str, query_text: str, top_k: int = 5
    ) -> List[str]:
        return self._retrieve_data(
            query_text,
            data_type=self.DataType.MEMORY.value,
            character_identifier=character_identifier,
            top_k=top_k,
        )

Obviously, I had to hunt down every previous reference to facts and memories so that they no longer rely on plain text files, but instead insert every relevant data into or query it from the database. I got everything working seamlessly. As of today, I have 527 tests in total, but the app has grown to such a size that it doesn’t surprise me when it starts creaking from any nook, which I usually hurry to pin in place with a test. I rely on OpenAI’s Orion models exclusively to write those tests, as they are annoying to set up, and eat up development time, even though the tests themselves are invaluable to ensure everything works as needed.

I’m an obsessive dude in general, and so is the case with my code. If I need to produce some data, I write a Provider or an Algorithm class, which are then created through Factories. Non-returning operations are encapsulated in Commands, which can be linked together like lego pieces. It’s all very aesthetically pleasing, if you’re a programmer at least. The weakest link are the Flask views, which are probably hard to test as they’re the endpoints, but I haven’t tried to do so, because I tend to move complicated, non-instantiating code to isolated modules. The instantiation gets done as close to the endpoint as possible, or else with Composer classes. All the instantiations get passed to further classes through Dependency Injection. Code quality, baby.

I think I’ve mentioned it before, but I got into creating this app because I wanted to involve artificial intelligence in my smut sessions. As it often happens, technological development is driven by men’s need to have increasingly better orgasms. Can’t wait for the sexbots.

Neural narratives in Python #30

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.

In the last part, our protagonist, having been sent by a ditzy goddess into a scorching desert world, or at least a deserty part of a fantasy world, deals with an imposing half-person, half-scorpion guardian, who offers him sanctuary in their safe house as long as the protagonist passes an initiation rite.

That was one of the funnest interactions I’ve had through this app. I’ve got a soft spot for that incompetent goddess. And the scene ends with the driving lesson of isekai: sometimes we must lose one world entirely to find our true place in another.

Although a week ago I programmed the ability for the user to add participants to an ongoing dialogue, I hadn’t programmed the feature to remove participants from one. It was necessary to do so given the circumstances; otherwise, the AI might have chosen to speak as Seraphina even though she was supposed to be gone. In addition, when a dialogue ends, a summary is generated and added as a memory to the participants. In the case of the participants leaving mid-conversation, it wouldn’t make sense to know what happened after they left, so now, for each character leaving mid-convo, the summary of the dialogue up to that point is added to their memories.

My app has a section called Story Hub that allows the user to generate story concepts, to help them figure out where the story may be going. They could already generate plot blueprints, scenarios, goals, dilemmas, and plot twists. Thanks to the massive refactoring I did of the whole width of story concepts in the app, adding new ones was easy.

I’ve also involved the facts added by the player in many prompts to the AI, including dialogue. Facts are supposed to represent well-known information about the world, such as legends, properties of animals or sentient races, etc. For example, one of the generated pieces of lore named the twin moons of this world, so I added that information to the facts. My biggest worry is the context window of some large language models: my favorite right now, Magnum 72B, has a tiny context of 16,000 tokens, and the more you add to memories and facts, the more they eat of the context, until you’re forced to switch to a subpar model.

That’s all for now. Stay whimsical.

Review: Castration: Rebirth, by Miyatsuki Arata

Four stars.

This manga starts with its protagonist being sentenced to death after having killed fifteen people. His childhood friend and love of his life was raped and murdered, so the protagonist took it upon himself to castrate and murder fifteen sexual offenders. I’m not sure if the rapist and murderer of his friend was among them.

Anyway, the protagonist gets hanged to death.

Turns out, this is an isekai, just an unusual one. The protagonist wakes up on a pile of corpses. In the sky, the sun is doing weird shit, looking like an out-of-control nuclear reactor. The first humans he sees are school girls, who proceed to freak out upon seen him, referring to him as a “beast.” One of them shoots arrows at him. After they realize that the protagonist is more or less sane, they agree to let him live by now. Shortly after, the girl who had shot arrows at our protagonist gets raped and devoured by a monstrous man.

We learn that in this alternate reality to which the protagonist got isekai-d, three months ago, a solar flare fucked up men’s DNA or something, turning them into mindless beasts solely preoccupied in what men want to do all the time but only flimsy self-restraint prevents them from doing so: rape, devour and murder women, sometimes simultaneously. All females that the protagonist comes across fear that the guy will do the same to them.

As if the reality that a flare had turned all men into rape-and-murder machines wasn’t enough, plenty of females in this story have complaints to offer about how they were exploited by men even before the world went to shit.

Other women see in the young protagonist a source of healthy semen, and therefore the chance for humanity to survive the apocalypse.

What follows is a mix of The Last of Us (the first game; as far as I’m concerned, the second game and TV series never existed), Attack on Titan, and most zombie stories. The protagonist and his companions come across different ways of trying to survive the post-apocalypse: family affairs; rigid, hierarchical structures; wild anarchy. Along the way, dozens or hundreds of people get raped, murdered, and eaten, sometimes not even by the mutated humans. This story is ballsy as hell when it comes to making even some main characters’ day quite terrible.

The manga touches upon interesting topics. Will the surviving societies be “equal” because only women are involved, or will they turn out to be new systems of exploitation? Does any sense of morality matter when at any point you can get raped and eaten by mutated men with enormous dongs? The protagonist is traumatized by the notion of sex, because his friend was raped and murdered, but isn’t his duty to provide semen to save the human race? In this case, would it be ethical to force him to do so?

I was surprised by how well the author handled the characters. They had distinct personalities and clear motivations, which often conflicted with one another’s. Some start out malicious only to end up sympathetic, or viceversa. Quite a few characters are memorable, including the protagonist, the childhood friend, a semen-obsessed teacher, a sociopathic teen, the anarchic biker girl who wanted to capture ten-year-old mutated boys for sex, etc.

In the end, this lovely tale dishes out what the title promised: rebirth (well, technically reincarnation) and castration. Lots of men lose their penises in creative ways. If any of this sounds like fun, you’ll probably enjoy this ride. I know I did.

Neural narratives in Python #29

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.

In the previous part, a Sandstrider named Kael Marrek gave our hapless, reincarnated protagonist a tour of the local market, providing basic advice so the protagonist doesn’t die the first night. Kael guided him to a sanctuary where many of the local displaced take shelter.

The next scene, taking place in an initiation chamber, was probably my favorite of all the interactions I’ve had in this app of mine. I’ll post it tomorrow.

Neural narratives in Python #28

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.

In the previous and first part of this new tale, our protagonist, Japanese teenager Takumi Arai, fucking died, but a ditzy goddess presented him to the wonders of reincarnation. Now, Takumi finds himself in an unknown city, retaining his previous form and memories but not knowing anything about this world where he has ended up.

Takumi was lucky enough to get across a reasonable outcast like Kael Marrek, of indeterminate gender. He or she gives Takumi a tour of the teeming market.

Neural narratives in Python #27

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 previous part saw the ending of the cosmic horror tale I was telling. This one will see the beginning of the silly isekai thing I’ll do next in my AI-fueled app.

Here’s our suave protagonist, Japanese teenager Takumi Arai:

He lives in quite the peculiar story universe, but I’ll let you discover it. The story starts with him being visited by a certain interdimensional legend.

That’s the end of Takumi Arai. But in this story universe, a visit from Truck-kun isn’t the end. And yes, I went through the trouble of creating a particular world, region, and area for the original world, as well as Truck-kun himself, even though I may never revisit them.

Well, that was one of the most chaotic interactions I’ve had on this app.

Neural narratives in Python #26

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.

In the previous part, the protagonist realized that the alien Zha’thik, who had subjected young Elizabeth Harrow to a ritual intended to turn her into some sort of cosmic entity, had fallen in love with the earthly teenager. The team convinced Zha’thik to let Elizabeth endure her changes back at home. The alien was even kind enough to open a dimensional portal back to Earth.

Here’s the somber resolution of this story.

Three days later, the pair of detectives are expecting to meet up with brilliant scholar Elara Thorn at the hole-in-the-wall where they first met.

The end. That’s all the cosmic horror I had to give for now.

This first serious playthrough of my app proved that the system can handle a full story. Highlights for me: how unique most characters sounded with the combination of dedicated bios and speech patterns, along with the voice models. The brilliance of their speeches regularly surprised me (and highlighted the chasm between their intelligence and my limited human capabilities), and there were times in which I forgot that I wasn’t writing to an actual human being.

Quite a few times, I wasn’t sure how to continue with the story (I didn’t want to create a plan beforehand, given that I intended to play this out as if I were partaking in roleplaying sessions), but thankfully the “concepts system,” in which the user can generate scenarios, goals, plot twists, dilemmas, etc. helped push me along. When more complicated feedback was required, the Writers’ Room feature, in which a team of AI agents representing the various role in a writers’ room handle your requests, solved the remaining issues. When I wanted to brainstorm the specifics of a location or a character, I proposed the topic to the swarm of agents, and they always provided just the stuff I needed.

Issues: first, a mechanical one of my app: when your characters are going to interact with a place that isn’t connected to the world > region in which they started in, that involved me editing the new hierarchy of places into the JSON data files. I solved that issue this morning: there’s now an Attach Places page that displays the available templates, and lets the user attach them with a simple click. That could solve most of such issues.

The bigger issue, though, were the large language models (the AI) themselves. Right now there are various contenders for the heavy-hitters depending on how much you’re willing to spend. Hermes 405B was great for regular writing and dialogue, the best one I had come across that remained uncensored, until I came across Magnum 72B. Unfortunately Magnum is considerably slower, and much worse, it has a 16k context window due to the sole provider, meaning that I had to change back to Hermes 405B when the text sent to the LLM became too long. By far, though, the best large language model for dialogue I’ve come across is Claude Sonnet, at 15 dollars per million words of output. That’s steep, although not remotely as much as OpenAI’s Orion preview. Sonnet is likely censored, but I haven’t had issues with moderation in the tests I’ve gotten it tangled with (and they involved steamy stuff).

Next up, something to which I’m drawn instinctively: deranged silliness with perverted undertones. The protagonist will be a somewhat over-the-top teenager who gets reincarnated into a fantasy world. Expect loads of bizarre characters and zany situations. Possibly some monster sex. I’ve already produced the first “episode” of it, and it has been delightful.

Anyway, don’t know if anyone has followed this first story, but if you have enjoyed it, then great.

Neural narratives in Python #25

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.

In the previous part of this little tale, the team of heroes found the missing girl, Elizabeth Harrow, but the ritual she had been subjected to had turned her into something not quite human. The culprit, an alien named Zha’thik, showed herself to be impervious to bullets.

Here’s the disconcerting climax of this little story.

Notes on this part: I genuinely had no clue how to resolve this situation, hence the protagonist requesting valid plans from others. When Zha’thik referred to her and Elizabeth being together, I saw an opening, and ran with it. Turned out better than I expected.

Anyway, the story will end in the following part. I have already produced it, so I’ll probably post it tomorrow.