What Is a Lorebook? How World Notes Work in AI Roleplay
What is a lorebook? It's a collection of short notes about the world of your story: places, factions, side characters and rules. In an AI chat, a keyword such as "Salt Guild" can bring the matching note into the text the AI reads before it replies. That way you don't have to cram every faction's history into the character description.
Key takeaways
- A lorebook is a list of entries. A typical entry has keywords and a short text. When a keyword appears in recent messages, the entry becomes a candidate, and the app's settings decide whether it's included in the AI's context.
- Names differ by app: World Info in SillyTavern, Lorebook in NovelAI and Character.AI, Story Cards in AI Dungeon, lorebook scripts on Janitor AI. The core idea is similar; the settings aren't.
- Write one topic per entry, put the name inside the text, and use distinctive keys. A broad key like "sea" can match scenes that have nothing to do with the note.
- Even if the app includes an entry, the AI may not use it. If the outcome depends on a fact, mention it in your message too.
- No lorebook in your app? Put the core of the world in the character description and paste other notes as an out-of-character message when the story reaches them.
Contents
What is a lorebook?
A lorebook is a collection of short entries about the world your story takes place in: towns, factions, side characters, magic, laws, history. A typical entry has one or more keywords. When the app spots a keyword in the recent chat, it can add the entry's text to the context, the text the AI reads before writing its reply. Mention the Salt Guild, and the AI may get a few lines about the Salt Guild. Don't mention it, and those lines usually stay out of the way.
Why not just paste the whole world into the character description? The AI can read only a limited amount of text at once. That limit is its context window. When the context fills up, an app may leave out earlier messages, and thirty paragraphs of background leave less room for the conversation itself, even though the current scene uses a fraction of them. A lorebook keeps world details on the shelf and brings out the ones the scene calls for.
The word "lorebook" is used across apps, but the features aren't identical:
| App | What it's called | Worth knowing |
|---|---|---|
| SillyTavern | World Info, lorebooks | Scan depth, token budget, many activation options |
| NovelAI | Lorebook | Entry titles aren't shown to the AI |
| AI Dungeon | Story Cards (formerly World Info) | Triggered by your inputs and by AI outputs |
| Character.AI | Lorebook | Launched in beta, c.ai+ first (July 2026) |
| Janitor AI | Lorebook scripts | You and the character can trigger entries |
A lorebook can also travel inside a character card: the Character Card V2 format has an optional character_book field, so world entries can move along with the character if the new app supports it.
Before organizing entries, distinguish the lore of a world from the events of the scene you are about to play.
How does a lorebook work?
Before each AI reply, the app looks through recent messages for the keywords of your entries. A match makes an entry a candidate. Then the app's settings decide whether it's included and where it goes.
SillyTavern's World Info shows how much control an app can give you. Other apps use different settings, and some expose only a few of these:
- Scan depth. How many recent messages are searched for keys. In SillyTavern, a depth of 1 means only the last message is scanned. A deeper scan keeps a mention eligible for longer.
- Budget. How much of the context entries may use. SillyTavern's docs say that once the budget is used up, no more entries are activated, even if their keys are present.
- Always-on entries. Entries that don't need keywords at all: "constant" in SillyTavern, "Always On" in NovelAI. Save them for the one or two rules your world can't work without, because they take space whenever they're included.
- Order and position. When several entries fire, SillyTavern decides which come first and where they're inserted: before the character definition, after it, or at a set depth in the chat. Its docs note that entries closer to the end of the context tend to have more influence on the reply.
- Recursion. If it's on, the text of one entry can contain another entry's keyword and pull it in too. Handy for linked lore, and an easy way to burn through the budget.
- Secondary keys. You can add extra conditions: include the lighthouse entry only if "Carrow" also appears, or only if "north cape" doesn't.
- Probability. SillyTavern's Trigger % setting decides how often an activated entry is actually inserted. At 100, it's inserted every time.
Who can trigger an entry? That depends on the app too. AI Dungeon's help says Story Cards respond to both your inputs and the AI's outputs. Janitor AI's help says both you and the character can trigger entries, and that setting the depth to 1 limits scanning to your most recent message.
One more thing the docs are honest about: an included entry isn't a promise. SillyTavern's documentation says activation doesn't guarantee the content will show up in the reply. A separate study of long-context tasks, Lost in the Middle, found that where information sits in a long context can affect how well models use it. If the outcome depends on a fact, say it in your message as well.
What does a lorebook entry look like?
An entry usually has three parts: a title for you, keys for the app and a note for the AI. NovelAI's docs make a point worth copying everywhere: the entry title isn't visible to the AI, so the name of the thing should be in the note itself. If you don't have a world yet, start with how to create a fantasy world.
Here's a small lorebook for an example world, the tidal island of Carrow. Use these as writing examples, not as an import file: field names and formats differ between apps.
Carrow
Keys: Carrow
Text: Carrow is a small island joined to the mainland by a stone causeway. Twice a day the tide covers the causeway; the rest of the time you can walk across. The village lives by the tide tables.
The Wardens
Keys: Warden, Wardens, tide tables
Text: The Wardens keep Carrow's tide tables and ring the causeway bell before high water. They are strict and keep their word. They don't trust the Salvagers.
The Salvagers
Keys: Salvager, Salvagers
Text: The Salvagers collect what the sea leaves on the causeway and sell it on the mainland. They want the causeway open longer and think the Wardens ring the bell too early.
The tide's claim
Keys: tide's claim, left on the causeway
Text: The tide's claim: anything left on the causeway at high water belongs to the sea. The sea returns it on the same night a year later, a little changed.
Maren Holt
Keys: Maren, Holt, head Warden
Text: Maren Holt, 51, is Carrow's head Warden. She speaks in short, practical sentences. She knows tonight's tide didn't fail by itself. She never stands on the causeway after the bell.
Each note is a few plain facts: what it is, what it wants, how it shows up in a scene. Now see a key at work. In "Who keeps the tide tables here?", the words tide tables match the Wardens entry. In an app using these entries, that makes the Wardens note a candidate for the next reply. The opener below contains the question, not the note, so paste the Wardens fact too if you want it in the scene.
How do you write good lorebook entries and keys?
Start with these five writing choices. They work whatever your app calls the feature:
- One topic per entry. The village, a faction and a side character each get their own entry. Then the AI gets only what the scene needs.
- Name first. Start the note with the name: "Maren Holt, 51, is Carrow's head Warden…" The entry then makes sense on its own, whatever the app does with titles.
- Facts, not prose. Two to five short sentences. AI Dungeon's help recommends putting the most important details near the beginning or end of an entry.
- No contradictions. If the character description says the tide comes in twice a day and an entry says once, the replies start to wobble. When the world changes, update the entry.
- Distinctive keys. Names of places, groups and people work best: "Carrow," "Salvagers," "Maren." A broad key such as "sea" can match scenes that have nothing to do with the Salvagers. Use "Salvagers" if that's who the note is about.
Watch word forms. With SillyTavern's "match whole words" option on, a single-word key fires only when the entire word is present, so "Warden" won't match "Wardens." List the forms that will really come up, or check whether your app supports partial matches or regular expressions. Nicknames count too: if the islanders call Maren "the old Warden," add that.
Test each key. Send a line that contains it. If your app shows which entries were included, check that first. Otherwise, ask about a distinctive fact from the entry, and treat the answer as a clue, not proof.
Building your own world from scratch? Start with one rule: write a narrator description for Carrow. Keep the other world notes in a separate document.
Lorebook vs character definition vs memory: what goes where?
The character definition, the lorebook and memory all feed the AI, but a useful split looks like this: stable character traits in the definition, occasional world facts in entries, and recent events in a recap or the app's memory.
| What it is | Where it goes | Carrow example |
|---|---|---|
| Needed in every scene | Character definition | "You narrate the island of Carrow; the tide rules daily life." |
| A rule that always applies | Always-on entry or definition | "Anything left on the causeway at high water belongs to the sea." |
| Needed sometimes | Regular lorebook entry | The Salvagers, an old shipwreck, a side character |
| Changes as you play | Recap or memory | "Maren lent us her tide tables; the Salvagers are watching us." |
| Voice and personality | Character definition | How the narrator talks, example lines |
Don't hide the main character's personality in a lorebook. A keyword-triggered entry may be absent on a turn when the character still needs that trait. Personality, voice and example lines belong in the definition: see how to write an AI character or start from a character definition template.
When a fact about the world changes, say Maren goes from ally to rival, update her entry. Keep the chain of events in a running recap, like the campaign log in our AI dungeon master guide.
Why didn't my lorebook entry trigger?
Before you rewrite anything, find out whether the entry was included at all. Then go down the list:
- The key never appeared. The word in the chat doesn't match the key: a plural, a nickname, a typo, or case sensitivity is on and the capitalization differs.
- The scan depth is too shallow. The keyword came up three messages ago, but the app scans only the last one.
- A second condition wasn't met. If the entry has secondary keys, check that condition too.
- The budget ran out. Other entries filled the space first. Cut always-on entries and broad keys.
- The wrong lorebook is active. If your app lets you choose a lorebook for a character or chat, check which one is linked.
- A probability setting. In SillyTavern, an entry with a Trigger % below 100 won't be inserted every time.
- It was included, but ignored. The entry made it into the context and the reply still contradicts it. Check that the name is in the note, that it doesn't fight the definition, and repeat the key fact in your message.
If the problem isn't lore but the character itself drifting, the fixes are different: see how to keep an AI in character.
What if your app doesn't have a lorebook?
You can still play in a rich world. You just pick the notes yourself instead of letting the app do it.
- Put the core of the world in the description. The starting place, the current conflict, two or three factions and the main rule fit in a short paragraph or two.
- Keep other notes in a document. When the story reaches the Salvagers' warehouse, paste that note as a short out-of-character message: ((World note: the Salvagers…)). Our guide to OOC in roleplay covers the format.
- Open with the conflict. Drop the reader straight onto the dry causeway, not into a history lesson.
This "manual lorebook" takes a bit more attention, but you choose which note to paste and when. If you need hooks to build a world around, browse these roleplay plot ideas. To play a world like Carrow as an ongoing story, see how AI story roleplay works on aimy.
You can use the description approach on aimy.chat: a long text fits into the character description (with PRO, up to 2,000 characters per field). And the chat opens with a greeting the character writes itself from its description, and creator beta testers with PRO can also write the first message by hand, so open your narrator on the dry causeway.
Free: 100 messages a day and your first AI character of your own.
Bottom line
A lorebook lets an app bring selected world notes into the AI's context. A matching key can get a note considered; it doesn't guarantee the note will be included or followed. Apps call it different things and handle depth, budget and order differently, but good entries look the same everywhere: one topic, the name in the note, a few plain facts and distinctive keys. Keep personality in the character definition and events in a recap. If your app has no lorebook, put the core of the world in the description and bring in the rest by hand.
Start your narrator with one world rule
Looks, personality, voice · one-click sign-in
Free: 100 messages a day and your first AI character of your own
400,000+ sign-ups · 18+
By continuing, you agree to the Terms and Privacy Policy.
Already have an account? Sign in
FAQ
What is a lorebook on Janitor AI?
On Janitor AI, lorebooks are a type of script. Its help center describes lorebook scripts as a kind of smart encyclopedia: each entry has trigger words and text that can be added to the character's context. It says both you and the character can trigger entries, and that a depth of 1 limits scanning to your most recent message.
Is a lorebook the same as World Info?
In practice, yes. SillyTavern calls the feature World Info and also uses the word lorebook for its files. AI Dungeon's Story Cards used to be called World Info too. The idea is the same, but keyword matching, budgets and insertion settings differ from app to app.
Does Character.AI have lorebooks?
Yes. Character.AI introduced Lorebook in beta on July 24, 2026. Its launch post says Lorebook creation and Lore-linked chats were available to c.ai+ subscribers first, that the company planned to expand access over time, and that one Lorebook can link to many characters. Check the app for current availability.
How many lorebook entries do I need?
Fewer than you think. Five to ten short entries is a reasonable start for a new world: the starting place, two or three factions, one or two side characters and the main rule. That's a working guideline, not a platform limit. Add entries when the story actually reaches new places.
Can the AI trigger lorebook entries itself?
It depends on the app and its settings. AI Dungeon's help says Story Cards can be triggered by both player inputs and AI outputs. Janitor AI's help says both you and the character can trigger lorebook entries, unless you limit scanning to your own latest message.
Do lorebooks use tokens?
Yes. Every entry the app includes takes space in the context, like any other text the AI reads. A matching key that doesn't get the entry included costs nothing. Always-on entries take space on every turn they're included, which is why apps like SillyTavern let you set a budget for entries.
Sources
- World Info — SillyTavern Docs
- Lorebook — NovelAI Docs
- What are Story Cards? — AI Dungeon Help Center
- Introducing Lorebook: Build the World Behind Your Characters — Character.AI Blog,
- What are Scripts? A Beginner-Friendly Overview — Janitor AI Help
- Character Card V2 specification — GitHub
- Lost in the Middle: How Language Models Use Long Contexts — arXiv (Liu et al.); published in TACL, 2024,
What changed
- — First version.
What next
What nextHow to Write an AI Character for Chat, With a Full ExampleRelated articles
Characters & stories
What Is an AI Character Card? Fields, Formats and a V2 Example
Learn what an AI character card stores, when SillyTavern uses each field, and why a PNG card can lose its data. Includes a complete V2 JSON example.
Guides
AI Roleplay Memory Summary Template (Copy-Paste Chat Memory Prompts)
Copy a Janitor AI chat memory template, see a filled example and use six prompts to draft, update or shorten your recap. Plus word and token guidance.
Characters & stories
How to Write an AI Character for Chat, With a Full Example
Write an AI chat character with clear reactions, a distinct voice, example dialogue and a greeting. Copy a complete sample card and check it with six lines.