7 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.

Why Does AI Forget the Earlier Parts of Your Novel?

AI forgets the earlier parts of a long novel because there's a fixed limit on how much it can read at once. Once a manuscript runs past that limit, the AI can't see the beginning directly and has to look it up again from wherever it was written down. As I see it, there are two ways to do that lookup: RAG, which finds passages with similar meaning and attaches them, and reading organized files.

I'm building TypeTak, an AI writing editor where writers work on novels with an agent (an AI that works alongside them). To keep the AI from forgetting the lore a writer set up early in a long novel, I built the World: a lore dictionary where details are organized and the AI looks them up. This series walks through how the World came together, in order.

This first post goes back to before the World existed. It covers how I weighed the two paths for helping an AI remember what came earlier in a novel, and which one I took.

There's a limit to how much AI can read at once

The amount an AI model reads in one go is called its context window. Window sizes vary by model and grow every year, but once a serial passes a hundred chapters, it's hard to feed in the whole manuscript every time. Even when it fits, it's expensive.

A big window doesn't solve everything, either. “Lost in Stories,” a study published in March 2026, measured how often AI writes sentences that contradict facts established earlier when it writes long stories. Contradictions were most common for facts (who has what) and time (what happened when), and they clustered in the middle of the story rather than at the beginning or end. (arXiv)

Here's what that looks like for a writer: a protagonist who hurt her left arm in chapter 3 swings a sword with both hands in chapter 10, and a side character who always spoke formally is suddenly talking casually.

So every AI tool built for long fiction has to answer the same question: how do you get the AI to find and reread earlier material that sits outside the window, right when it's needed? I saw two answers.

Option one, RAG: searching by meaning misses what's built up

RAG splits the manuscript into small chunks, stores them, and hands the AI the chunks closest in meaning to the scene being written. It works well for things like company documents or customer support, where the answer sits complete in a single passage.

For fiction, I thought this is where it breaks down. What a story needs isn't similar sentences. It needs the result of everything that's built up.

Ask “What state is the protagonist's left arm in right now?” and RAG brings back several passages that mention her left arm. The scene where she's hurt, the scene where it's bandaged, and the scene where it's healed come back mixed together, and nothing tells you which one is current. A reason that built up over several chapters, like “Why did these two fall out?”, isn't complete in any one passage, so a search by meaning only turns up fragments.

Searching by meaning answers “What is this similar to?” but not “What has built up so far?” So I decided not to put RAG at the center of memory.

The other path is to keep the lore in separate files and have the AI read them. It's the same idea as a writer's story bible. A common shape is a wiki, with a page for each character and each place, linked to one another.

What drew me to files was the links. In a wiki, you can go from the protagonist's page to her mentor's page, and from there to the incident where the mentor was injured. You follow what's connected, whether or not the meaning is similar. For finding a story that has built up over time, this was the better fit.

Files had two weak spots, though.

  • No structure. Let the AI write them however it likes, and every page ends up shaped differently. The AI can still read them, but they're awkward for a person to skim and fix. A story bible the writer can't check isn't one they can trust.
  • Without upkeep, it piles up. Lore keeps changing as the manuscript grows. If it isn't sorted out each time, the same character ends up with two pages, or contradictory details sit side by side on one page. A contradictory story bible is worse than none.

So I went with files

Looking at the two paths side by side, the answer was files. RAG's limits come from how it works, but the two weak spots of files looked like problems I could solve.

  • If there's no structure, set one. One that's easy for people to read and that the AI can fill in on its own.
  • If things pile up without upkeep, make upkeep part of the job. Make sure the same thing never gets created twice, and that changed details land where they belong.

That was easier said than done. Solving those two problems took longer than I expected, and the files that came out of it are what TypeTak's World is today.

The next post takes on the first problem: structure. I found my lead in Namuwiki, Korea's biggest community-written wiki. I'll write about how its countless pages on different works, written by different people, all end up with the same shape, and what I took from that.

I decided TypeTak would remember earlier parts of a novel not through RAG, which looks things up by meaning, but by following links through organized files. In exchange, I took on two jobs: structure and upkeep.

Frequently asked questions

How do AI fiction tools remember what came earlier in a novel?

An AI can only read so much at once (its context window), so for the earlier parts of a long manuscript it has to look up what was written down elsewhere. There are two main ways: RAG, which finds manuscript chunks with similar meaning and attaches them, and reading files (a wiki) where the lore has been organized.

Does an AI with a large context window still forget earlier parts of a novel?

It can. The context window is how much an AI can read at once. A bigger window lets you fit more of the manuscript in one go, but costs more. And even text inside the window isn't always read properly. In the 2026 study “Lost in Stories,” contradictions in long stories clustered around the middle.

Why isn't RAG a good fit for fiction?

RAG splits the manuscript into small chunks, stores them, and hands the AI the chunks closest in meaning. What fiction needs is the result that has built up over many chapters and the current state of things, and that isn't complete in any single passage. So a search by meaning returns chunks from different points in the story mixed together, with no way to tell which one is current.

What are the downsides of organizing story lore in a wiki?

A wiki lets you follow links to related lore, but it has two weak spots. Without a set structure, every page is shaped differently and hard for a person to check. And if it isn't updated each time the lore changes, the same thing gets created twice or contradictory details pile up.

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