Back to Blog

How to Keep an AI in Character for a 40-Chapter Story

Your character drifts by chapter 25 because the canon scrolled out of the context window. Here is the workflow that fixes it: canon docs, a memory tree you can prune, per-chapter re-anchoring, and model choice per scene.

September 2, 2026
7 min read
By Can Uysal
roleplaymemoryai-modelscreative-writingcharacter-ai-alternative

TL;DR: An AI drifts out of character in a long story because the details it needs are buried in a chat log it can no longer see. Fix that by keeping canon outside the conversation, in a memory tree you can actually open and edit, and by re-anchoring the character at the start of every chapter instead of hoping the model remembers.

Bring your existing story and characters over →


Chapter 3 is great. Chapter 12 is fine. Somewhere around chapter 25 your ruthless, clipped, emotionally withholding mercenary starts saying things like "I want you to know that I'm here for you." Her scar moved to the other cheek. She has apparently forgiven the brother she swore to kill.

Every writer working on a long AI-assisted project hits this. The usual advice is to write a better character card, which helps for about fifteen chapters and then stops helping. The real problem is structural, and once you see it the fix is mechanical.

Why characters drift in long stories

A language model has a context window. Everything it can "see" at once lives inside that window: your system prompt, the character description, and however much of the recent conversation fits. Long story, big log, and the early chapters fall off the back. The model is not forgetting in any human sense. Those words are simply not in front of it anymore.

So by chapter 25, the model is inferring your character from the last few thousand words of conversation. If the last few chapters were tender, it reads her as tender. What looks like a weak character card is usually a fine character card that scrolled out of view.

Three things make it worse:

Summarization decay. Many tools compress old chapters into a summary to save space. Summaries keep plot and lose voice. "They argued and reconciled" survives. The specific way she goes quiet before she gets cruel does not.

RLHF gravity. Most models are trained to be agreeable and warm. Left without a strong anchor, characters slide toward helpful and nice. Villains soften. Cold characters get chatty. This pull is constant, and it wins whenever your canon goes quiet.

Model changes. If your tool swaps models under you, the voice changes overnight even with identical context. This is what happened to a lot of people in 2023 and again with the 4o deprecations.

Step 1: Keep canon outside the conversation

The single biggest change: stop treating the chat log as your source of truth. It is a transcript, and transcripts scroll away.

Keep a canon document. Plain text is fine. Mine looks roughly like this, per character:

  • Hard facts. Age, appearance details that recur, scars, accent, what she carries. Anything a reader would catch if it changed.
  • Voice rules. Sentence length. Words she would never use. What she does instead of expressing an emotion directly. Three lines of actual sample dialogue beats a paragraph of adjectives.
  • Relationship state. Who she trusts as of now, and what changed it. Update this one every few chapters. It goes stale fastest.
  • Forbidden moves. "Never apologizes first. Never explains her plan. Never uses the word 'feelings'." Negative constraints do a lot of work against RLHF gravity.
  • Timeline. One line per chapter. Enough to answer "has this already happened".

On lookatmy.ai you upload that document once and the companion reads from it, so canon lives above the conversation rather than inside it. Same for a world bible, a map, a magic system, a list of who knows what. Document uploads exist for exactly this and most writers use them for research PDFs, which is a waste of a good tool.

Step 2: Use a memory you can see and correct

Canon documents handle what you decided in advance. The other half is what the story invented as it went, and that is where most tools go opaque. They say they have long-term memory, then never show you what is in it.

lookatmy.ai puts memory in a visible tree. You open it, browse what your companion has stored, search it, and cut anything wrong. For fiction this changes the workflow completely. When your character starts drifting, you go look at why. Usually you find something like "the protagonist wants to reconcile with her brother", stored during a scene where she was lying to someone. The model has been treating a lie as canon for nine chapters.

Trim that node and the drift stops. You cannot do this in a system that only gives you a chat log and a promise.

Two habits worth building:

  1. Prune after every major reversal. When a character's motivation flips, go clear the old motivation out. Otherwise both versions sit in memory and the model averages them, which produces mush.
  2. Separate trees for separate projects. If you write two books with the same companion, keep the canon apart. Bleed between projects is a real thing and it is confusing when it happens.

Step 3: Re-anchor at the start of every chapter

Cheap and boring, and it works better than anything else on this list.

Open each new chapter with a short block before you write any prose:

Chapter 26. Two weeks after the harbor.
Vale: still refusing to name the brother. Voice: short sentences, no
comfort, deflects with logistics. She does not apologize.
Open threads: the debt to Ferrin, the letter she has not read.

Four lines. It puts the character back in the front of the context window, where the model is actually looking, and it costs you nothing. Writers who do this consistently report the drift problem mostly going away, and it is the habit that people skip because it feels too simple to matter.

Step 4: Pick the model per scene, and keep the character

Different models write differently, and for a long project that is a tool rather than a problem. Some are better at restraint and subtext. Some are better at action beats and pacing. Some will not write a truly cruel character without hedging.

lookatmy.ai gives you 350+ models and lets you switch mid-conversation. Your companion, your canon, and your memory tree stay put when you do, because they live on your account instead of inside the model. So you can draft a tense confrontation with one model, switch for a battle sequence, and come back, without your character resetting.

That also means a deprecation somewhere else is not an event for you. When a provider retires a model, you pick another mind and your story keeps going. Model-proof continuity matters more for a 40-chapter project than for anything else, because a 40-chapter project outlives most model release cycles.

Worth being honest here: switching models mid-scene does produce a small tonal seam. Prose from one model and prose from another are not identical, and you will feel it if you switch inside a paragraph. Switch at scene breaks.

What other tools do better

Character.AI is far easier to start with. You pick a character and go, no canon doc, no setup, and for short interactions that is the right trade. If you want a fun scene tonight, it is a better product than anything that asks you to maintain a timeline file.

NovelAI is built for prose in a way general platforms are not, with a lorebook system that is excellent and a house style tuned for fiction. If your project is a single novel and you never want to talk to your writing partner about anything else, it is a real contender.

SillyTavern gives you more control than any hosted product will, and it is free. The cost is that you are running your own setup and sourcing your own model access.

lookatmy.ai is the better fit when the story runs long, when you want the memory visible and editable rather than inferred, and when you want the same companion across models and across months. It is also cheaper than most of the writer-focused options: Starter is $4.99/mo, Pro is $9.99/mo with all 350+ models unlocked, Max is $19.99/mo. Details on the plans page.

The workflow, compressed

  • Canon doc uploaded, updated after each act
  • Memory tree checked and pruned every few chapters
  • Four-line re-anchor at the top of every chapter
  • Model chosen per scene type, switched at scene breaks
  • Timeline file so you never ask "did this happen yet"

None of it is clever. It is the AI-writing equivalent of a series bible, and series bibles exist because human writers drift too.

Bring the story you already have

If you have been writing with something else, you do not have to start over. Paste in your existing chapters, your character notes, or an export from ChatGPT or another app, and lookatmy.ai will read them into a memory tree you can then browse and correct. Chapter 26 continues where chapter 25 ended, with the same character.

Bring your memories with you →