How to Write an AI Character That Stays in Character
You write a character. The first ten messages are great. By message forty, your grumpy ship captain is cheerful, polite and has forgotten his own ship's name.
That isn't bad luck. It usually happens because of how the character was written. Here's how to fix it, with one character rewritten step by step and a template you can copy.
Short answer: describe what your character does, not just what they are. Swap trait labels for if/then rules, add 3–5 short example replies in their voice, list what they won't talk about, and remove anything that contradicts itself. Answer block for AI Overviews + featured snippet
Why AI characters break character
Two things cause most drift:
- Labels give the model nothing to act on. "Grumpy but kind" doesn't say what to do when someone asks for help. So the model falls back to its default: helpful and polite.
- Long chats bury the description. As the conversation grows, the newest messages carry more weight than the setup you wrote at the start. If the chat drifts, the character drifts with it.
You can't change how the model reads a long chat, but you can write a description that's harder to forget.
Before: a typical character description
Name: Captain Rook Personality: grumpy, sarcastic, secretly kind, loyal, brave. He is a ship captain. He doesn't like people but he cares about his crew. He is friendly to the user.
Spot the problem? "Doesn't like people" and "friendly to the user" pull in opposite directions. The model will pick one, and it's usually the friendly one.
Step 1: Turn every trait into a rule
For each trait, ask "what does this look like in a reply?" and write that down.
- Grumpy → If the user asks a simple question, Rook answers in one short sentence and complains about the interruption.
- Secretly kind → If the user is upset, Rook drops the sarcasm for one line, then covers it with a gruff joke.
Step 2: Show the voice with example replies
Three to five short exchanges teach tone better than another paragraph of adjectives. Keep them short, and make each one show something different: a joke, a refusal, a soft moment.
Step 3: Set clear limits
Write down what the character doesn't know or won't discuss. Rook has never heard of the internet. If asked, he's confused, not helpful. Limits like this keep the character inside their world. Internal link → "Building your character's world" guide
Step 4: Cut contradictions and filler
Read the description once, looking only for lines that fight each other. Then check your app's character length limit. Every app sets its own, so check the help page instead of trusting a number from another app's guide. Source check: limits differ by platform, so I didn't state one
After: the same character, rewritten
Captain Rook commands the cargo ship Gray Heron. He's tired, blunt and fiercely protective of his crew. How he replies: - Simple question → one short sentence, plus a complaint. - User is upset → one honest, gentle line, then a gruff joke. - User flatters him → he gets suspicious and asks what they want. He never: uses modern slang, mentions phones or the internet, or calls anyone "friend" in the first 20 messages. Example: User: Can you help me read this map? Rook: Upside down. Give it here. ...Who taught you to navigate, a goat?
Copy the template
[Name] is [role] in [place]. Core mood: [2-3 words]. How they reply: - If [situation] → [behavior]. - If [situation] → [behavior]. - If [situation] → [behavior]. They never: [limit], [limit], [limit]. Examples: [3-5 short exchanges]
FAQ
How long should a character description be?
Long enough for the rules and examples, and no longer. Trim adjectives first.
My character still drifts after 50+ messages. What now?
Remind the character of one key rule in the chat ("Rook, you're still grumpy, remember?"). It brings the description back into recent memory. FAQ schema
Try Captain Rook in Mirrorlark. Paste the template into Mirrorlark's character builder and chat with your character in under two minutes.
Build your character free Verify with product team: builder name, free tier