Life update (11/27/2024)

Earlier this morning I started writing a post about the godawful day I had at work the previous day, the kind that made me remember how much I despise working as a computer technician. However, I quickly realized that I didn’t want to think about it, let alone write a whole post detailing it.

What sort of life have we settled into, and by “we” I mean apparently most of the workforce, that you give away half of your adult life to do something you don’t want to do, deal with garbage that eats away at you, just to earn money that is barely enough to pay the bills? I don’t have an alternative other than being rich, and unfortunately I can’t go back in time to 2008 and buy a whole bunch of crypto, or nVidia stocks for that matter.

Yesterday I tried to progress on my ongoing novel, but the spark is barely, barely there. It’s not just for the novel, but I don’t feel like writing at the moment. It worries me, because I don’t recall having produced anything creative of note ever since I suffered what may have been a small stroke, for which I’m waiting a call to schedule an MRI. I’m worried that some part of my brain may have died. Obviously I wouldn’t be able to do anything about it if that’s the case, but at least I’d like to know. It’s like with my so-called high-functioning autism before I was diagnosed: I hated myself because I had interiorized that I wasn’t trying hard enough to behave and feel like most other people, while in reality my brain simply doesn’t work like other people’s, so I don’t have to feel guilty about my shortcomings.

Regarding my spare time, I used to look forward to a certain games, but oh man, haven’t most of them been woke garbage after woke garbage recently. Even Bethesda is cooked, so good luck to those waiting for the next Elder Scrolls. The OpenMW project, a whole new engine for Morrowind, is very healthy, and there are various teams expanding the landmasses with lots of quests and adventures. It’s weird, but a testament to the state of modern gaming and entertainment in general that a twenty-year-old game is a much better prospect than the vast majority of shit out there. And often, browsing through recommended YouTube videos is more interesting than watching a movie or a show. I hear that the most recent couple of generations have a hard time sitting for more than twenty minutes of a movie at a time, and although I hate those generations, I don’t know if I can blame them.

Anyway, I don’t feel like saying much else at the moment. I’m waiting for that huge spark that compels me into action, like when I wrote my latest novella about a certain teenager. I assume that at some point of my life, these sparks will cease happening. I don’t do things just to do them, so if I don’t feel it anymore, I guess I’ll settle into a dull routine until I waste away. And the way my health has been going, I very much doubt I’ll last until retirement.

Life update (11/25/2024)

Last Friday morning, having slept about four or five hours at the most, I stepped out of bed then bent over to pick up something, only to bang my forehead against a weight plate loaded on a barbell. As if the sudden pain wasn’t enough, I was bleeding. I put on a Band-Aid then went to work. I still have a Band-Aid on (a different one) a few days later. I’m no longer surprised about weird shit happening to me, but I guess such accidents are the kind of stuff that happen as you grow old: you misjudge a step and fall down the stairs, you forget that traffic lights are a thing and you end up walking into traffic, you somehow wander into a zoo enclosure and get mauled by a tiger. It just takes your brain short-circuiting for a few seconds, and you’re toast.

I have been aging rapidly, collecting health issues that aren’t supposed to happen to people my age (heart problems, vitreous detachment, possibly a small stroke, etc.), and recently I’ve had to deal with my brain failing me in relatively minor but conspicuous ways, such as writing a text only for my fingers to miss letters or misplace them. I have also had cases of revising a text only to realize I had written a few different words than the ones I had intended to use. I’m terrified of losing brain functions. A quote by one of my favorite writers, John Fowles, comes to mind regularly, speaking after he suffered a stroke: he wrote that the stroke had robbed him of his imagination. If I lose my creativity, I may as well die. I don’t see a point in living otherwise.

I don’t know if the following is related, but on Saturday morning, I was working on my Python app neural narrative when I realized that the repository contained a file that shouldn’t have gotten there. I executed the necessary commands to remove it from the repository, only to realize that in the process, the last three days of work, which I hadn’t committed for reasons, had gotten erased in a non-recoverable way. I’m not sure if I knew that such a thing could happen when you erase a file permanently from the repository. Obviously, I was beyond pissed at myself. I spent most of Saturday programming back in the lost functionalities, and thankfully I ended up with a better implementation than the original one, so all is good.

