5 min

Write a long novel with AI and the lore you set up early keeps blurring. To fix that, I built TypeTak's lore dictionary, the World, and I'm writing up what I weighed and chose along the way, one post at a time.

Same Character, Different Names

Duplicate lore is when the same thing ends up in a story bible twice. Novels call one character by a surname, a given name, and a nickname, so if you organize by name alone, one character piles up as several separate entries.

I settled the story bible template in the previous post. Next it had to be filled in, and since lore keeps growing and changing as the manuscript does, that job had to go to the AI. Once the AI started filling in the story bible, the first problem I ran into was duplicates. That's what this post is about.

Lore comes in through two doors

With the structure set, the fields needed filling. Writers couldn't be expected to fill them in by hand every time the lore changed, so the AI had to take that on.

But lore didn't come in through just one door.

  • When the writer says it directly: lore decided in conversation, like “The hero's hometown is a seaside village.”
  • When it shows up in the manuscript: characters and places that first appear in a chapter the writer wrote or a draft the agent wrote.

The two doors bring things in differently. A conversation brings one or two things the writer pointed out specifically, while a manuscript chapter brings characters, places, and events all mixed together. To handle both, I didn't do the organizing in one pass but split it into stages. Each stage went to its own small AI (a subagent): one decides what to create and what to edit, one fills in the property fields, and one writes the section text.

Go by name alone and things get created twice

Right after splitting the stages, I ran into names.

Characters in a novel aren't called by just one name. Some scenes use the full name, some use only the given name, and characters who are close use a nickname. When you organize the manuscript chapter by chapter, you can't tell from the name alone that the character introduced by name in chapter 3 and the one called by a nickname in chapter 10 are the same person. Leave it like that and the World ends up with two of the same character.

Places have the opposite problem too. The name “library” might come up twice, but one could be the school library and the other the royal library. Which library it is depends on where it is. The same name doesn't make it the same thing, and a different name doesn't make it a different thing.

Look before you write

So I let the subagents doing the organizing search the World themselves before writing to it. I made it possible for a subagent to call a search tool in the middle of its work.

When a subagent is about to create a new character, it first searches the World for a similar node. If one already exists, it adds to that node instead of creating a new one. Even when a node with the same name turns up, the subagent can read what's in it and judge whether it's really the same thing.

This search step is needed because when each stage works only from the manuscript in front of it, it has no idea what's already in the World.

Finding the same node under a different name

Still, searching comes down to names too, so searching by nickname doesn't bring up a node created under the character's full name.

So I gave each node search keywords. Register the other names the text uses for that node as keywords (the given name alone, a nickname, a short form) and the same node comes up whichever name you search. Writers can add keywords on the node themselves, and the agent uses them when it searches as well.

A node has only one name, but it can have many keywords, and keywords can overlap across nodes. If the keyword “library” is on both the school library and the royal library, searching “library” brings up both, and you pick the right one by reading what's in them.

The next post covers something that became clear while organizing: lore comes in different kinds. Things like characters and places, the backdrop like eras and principles, and the story itself like events and scenes couldn't all be stored the same way.

I decided the AI that organizes TypeTak's World would search the World first before writing, and gave each node search keywords so the same node turns up whatever name it goes by.

Frequently asked questions

Why does duplicate lore happen?

Novels call one character by several names, such as a surname, a given name, and a nickname. If you organize by name alone, the same character goes in as separate entries. The reverse happens too: places with the same name can actually be different places.

How do I organize a story bible when one character goes by several names?

Keep one entry and list the other names on it. If the same entry comes up whichever name you search, a new name doesn't mean a new entry.

Can I merge places with the same name in a story bible?

Not always. A school library and a royal library share a name but are different places depending on where they are. Don't merge on name alone; read the contents and judge whether it's the same place.

How do you stop AI from creating duplicates when it organizes a story bible?

The key is having it search for existing entries before it creates a new one. The manuscript it's looking at right now can't tell it what's already in the story bible.

Features used in this lesson

Step-by-step details are in the guide.

Author
Oasis

I'm building TypeTak. In this series, I'm recording the problems I ran into while designing the World and the answers I chose.

Try TypeTak yourself

You can start on the free plan.

Start for free