AI roleplay guide: how to keep long roleplays from falling apart
How to run AI roleplay that lasts: short character cards, keyword lorebooks, session summaries and fresh chats, and why long chats forget and cost more.
Edited by Troy · Published
Run long roleplays in sessions, not one endless chat. Keep the character card short and put lore in keyword-triggered lorebook entries. Stop at a natural break, summarize what happened and check the summary. Then start a fresh chat seeded with the summaries and this session's goals. Every reply resends the whole history, and models lose track of details as that history grows.
Why long roleplays fall apart
Long roleplays break down because every reply has to reread the whole chat. One model maker's documentation explains how this works. Each turn's input contains all previous conversation history plus your new message, and the context window holds up to 1M tokens depending on the model. A bigger window doesn't solve the problem. The same documentation says the model's ability to recall information drops as tokens pile up, which it calls context rot. It also says context has diminishing returns, and this degradation appears across all models. Chat interfaces can manage the window on a rolling first in, first out basis, so the oldest messages drop out first. Those are often the ones that set up your story.
Research on long inputs reaches the same conclusion. The "Lost in the Middle" study found models perform best when the relevant information sits at the beginning or end of the input. Performance degraded significantly when the information sat in the middle, even for models built for long contexts. Its authors conclude that current models do not reliably use information in long inputs.
A separate report tested 18 models and found performance degraded with input length in every experiment. It also found that distractors hurt more as inputs grow. Distractors are content on the same topic as the answer that doesn't actually answer the question, like five earlier tavern scenes when you need the details of one. Near-perfect "needle in a haystack" scores don't contradict any of this, because that test is a simple retrieval task.
A huge lore bible pasted into the character definition causes the same problem from message one. SillyTavern's documentation gives the arithmetic: on a model with a 2048-token context limit, a 1000-token character definition cuts the AI's memory of the chat in half.
What a long chat costs
Cost rises with every message, because the full history is resent each turn. At this review, the same model maker charges $2 per million input tokens and $10 per million output tokens for one of its models. Another of its models costs $0.10 per million input tokens for prompts up to 100,000 tokens and $0.50 per million above that. A chat that crosses 100,000 tokens on that model therefore pays five times the input rate on every turn. Prompt caching softens this. It reuses previously processed parts of a prompt, such as conversation history, and reads them at a fraction of the standard input price.
Set up the character
A character card is a collection of prompts that sets how the model behaves, according to the SillyTavern docs. SillyTavern is free, open source and installed locally, and its makers say it will always be free. It is only an interface, so you also need an LLM backend such as AI Horde, an OpenAI-compatible API or KoboldAI.
The docs list several fields as permanent tokens sent with every request: name, description, personality and scenario. Every word in those fields costs chat history, because a large permanent definition leaves the model less room for your conversation.
The first message matters most for voice. The docs say the model is more likely to copy style and length from the character's first message than from anything else. Write that message at the length you want replies to run.
The Examples of dialogue field shows how the character speaks. Example blocks go in only if there is free context space, and they are pushed out block by block as the chat fills. For traits that must hold all the way through, the Character's Note injects text at a fixed depth in the chat, however far the chat has progressed.
Keep lore in a lorebook, not the prompt
World Info, which SillyTavern also calls Lorebooks or Memory Books, inserts prompts into the chat dynamically. It works like a dictionary: an entry goes in only when its keywords appear in the message text. That means a city's history costs nothing until someone mentions the city.
The docs give a few rules for entries:
- Keep entry contents concise to save prompt tokens.
- Write each entry as a standalone description, because keywords and titles aren't inserted.
- Give an entry a larger insertion order number to place it closer to the end of the context, where it has more impact on output.
Lorebooks can be bound to a character, a persona or a single chat. A chat-bound lorebook stays active only in that conversation.
Other story tools with a Lorebook work the same way. Each entry has activation keys, and the entry's text is inserted when a key appears in the recent context. One such tool also hides entry titles from the AI, so put the title inside the entry text. It offers an "Always On" option that inserts an entry whether or not its keys appear. Save that for the few facts every scene needs.
The session routine
- Install SillyTavern and connect it to an LLM backend.
- Create the character card, keeping name, description, personality and scenario short.
- Write the first message in the style and length you want replies to match.
- Fill the Examples of dialogue field with lines in the character's own voice.
- Put the traits that must never slip into the Character's Note.
- Open World Info and create one entry per place, person or faction, each with its keywords.
- Bind the lorebook to the character, persona or chat it belongs to.
- Raise the insertion order number on the entries that should steer replies most.
- Play until a natural break, such as a finished quest or chapter, or until messages start dropping out of the prompt.
- Generate a summary with the Summarize extension.
- Read the summary and correct anything it lost or made up.
- Switch on Pause in the Summarize extension if you would rather write the summary yourself.
- Start a fresh chat for the next session.
- Paste the summaries so far into the Author's Note, keeping only the details this session needs.
- Add this session's intent to the Author's Note: where each character is right now, who should appear and what should happen.
- Before a fight or action scene, add a response length or writing style to the Author's Note so the scene stays short.
The Author's Note can sit at any position and frequency in the prompt. The closer it is to the bottom, the more it affects the next reply, which suits session goals and pacing instructions. Seeding the new chat this way follows the model maker's advice to find the smallest set of high-signal tokens. It also puts the important material at the start and end of the context, where the research found models use it best.
What to expect afterwards
World Info does not guarantee the lore shows up in replies. The docs say that depends on how well the model uses the extra information. Summaries will drift if you stop checking them, because generated summaries can lose details or contain hallucinations. Example dialogue drops out first as a chat fills, so if the character's voice slips late in a session, end the session there. The rule is to start a new chat whenever the old one forgets something you had to repeat.
Apps this guide covers
- SillyTavern review35Home-cooked
Free, open-source roleplay frontend: you bring the model, it runs the characters
Sources
The source text behind the claims above, and the day we read it.
- Receipt 1Reviewer
The "Lost in the Middle" research found language model performance is often highest when relevant information is at the beginning or end of the input, and degrades significantly when models must use information in the middle of long contexts, even for explicitly long-context models.
"performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models"
arxiv.org, retrieved
- Receipt 2Reviewer
Anthropic's docs say more context isn't automatically better: as token count grows, accuracy and recall degrade, which it calls context rot.
"more context isn't automatically better. As token count grows, accuracy and recall degrade, a phenomenon known as context rot."
docs.anthropic.com, retrieved
- Receipt 3Reviewer
Anthropic's docs explain each turn's input contains all previous conversation history plus the current user message.
"Input phase: Contains all previous conversation history plus the current user message"
docs.anthropic.com, retrieved
- Receipt 4Reviewer
Anthropic's docs say the context window holds up to 1M tokens depending on the model, covering conversation history plus new output.
"The context window ( up to 1M tokens, depending on the model ) holds the conversation history plus the new output Claude generates."
docs.anthropic.com, retrieved
- Receipt 5Reviewer
Anthropic says chat interfaces like claude.ai can manage the context window on a rolling first in, first out basis.
"Chat interfaces such as claude.ai can also manage the context window on a rolling "first in, first out" basis."
docs.anthropic.com, retrieved
- Receipt 6Reviewer
SillyTavern's World Info (also called Lorebooks or Memory Books) inserts prompts dynamically into a chat to guide AI replies.
"World Info (also known as Lorebooks or Memory Books) is a powerful tool available in ST to insert prompts dynamically into your chat to help guide the AI replies."
docs.sillytavern.app, retrieved
- Receipt 7Reviewer
World Info works like a dynamic dictionary that only inserts an entry when its keywords appear in the message text.
"It functions like a dynamic dictionary that only inserts relevant information from World Info entries when keywords associated with the entries are present in the message text."
docs.sillytavern.app, retrieved
- Receipt 8Reviewer
SillyTavern notes World Info does not guarantee the lore appears in output; that depends on how well the model uses the extra information.
"it does not guarantee its appearance in the generated output messages. That depends on how good your model is at making use of additional information!"
docs.sillytavern.app, retrieved
- Receipt 9Reviewer
SillyTavern advises keeping World Info entry contents concise to conserve prompt tokens, and says each entry should be a standalone description because keywords and titles aren't inserted.
"To conserve prompt tokens, it is advisable to keep entry contents concise."
docs.sillytavern.app, retrieved
- Receipt 10Reviewer
In World Info, entries with larger insertion order numbers are placed closer to the end of the context, where they have more impact on output.
"Entries with larger order numbers will be inserted closer to the end of the context as they will have more impact on the output."
docs.sillytavern.app, retrieved
- Receipt 11Reviewer
Lorebooks in SillyTavern can be bound to a character, a persona, or an individual chat; chat-bound lorebooks stay active only in that conversation.
"Entries from a chat-bound lorebook are only active in that specific conversation and will not carry over to other chats with the same character."
docs.sillytavern.app, retrieved
- Receipt 12Reviewer
SillyTavern's Summarize extension creates and stores automatically generated summaries of chat events, which can act like long-term memory, with caveats.
"Summarization can help with outlining general details of what is happening in the story, which could be interpreted as a long-term memory, but take that statement with a grain of salt."
docs.sillytavern.app, retrieved
- Receipt 13Reviewer
SillyTavern warns model-generated summaries can lose important details or contain hallucinations, so users should check and correct them manually.
"the outputs may lose some important details or contain hallucinations, so you're always advised to keep track of the summary state and correct it manually if needed"
docs.sillytavern.app, retrieved
- Receipt 14Reviewer
The Summarize extension has a Pause option useful for supplying your own custom summary instead of automatic updates.
"Pause - check this to prevent the summary from being automatically updated. This is useful if you want to provide a custom summary of your own"
docs.sillytavern.app, retrieved
- Receipt 15Reviewer
SillyTavern suggests the first summary be generated when messages start dropping out of the prompt.
"Ideally, you'd want to have the first summary generated when the messages are starting to get dropped out of the prompt."
docs.sillytavern.app, retrieved
- Receipt 16Reviewer
The Lost in the Middle paper concludes current language models do not reliably use information in long input contexts.
"indicating that current language models do not robustly make use of information in long input contexts"
arxiv.org, retrieved
- Receipt 17Reviewer
SillyTavern's docs say a 1000-token character definition cuts the AI's memory in half on a model with a 2048-token context limit.
"If you're working with an AI model with a 2048 context token limit, a 1000-token character definition cuts the AI's 'memory' in half."
docs.sillytavern.app, retrieved
- Receipt 18Reviewer
A large permanent character definition means the AI has less chat history available, so less 'memory'.
"The only negative side effect this can have is that the AI will have less 'memory', as it will have less chat history available to process."
docs.sillytavern.app, retrieved
- Receipt 19Reviewer
SillyTavern says the model is more likely to pick up style and length from the character's first message than anything else.
"The model is more likely to pick up the style and length constraints from the first message than anything else, so it's important to write it in a way that you want the responses to be"
docs.sillytavern.app, retrieved
- Receipt 20Reviewer
The Examples of dialogue field describes how the character speaks; example blocks are inserted only if there is free context space and are pushed out block by block.
"Describes how the character speaks. Before each example, you need to add the <START> tag. The blocks of example dialogue are only inserted if there is free space in the context for them and are pushed out of context block by block."
docs.sillytavern.app, retrieved
- Receipt 21Reviewer
SillyTavern's Character's Note is an in-chat injection at a fixed depth, usually used to reinforce character traits regardless of how far the chat has progressed.
"It is usually used to reinforce certain character traits, as it always stays at a static depth in the chat history, regardless of its progression."
docs.sillytavern.app, retrieved
- Receipt 22Reviewer
SillyTavern's docs list character name, description, personality and scenario as permanent tokens sent with every generation request.
"These will always be sent to the AI with every generation request:"
docs.sillytavern.app, retrieved
- Receipt 23Reviewer
Anthropic's engineering blog says as tokens in the context window increase, the model's ability to accurately recall information from it decreases (context rot).
"as the number of tokens in the context window increases, the model's ability to accurately recall information from that context decreases."
www.anthropic.com, retrieved
- Receipt 24Reviewer
Anthropic says context must be treated as a finite resource with diminishing marginal returns, and that this degradation appears across all models.
"this characteristic emerges across all models. Context, therefore, must be treated as a finite resource with diminishing marginal returns."
www.anthropic.com, retrieved
- Receipt 25Reviewer
Anthropic recommends finding the smallest possible set of high-signal tokens that maximize the chance of the desired outcome.
"good context engineering means finding the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome"
www.anthropic.com, retrieved
- Receipt 26Reviewer
Anthropic's API pricing lists Claude Sonnet 5.5 at $2 per million input tokens and $10 per million output tokens.
"Claude Sonnet 5.5 The best combination of speed and intelligence | $2 / MTok | $10 / MTok"
platform.claude.com, retrieved
- Receipt 27Reviewer
Anthropic's prompt caching reuses previously processed parts of a prompt, like conversation history, reading them at a fraction of the standard input price instead of reprocessing them every request.
"Instead of reprocessing the same large system prompt, document, or conversation history on every request, the API reads from cache at a fraction of the standard input price."
platform.claude.com, retrieved
- Receipt 28Reviewer
Claude Haiku 5.5 costs $0.10 per million input tokens for prompts up to 100,000 tokens and $0.50 per million for prompts over 100,000 tokens.
"$0.10 / MTok for prompts up to 100,000 tokens"
platform.claude.com, retrieved
- Receipt 29Reviewer
Chroma's Context Rot report evaluated 18 LLMs, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, and found performance grows increasingly unreliable as input length grows.
"we evaluate 18 LLMs, including the state-of-the-art GPT-4.1, Claude 4, Gemini 2.5, and Qwen3 models. Our results reveal that models do not use their context uniformly; instead, their performance grows increasingly unreliable as input length grows."
research.trychroma.com, retrieved
- Receipt 30Reviewer
Chroma found that across all its experiments, model performance consistently degraded with increasing input length.
"Across all experiments, model performance consistently degrades with increasing input length."
research.trychroma.com, retrieved
- Receipt 31Reviewer
Chroma notes near-perfect Needle in a Haystack scores lead people to assume long-context performance is uniform, but that test is a simple retrieval task.
"Because these models achieve near-perfect scores on widely adopted benchmarks like Needle in a Haystack (NIAH) [ 1 ], it's often assumed that their performance is uniform across long-context tasks."
research.trychroma.com, retrieved
- Receipt 32Reviewer
Chroma found distractors, content topically related to the needle that doesn't answer the question, have a non-uniform impact that grows more prominent as input length increases.
"We see this impact more prominently as input length increases, and observe distinctions in how various models respond to them."
research.trychroma.com, retrieved
- Receipt 33Reviewer
SillyTavern's Author's Note inserts text into the prompt at any position and frequency; the closer to the bottom of the prompt, the more impact on the next response.
"The closer the Author's Note is to the bottom of the prompt, the more impact it has on the next AI response."
docs.sillytavern.app, retrieved
- Receipt 34Reviewer
SillyTavern's docs give Author's Note examples for steering response style and length, such as setting a response length or a writing style.
"[Your next response must be 300 tokens in length.]"
docs.sillytavern.app, retrieved
- Receipt 35Reviewer
The Author's Note can act as temporary World Info, for example stating where a character is right now.
"As temporary World Info, Character Bias, or Instruct for non-Instruct models"
docs.sillytavern.app, retrieved
- Receipt 36Reviewer
The New York Times (April 4, 2026) reports role-playing chatbot apps are used by tens of millions of people, with engagement times rivaling or surpassing TikTok, per Sensor Tower.
"Apps that feature role-playing chatbots are used by tens of millions of people, with engagement times that rival or surpass those of social media behemoths such as TikTok, according to market intelligence firm Sensor Tower."
www.nytimes.com, retrieved
- Receipt 37Reviewer
The NYT reports Character.AI settled lawsuits from parents and, in October, barred people under 18 from using its chatbots.
"The company settled those lawsuits, and, in October, barred people under 18 from using its chatbots."
www.nytimes.com, retrieved
- Receipt 38Reviewer
The NYT reports chatbot companies like Character.AI reserve the right to use bot conversations for AI training, personalization and ad targeting.
"chatbot companies like Character.AI reserve the right to use interactions with their bots for A.I. training, personalization and to tailor ads to users."
www.nytimes.com, retrieved
- Receipt 39Reviewer
NovelAI describes its Lorebook as a repository of supplemental information added to the AI's context as each entry comes up in the story.
"You can think of the Lorebook as a repository for supplemental information that's added to the AI's context as each entry comes up in your story."
docs.novelai.net, retrieved
- Receipt 40Reviewer
In NovelAI, each Lorebook entry has activation keys; when a key appears in the recent context, the entry's text is inserted.
"Each entry has its own activation key(s), and when an activation key is found in the recent context, the entry's text gets inserted into the context."
docs.novelai.net, retrieved
- Receipt 41Reviewer
NovelAI's entry titles aren't visible to the AI, so you should include the title inside the entry text.
"The Entry Title is only for organizational purposes and isn't visible by the AI. For this reason, you should always include the entry's title somewhere inside the entry text itself"
docs.novelai.net, retrieved
- Receipt 42Reviewer
NovelAI's "Always On" option inserts a Lorebook entry into context whether or not its keys appear.
"If Always On is enabled, the entry will always be inserted into the context regardless if their keys are found in the recent story or not."
docs.novelai.net, retrieved
- Receipt 43Reviewer
SillyTavern is a locally installed interface for text generation LLMs, image generation and TTS, and is free and open source.
"SillyTavern (or ST for short) is a locally installed user interface that allows you to interact with text generation LLMs, image generation engines, and TTS voice models."
docs.sillytavern.app, retrieved
- Receipt 44Reviewer
SillyTavern says it will always be free and open-sourced.
"will always be free and open-sourced"
docs.sillytavern.app, retrieved
- Receipt 45Reviewer
SillyTavern is only an interface; you need an LLM backend such as AI Horde, an OpenAI-compatible API or KoboldAI.
"Since SillyTavern is only an interface, you will need access to an LLM backend to provide inference."
docs.sillytavern.app, retrieved
- Receipt 46Reviewer
SillyTavern defines a character card as a collection of prompts that set the LLM's behavior, similar to ChatGPT's GPTs or Poe's bots.
"A character card is a collection of prompts that set the behavior of the LLM and is required to have persistent conversations in SillyTavern. They function similarly to ChatGPT's GPTs or Poe's bots."
docs.sillytavern.app, retrieved
- Receipt 47Reviewer
Character.ai announced no more open-ended chat for under-18 users, rolling out from November 24th, with chat time limited starting at 2 hours per day during the transition.
"No more open-ended chat for under-18 users This change will begin rolling out on November 24th."
support.character.ai, retrieved
- Receipt 48Reviewer
Character.ai says it uses an in-house age assurance model combined with third-party tools including Persona.
"We have built an age assurance model in-house and will be combining it with leading third-party tools, including Persona."
support.character.ai, retrieved
Questions people ask
What is the best AI to use for roleplay?
The best choice is a model you can afford to run with lean context, because no model holds a long chat on its own. One report tested 18 models from four major labs and found performance degraded as input length grew in every experiment. Separate research found models miss information buried in the middle of long inputs. How you manage memory decides more than which model you pick.
What is a lorebook in AI roleplay?
A lorebook is a set of lore entries that the tool adds to the AI's context only when the entry's keywords come up in the chat. In SillyTavern it is called World Info, and the docs compare it to a dynamic dictionary. Each entry should be a short, standalone description, because the keywords and titles themselves are not inserted.
How do I stop the AI from forgetting the story?
Summarize at natural breaks and start fresh chats from the summaries. SillyTavern's Summarize extension generates and stores summaries of chat events, and its docs suggest making the first one when messages start dropping out of the prompt. Those docs also warn that generated summaries can lose details or invent them, so read and correct each one.
Is it okay to use AI for roleplaying?
It is common, but read the app's data and age terms first. A newspaper report puts role-playing chatbot use at tens of millions of people. The same report says companies in the category reserve the right to use conversations for AI training, personalization and ad targeting. It also says one character chat app barred users under 18 after settling lawsuits from parents. That app announced an end to open-ended chat for under-18 users, with daily chat time capped from 2 hours during the transition, and says it checks age with an in-house model plus third-party tools.
Slop check: passedThis page went through our slop counter before publishing. How we check our own copy