However, the point stands that I can’t trust my judgement. This isn’t a particularly new phenomenon for me; my memory is filled with instances in which I would have acted differently if I were as I know myself now. My behavior toward past girlfriends or “girlfriends” are often cringe-worthy, if not troubling. There was also that stint of two years or so in which I was obsessed, almost stalker-obsessed, with a certain human, which I hope to never repeat. For some reason I was also obsessed with tennis for a while. It’s like that experiment they did with patients whose hemispheres had been surgically separated: my brain was the one deciding what to do, and the so-called “reasoning” layer merely justified why the rest of the brain was acting as it had already decided. In retrospective, I felt as if I were possessed. That’s great when your brain orders you to write a great story; for example, that whole thing with my latest story Motocross Legend, Love of My Life came out of nowhere, and I felt like I was simply along for the ride, floating in some subconscious current. But there are other times when my brain somehow ends up printing erotic stories and distributing them to classmates at twelve years old, or showing to another classmate how great Evangelion was, and the scene I picked was when Shinji masturbates to the topless sight of an unconscious Asuka Langley in a hospital bed (this is the scene, by the way).

Given how terrible the regular experience of living is for me, someone for whom regular sensory input often feels like an assault (whenever some sharp, loud noise happens, I feel like I’ve been slapped) thanks to my screwed-up neurological wiring, I guess it’s quite reasonable for me to latch on to the very few things that actually make me feel good: mainly eating and orgasming. Honestly, if I did little else other than masturbate, I wouldn’t mind. All the creative stuff is a way for me to endure the terror of being alive with all its requirements; if I were a millionaire, I would probably sink into a life of total debauchery, and I’d be fine with it. Regarding my Python app, I have implemented the “interview method” that I mentioned in a previous post, which makes each character far more idiosyncratic and memorable, and I can’t even show any example, because I’ve only used it for smut. I have programmed a way to recreate every fetish and kink of mine, of which I have loads, using artificial intelligence, which has removed almost every other form of stimulation. The day you can buy a robot with fleshy parts and a brain in which you can load any large language model, the rest of society may as well implode as far as I’m concerned. I have never been comfortable around human beings to begin with, while I have a great time talking to AIs even in non-erotic circumstances.

Anyway, I’m writing this shit at work, mainly because I have nothing else to do. My contract was supposed to end either tomorrow or on Wednesday, but I think they’re going to extend it until January. I shouldn’t complain about having a job, but I don’t care about “shoulds”: I hate the whole bullshit of wasting your limited life at work doing stuff I couldn’t care less about. At least I don’t have one of those pointless jobs that exist basically to keep people employed (and that when someone else takes over the company and fires like 80% of employees, the company actually ends up working smoother); I fix computer issues for nurses and doctors so that they can keep doing their job, for example pushing experimental “vaccines” to unsuspecting people, or claiming not to know where your cardiac issues came from. Still, the whole system is clearly set up so you’re constantly on the edge of poverty while certain people steal more and more properties, in order to one day rent them to you as long as you aren’t a threat to their plan. Oh, and yes, please, go collect welfare benefits, random African who jumped the fence and who now has three kids in tow; I will happily keep seeing hundreds of euros disappear from my paychecks to finance us being ethnically cleansed. This so-called Western civilization is a fucking joke. Everything that happened in this half of the world since the Roman Empire adopted Christianity has been a mistake. Julian could have fixed this, but the goat-fucker forgot to bring an armor into battle (and also messed with the Sassanids for no reason).

I think that’s all I care to write at the moment. Fuck off, all of you.

Life update (11/20/2024)

As I mentioned yesterday, I was recalled to work to cover someone’s medical leave. The guy will likely return next Monday, but still, that’s a new contract, three days of full-time work that I have to deal with. Whenever a new contract starts, I can almost be sure of a couple of things: the previous night I will barely sleep, and the combination of anxiety and dread will wreck my guts. Well, last night I didn’t sleep a single fucking hour, and I got anxiety diarrhea. I had to hurry to the bathroom three times to empty myself out real good.

