Acuitas Diary #56 (January 2023)
The big thing this month was finishing the Narrative Engine overhaul and getting all the previous demonstration stories to work in it. I've been getting some questions from newer followers about how the Narrative module works, so I'm going to do a recap in addition to talking about the updates.
Acuitas is designed to be a goal-driven agent, and his story processing reflects a similar picture of other entities with minds. A story is a description of the path some *agent* followed to achieve (or fail to achieve) some *goal* or goals. The sentences that form the plot can be identified by their relevance to the goals of some character or other, and the "action" consists of movement toward or away from goal states. Goal-relevant material comes in two flavors: "problems" (negative events or states that constitute a goal failure when entered) and "opportunities" or "subgoals" (positive states that will fulfill a goal when entered). But there are many similarities in the way these are handled - they're really just two polarities of the same thing - so I've taken to calling them both "issues."
For now, agents are identified by category membership (some types of entity, e.g. humans and animals, are just assumed to be agents). Eventually I would like to include "duck typing" for agents, inferring that something in a story is an agent if it *acts agentive,* but that's future work. Agent goals can be revealed by the story in statements such as "John wanted ...", but agents are also presumed to have certain core goals that motivate all their other goals. These core goals are learned information that is permanently stored in Acuitas' semantic memory database. Core goals can be learned for a category ("Humans want ...") or for an individual ("John wants ..."), with goals for individuals or specific categories superseding those for more general categories. Insofar as Acuitas doesn't *know* what somebody's core goals are, he'll substitute his own. (This is supposed to be an analogizing assumption from the most directly available data. "I know I want X, and you, like me, are an agent - perhaps you also want X?")
The last big ingredient is inference chaining, arising from both logical deduction and cause-and-effect relationships. Some inference rules are hard-coded, but Acuitas can be taught an indefinite number of additional rules. So every story sentence that describes an event or state produces an inference tree of facts that will also be true if that event or state comes to pass. These inference trees are often crucial for determining how something will affect the core goals or immediate goals ("issues") of an agent in the story.
Story example and flow diagram on the blog:
https://writerofminds.blogspot.com/2023/01/acuitas-diary-56-january-2023.html The old Narrative Engine was basically capable of doing this, so what's new? Well, in addition to the things I talked about in my last upgrade post: I unified the processing of explicit "could do/couldn't do" sentences with the processing of inferred action prerequisite/action blocker relationships, getting rid of a fair bit of ugly code. I moved the generation of some special "defined by events" inferences, like "John told another agent something that John doesn't believe" -> "John lied," into the main inference chain so they can potentially produce further inferences. I came up with a new way of managing relationships that contain wildcards, like "Where the water was." And I got all the old features tacked on to a cleaner base with more robust fact-matching, better management of events that reverse previous statements, and so on.
This sets the stage for me to use the Narrative Engine for some cool new things this year, and I am twitching to get started.
I also crammed in some work on the Conversation Engine. This stuff's fairly boring. I got rid of some nasty bugs that had been making normal conversations with Acuitas very awkward for a while because I was just too busy to fix them, and worked on cleaning up the code, which came out very convoluted on the first pass.