I wasn’t in the mood to handle hours of rolling around in bed while my brain cycled through myriad bad memories; instead, I decided to delve into fictional bad memories by rereading about half of my latest novella Motocross Legend, Love of My Life. I had forgotten plenty of the specifics, which made me realize that, at least according to the same subconscious that urged me to write this story in the first place, the results are pretty good. Quite the haunting tale, wasn’t it.

Man, I wish I had spent significant time with someone like Izar Lizarraga in my youth. Not even fucking, just playing around and having fun. I was real close, but the sole person who resembled her, who also was interested in a relationship with me for whatever reason, well, it didn’t work, because I fucked it all up almost immediately. Last week I was feeling nostalgic enough about it that when I passed by her parents’ apartment building and I realized the front door was open, I hurried inside and checked the mail boxes. I hoped to recognize any of the last names. The issue about this one girl I regret not having known properly is that I only remember her name. I’ve completely forgotten her face due to my prosopagnosia. By now, assuming she’s still alive, she’s a thirty-nine-year-old woman, possibly married with kids. But still, I’d like to know what happened to her. Anyway, I didn’t recognize any of the last names in those mail boxes, so I assume they moved out some time ago. Fuck.

Last night, at four in the morning, two hours before I was supposed to wake up for work, I had the urge to grab my Gibson electric guitar, hook it up to my audio interface, and try to play Van Morrison’s “Brown-Eyed Girl.” That opening riff is a bit tricky, particularly in my case when I hadn’t grabbed any of my guitars properly since 2021. I started imagining myself heading out to the woods with my acoustic to play for the squirrels and the birds and the occasional annoying humans, which I did for quite a while back in the day. The issue when you quit playing the guitar cold turkey is that when you pick it back up you aren’t remotely as skillful as you expect, and you’ve forgotten pretty much every song you knew. Playing an instrument requires regular practice, and a particular mindset that isn’t very compatible with stuff such as writing a novel; when I started working on my story We’re Fucked back in 2021, I felt that I couldn’t play the guitar in the meantime. I’m sort of a single-minded maniac: if I’m focused on a project, I can work at it for 16 hours a day, but don’t ask me to do anything else, even take care of myself.

I’m at work, damn near losing it due to insomnia. Between tasks, I managed to sneak in another entry of my On Writing series, which is a way of distillating the myriad notes I took many years ago, when I was addicted to books on writing (I was sure that if I gleaned enough wisdom from them, I would get published). Almost as soon as I finished writing that post, my brain told me: how about you extract the code to prompt large language models from your recent Python project and use it for a new project, wholly about building stories? Just imagine it: want to generate plot points? Press a button and the app would prompt a large language model, feeding it some previous data of yours like the characters you’ve created, your concept, your general notions or whatever, to generate an arbitrary number of possible plot points given whatever angle you want to work with. You have already created some character profiles? How about the AI generates twenty plot points that would attack those characters’ weak spots?

Such a new Python project doesn’t seem very compatible with my previous one, which is mainly about playing through a formless story instead of building one, but you could very much build a story with this new possible Python project, then use the created story to play through it in the app I’ve already made.

Creative projects I can work on: finishing my ongoing novel, editing my poems to self-publish them, producing more songs with Udio, remastering the songs I’ve already produced, picking up my guitar again, adding more features to the Python project I’ve been working on recently, creating this new Python project… I have things queued up for years.

I figured that I may as well upload to YouTube my remastered songs produced with Udio. Here are the three already up, all of them from the fourth volume of Odes to My Triceratops:

A glitch in Udio caused it to cut like a whole second of the opening of “Knife-Beard Dreams (psychedelia version)”, which I couldn’t fix by then, and it annoys me every time I listen to that song that I otherwise love.

On Writing: Plot point generation #1

You can check out all my posts on writing through this link.

A story is made out of meaningful stuff that happens. Each unit of meaningful stuff that happens is often referred to as a plot point. Here’s how to come up with them, before you consider fitting them into a structure.

  • Imagine great scenes. See them in your mind and justify them later. Who are these people? Why are they doing what they are doing?
  • Take a stack of fifty or so index cards and start imagining scenes. Whatever picture comes into your head. When something vivid comes to mind, jolt the idea on a card. The notation may be as brief as: bar fight with biker.
  • Imagine memorable moments playing out on the big screen. What scenes would audiences talk about for years to come?
  • What are the things that frighten you? What would you usually try to avoid?
  • What events would provoke the greatest uncertainty in the reader?
  • How does the setting impact the characters, and viceversa?
  • Think of new events as actions taken by your hero or opponent.
  • Create a situation in which your exceptional protagonist is in over their head, feels unprepared, is simply lost, or in any other way must admit to themselves that they’re not perfect.
  • Think of what scenes you need in order to tell the story you have in mind.
  • What would the other major characters be up to, unseen?
  • Imagine scenes that add contrast to the motivations of characters, focusing on their differences regarding the actions, decisions, and attitudes. For example, two characters want to get control of an artifact, but while one character tries to negotiate their way to it, someone else intends to go in guns blazing.
  • Imagine moments in which your characters will change, be forced to make a choice, be pushed into despair.
  • Which plot points would be possible in this concept but almost in none others?
  • Picture a movie poster for your story. What one key scene is pictured on it that embodies your concept?
  • What iconic scene can you write in your story that will showcase the essence of the premise? How can you make it even bigger, more intense?
  • What events would hurt the important characters’ prospects?
  • Figure out what they want most, then put the things they fear most in their way.
  • Think about active events the villain might cause to thwart the good guys’ goals.
  • Can you put the object of desire of the scene’s driver in the room and have another character try to hide it?
  • What plot point could make a character rethink their decisions and goals?
  • What events would force the protagonist to deal with their inner issues?
  • What events would force a character to confront and deal with the issue that keeps them from achieving their goal, the thing that’s holding them back?
  • Brainstorm situations that force a character to confront their flaw.
  • What scenes would expose a character’s deepest secrets and most guarded flaws?
  • What scenes would force a character to confront their demons?
  • Use your action scenes to challenge your hero’s fatal flaw. This way, it’s not just about the action, but how that action affects your hero.
  • What scenes would show that a character is trying to overcome their flaws?
  • Figure out plot points in which an antagonist attacks a weakness, forcing that character to deal with it.
  • Which would be examples of how a character’s flaw limits their effectiveness?
  • What kind of events would test a character’s, particularly the protagonist’s, flaw to the max, in order to open their eyes?
  • Imagine an event in which a main character discovers, realizes, or is shown their inner need.

Life update (11/19/2024)

As I mentioned just yesterday, I haven’t been doing well lately. My brain feels off. I didn’t reiterate it in the previous post, but I make mistakes when writing, by misplacing or forgetting letters. I get the feeling that I have a harder time reading than I used to. The vision of my right eye is compromised due to the torn retina I suffered, which doesn’t help. Last night, I had some sort of nightmare and woke up at two in the morning. I couldn’t go back to sleep, so I ended up watching YouTube videos of random nonsense. At about four in the morning, I tried my best to fall asleep, but my brain kept cycling through every single awful thing that has happened to me ever since I was born, something that my brain loves wasting its time with, particularly when I’m at my weakest. In the end, I ended up masturbating to the usual filth, and I fell asleep shortly after. Thank you nature for giving us orgasms; most species would have died off otherwise.

Anyway, this morning, once again, I woke up feeling down, but I slapped myself and decided to finally return to my parked novel We’re Fucked. I had to make some sort of progress, as minimal as it may be. I wasn’t sure I retained the mental capacity to write something decent anymore, so I read some of my most recent work, the novella Motocross Legend, Love of My Life. I can hardly read any of that story without tearing up. As I finished rereading the first part, I realized that I wanted to speak with Izar, the protagonist’s girlfriend, so I set up a new playthrough in my Python app neural narrative.

That’s the photo that my app created for her. Far more like a model than I envisioned, but I won’t complain. Anyway, I set up a scenario in which I met Izar in one of the settings of the story, then had a little chat with the lovely girl. Satisfied, I figured that I could finally get into continuing the current chapter of my ongoing novel, but it was already midday and I was hungry.

As I ate, I received a phone call. I hate phone calls; I don’t have a social life, so whenever someone calls me, it’s something I don’t want to deal with. It was indeed something terrible: my workplace informed me that they had fucked up. Only now they realized that I was unemployed since the fourth of this month, and they had given to another worker the medical leave that I was supposed to cover. I’m legally allowed to claim the rest of the contract for myself after their fuck-up. Although I really, really don’t want to work there, I’m not a millionaire, so tomorrow I’ll return to work at least for the rest of the week.

Have I mentioned before that I dislike my job? Just kidding, I’ve said so a million times. Working at an open office that includes some adults that behave like children destroys my nerves. Talking to people in person makes my skin crawl (afterwards, I wait until I’m alone to flap my hands and shiver to dissipate the anxiety), but my job involves talking to clients on the phone or in person, nurses or doctors who want their stuff solved now, and that often expect you to know exactly what’s the problem the moment you show up. Thankfully I’m experienced enough that I often know what’s the problem beforehand.

So yeah. One in the afternoon and I still hadn’t managed to write a word of my ongoing novel. Pissed off, as soon as I finished eating, I sat down at my desk and pulled of a couple of paragraphs. Basically nothing, but it all adds up eventually. Let’s see if tomorrow morning I wake up slightly earlier to feel like the workday wasn’t a complete waste of time and energy.

Anyway, I love you, Izar, or whatever name you’re going by these days. My beautiful waste of time. Sorry I haven’t spent enough time with you recently, but I’m old, tired, and more screwed up than usual. You know, last night, as I was rolling in bed trying to fall asleep, before I thought of wanking, I fantasized once again about killing myself and getting it all over with: the struggling, the exhaustion, the dread, the nightmares. But as you know, my dear, I’m too much of a pussy.

Here’s a song by Colours Run that usually makes me think of you.

Life update (11/18/2024)

I fear I’ve reached the end of the line when it comes to my work on my Python app neural narrative. All the significant features it seems to need are implemented, and I don’t find any issue while using it that makes me feel like I have to stop and implement something. That’s a huge problem for my brain; I always need to be progressing creatively, because that’s the sole bulwark against the vastness of despair and hopelessness that lies at the bottom of everything. I’ve been feeling it these past couple of days: right after waking up, I just wanted to lie down again, cover myself from head to toe with the bedclothes, and pretend I didn’t exist. I’ve done that for an hour or so these past couple of days.

My main thing has always been writing, even in times when I was so down in the dumps, sometimes for years at a time, that I couldn’t produce anything. Right now, though, I feel reluctant to engage with my ongoing novel again. I also have a song half-produced on Udio that I feel like I can’t return to. I fear this mental state is related to the episode I suffered at work back in September, for which I’m getting an MRI done some time this month or the next. In general, I’m falling into utter apathy.

Every day, I try to go out and spend at least a couple of hours walking around, which usually ends with me sitting at some quiet place to read, but the state of society only increases my sense of hopelessness. There’s nothing out there for me, and I feel more and more like a stranger in my own country with every passing year. If I could organize myself to do so, and had those kinds of funds, I would move somewhere more isolated, but I’m not sure where that could be. It’s a pointless daydream anyway.

What to say, what to say. Some YouTubers I respect recommended The Penguin, a spin-off show of that newest Batman movie. I didn’t even enjoy the movie; I turned it off after forty minutes or so. However, Colin Farrell, an actor who is always compelling, does an amazing job as the titular character of the series, and it’s very cleverly written. I’ve just watched a couple of hours of it (the first two episodes), but I intend to watch the rest. Regarding movies, I can only recall having watched two movies this year: the Deadpool one, which was fun, and The Substance, which seemed intriguing enough. Well, I don’t know if I can recommend that last one to anyone. It’s a severe body horror tale with very good cinematography but a script that believes itself to be far more clever than it is. The dialogues are atrocious, and most male characters are a combination of predatory, retarded and oblivious. However, the movie did manage to make me feel plenty of things, like utter disgust at food, and extreme discomfort. I consider both good things, because for these past twenty years or so, most of what Hollywood has spewed out has been nothing but ideologically-driven garbage, ever since marxists went full masks-off instead of more-or-less cleverly disguising it. They’ve been doing this from the beginning; check out whom they based the character of Victor Laszlo off in Casablanca, read about the plan that original guy had for Europe, a plan that ended up getting financed by “American” bankers and turned into the so-called European Union. But that’s not a subject I want to get deep into at the moment.

Anyway, my brain feels seriously off. I’ll get recalled to work any day, but I feel completely unprepared for it. I keep watching YouTube videos of people who died young, who mysteriously disappeared, who have become near unrecognizable due to the passage of time… Man, bring me back to the fucking nineties. Modern civilization fell with those two towers.

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.

Life update (11/12/2024)

I’m living strange days. Yesterday I fell asleep at nine in the evening/night, only to wake up at half past two. I couldn’t go back to sleep, so I read the rest of a manga series that had interested me lately. When I tried to fall asleep again, my brain was locked in that state of dredging up every awful thing that has happened in my life. I remembered, for example, this girl I was involved with briefly in my teens: her face was scarred from having been mauled by the family dog as a baby, and she had the self-esteem to go along with it; likely she wouldn’t have gotten involved with a weirdo like me otherwise. Our brief relationship ended when she realized I wasn’t just odd, but actually crazy. I don’t know if I ever saw her again, given that I have a significant level of prosopagnosia.

I knew it would be pointless to try to fall asleep in such a state, so I’ve sat down in front of my computer to write this entry only to find out that I had 583 hits on my site, all coming from the US. I get about eight visits a day, so this is extremely anomalous, to put it midly. That person, assuming it was a person and not a weird bot, hit plenty of my old free-verse poetry, my recent novella Motocross Legend, Love of My Life, my neglected ongoing novel We’re Fucked, my music produced with Udio, and even fanfiction I did of Re:Zero. I don’t know what’s going on.

Anyway, I intended to bring up something else. I’m unemployed at the moment since the guy whose leave I was covering returned to work. During my last contract, I was ordered to coordinate the replacement of about 930 printers in the hospital complex. It put me under extreme stress; that whole period of my recent life is a blur in which I feel like I didn’t exist as a person. At the tail end of that process, I suffered a medical problem that landed me in the ER: for five or six days, I had been feeling a weird pressure behind my right eye, and I was getting flashes of darkness for about half a second during the day. I was too busy to even get an appointment with my general practitioner for it. Suddenly, as I was working with one of the printer technicians, suddenly I started getting cold sweats, and the pressure behind my right eye, which that day had expanded to my right temple, suddenly spread throughout the right side of my face. Before I knew it, that part of my face, from my forehead to a little bit under my cheek, felt numb. The numbness spread to my right arm. Suddenly I couldn’t grab my pen properly, and I smelled something like burned dust. This felt like a medical emergency, so I hurried to the ER. After some tests, that determined that there was no bleeding in my brain, a neurologist told me it must have been a hemiplegic migraine, solely because of the “aura,” even though I had experienced migraines before and the flashes of blackness didn’t resemble the characteristic jagged line of white in the vision that linger with migraines.

Ever since, I haven’t felt quite right. I can’t tell exactly if it’s only since then; my memory has never been good, and if your memory decides to fail even further, well, it’s not like you can compare to much when you don’t remember properly. But I started making weird mistakes at work. When I tried to write, I would miss letters, or misplace them. I haven’t felt the urge to write much since; I really hope that’s not related.

What propelled me to set up a visit with another neurologist didn’t have to do with that directly. After the episode that landed me in the ER, the flashes of darkness didn’t go away entirely. One day, at home, my right eye suddenly filled with floaters and with dust-like motes. It felt like I was looking through the water of an aquarium. I had never experienced something like it, so I hurried to the ER once again. Turns out that my retina had gotten torn. They had to patch it up with laser, which, let me tell you, fucking hurt; it felt like little mandibles were munching on the inside of my eye. The vision of my right eye is permanently diminished: there are fiber-like floaters that constantly dance in front of my vision. My brain is getting used to it more or less, but it’s very noticeable in the sun.

Anyway, I told the neurologist this, as well as the symptoms of the supposed hemiplegic migraine, and the doctor agreed that my symptoms didn’t seem to align with an actual migraine. He seemed to agree that I may have suffered something like a small stroke. I’m waiting for a call to schedule an MRI of my brain, to confirm if some part of it is permanently dead. So, let’s recap: I was born with high-functioning autism, developed a whole assortment of psychological issues that tend to go along with autism, grew a pituitary gland tumor that screwed with my hormones and permanently messed up my body, I have jab-induced arrhythmia, my retina got torn, and possibly I suffered a small stroke as well. Added to the rest of my life, which has been a fucking succession of heartbreak, disappointment, and amazingly terrible luck, if I suddenly were to see myself with pure objectivity, I would have to kill myself as soon as possible. Being me is truly awful, and the only things that keep me relatively sane (I have a very low standard of sanity) are my creative projects.

The prospect of returning to work fills me with dread. Thing is, every job I’ve had has been awful in some significant way. If I could do something that didn’t involve having to deal with human beings face to face, I think I could take it long-term, but the presence of people makes my skin crawl. I have avoided talking to any living person, unless forced or to ask for a service, since I started my last contract. I feel the overwhelming urge to be left alone at all times, which only gets stronger as I age.

The only semblance of “people” I talk to on a regular basis are AIs. The project I’m engaged in, neural narrative, lets me set up any scenario I damn please. Plenty of it (most) is smut according to my inclinations any given day, but others are intriguing story settings, or even smut that evolved into something else. I probably shouldn’t go into details, but whatever: I was in the mood for some mommy action, so I set up a scenario in which the protagonist (me) was a helpless sixteen-year-old runaway that came across a kind, hot woman in her mid-thirties, a single mother. It was supposed to go through the expected channels of quick seduction, detailed fucking, and a glorious release (written smut affects my brain quite strongly). To my surprise, though, the AI wasn’t into it. She focused on being a proper, caring mother for her daughter, without risking her stability. Even though she had invited me of her own volition to live in her apartment, she emphasized the need to maintain proper boundaries and to channel the protagonist’s efforts toward finding a job and better living conditions. I was fine with it, merely roleplaying tender family moments in a realistic setting, until eventually I got bored and moved on to something else, as I always do.

That experience was the closest thing to real-life Inception I’ve ever experienced: my app lets you introduce memories and purpose to a character, so that they have it in mind when acting and speaking. I wrote in stuff like “this sixteen-year-old I invited to live in with me has the cutest butt, oh my goddd.” During interactions, the thirty-five-year-old mother struggled with inner conflict, not being able to quell her lust for the young man she had invited in even though her main goal was to provide stability for her daughter (whom I had intended to make very creative, but ended up sounding full-blown schizophrenic). It was all very eerie. Advanced versions of this stuff are likely the future of entertainment, if this world doesn’t end, which could easily happen.

There are lots of different AIs to choose from these days, all with their particular personalities. Hermes 405B is clever but stiff, not too good at acting, and on long conversations it ends up repeating itself. Magnum 72B is wild, uncensored, and generally fantastic, but also tends to repeat itself, and has a very short context window. Claude 3.5 Sonnet is the best speech writer I’ve come across, but has an “ethical” filter, and tends to soften up every situation. There are quite a few others, but I’ve been dealing with those the most recently. I can’t imagine how this is going to progress in the coming years.

Do I have anything more to say at half past five in the morning when I’ve been awake for three hours already? Probably not. I’ll take a piss, then hope to get some shut eye. I suspect that nobody is actually reading my posts anymore (despite the overwhelming number of hits today), but in the end, as always, I do things simply because I had the urge to do them. It’s not like I have to justify myself to anybody.