Lorebook & World Book Setup: Keep Your AI Roleplay Consistent
A hands-on guide to lorebooks — also called world books, Weltbuch, or livre de lore — covering keywords, entry structure, ordering, and maintenance for long AI roleplay stories.
7 min read

Every long AI roleplay hits the same wall. Around the fortieth or fiftieth message, the character forgets the name of the town, the colour of her coat, or the fact that you've already met her brother. The model hasn't become dumber; the old details simply scrolled out of its short-term memory. A lorebook — also called a world book, a Weltbuch in German, or a livre de lore in French — is how you fix that.
This guide explains how lorebooks work, how to write entries that trigger reliably, and how to maintain them as your story grows.
Ourdream Chat is an independent guide. "Start" links are affiliate links; we may earn a commission.
What is a lorebook and how does it work?
A lorebook is a collection of short entries, each linked to keywords. When one of those keywords appears in recent messages, the app inserts the matching entry into the model's context behind the scenes. The model "remembers" the fact without you repeating it, and entries that aren't relevant stay out of the way.

The mechanism in four steps:
- You write an entry: "Pastelaria Aurora — a tiny blue-tiled café in Lisbon where you and Inês first met. She always orders a galão."
- You attach keywords:
café,Aurora,first met. - In chat you type: "Want to go back to the café tomorrow?"
- The app sees
café, adds the entry to the model's context, and Inês replies knowing exactly which café you mean.
How is a lorebook different from chat memory?
Chat memory is the recent conversation the model can see directly, and it's limited. A lorebook is permanent: entries never scroll away and only load when relevant. Many apps also have automatic memory summaries, but a lorebook gives you precise control over what is remembered and how it's worded.
Think of three layers working together:
| Layer | Always present? | You control wording? | Best for |
|---|---|---|---|
| Character card | Yes | Yes | Identity, personality, voice |
| Lorebook | Only when triggered | Yes | Places, people, events, rules |
| Recent chat | Yes, but limited | No | The current scene |
How do I write a good lorebook entry?
Write one topic per entry in two to four plain sentences, under about 80 words. State facts directly, in third person, using the same names the chat uses. Include one sensory or behavioural detail so the model has something vivid to draw on. Avoid stories and dialogue inside entries.
A weak entry:
Her brother is nice and they have a complicated relationship and he lives somewhere and they talk sometimes, and there was that thing that happened at the wedding.
A strong entry:
Tomás — Inês's older brother, a ferry engineer in Porto. Protective but awkward; teases her about her photography. They argued at a cousin's wedding last summer and haven't fully made up.
The strong entry is shorter, specific, and gives the model a clear dynamic to play.
Which keywords should I choose?
Use the names and words people will actually type: proper names, nicknames, places, and a couple of natural synonyms. Avoid very common words like "home" or "work" unless the entry truly applies every time. Too-broad keywords trigger constantly and waste context; too-narrow ones never trigger.
Keyword tips:
- Include variants:
Tomás,Tomas,her brother. - Add the plural or casual form:
café,cafe,coffee shop. - For multilingual chats, add the other language's word too —
Weltbuchusers might typeBruderas well asbrother. - Test by mentioning the keyword and seeing whether the reply reflects the entry.
What should go in my first lorebook?
Start with five to ten entries: the character's background, what she knows about you, how you met, one or two key places, one important side character, a running joke, and any world rules. That small set solves most consistency problems in a one-on-one companion story.
Starter template:
- Her background — hometown, family, one formative memory.
- You — the nickname she uses, what she knows about your job or life.
- How you met — two sentences.
- Key place #1 — where you usually "are."
- Key place #2 — somewhere meaningful.
- Side character — friend, sibling, rival.
- Running joke — and how she brings it up.
- World rules — for fantasy or sci-fi: how magic or technology works.
How do I organize a lorebook for a big world?
Group entries by type — people, places, factions, history, rules — and give the most important ones higher priority if your app supports it. Keep entries independent so any one can load alone. Review and prune monthly, merging duplicates and deleting facts that no longer matter to the story.
For group scenes or multi-character stories, give each named character their own entry, and add a short "relationships" entry that summarises who likes whom. Larger "Genius"-style models handle big lorebooks better because they have more room in context, but good organisation helps every model.
What does a full example lorebook look like?
Here's a compact eight-entry lorebook for a realistic companion named Inês, a photographer in Lisbon. Each entry is short, specific, and keyed to words you'd naturally type. You can copy the structure for any character and simply swap in your own names, places, and history.
- Inês (background) — Keywords: Inês, childhood, Porto. Grew up in Porto above her grandmother's bakery. Moved to Lisbon at 21 to study photography. Still calls her grandmother every Sunday.
- You — Keywords: your nickname, work. She calls you "Sleepyhead" because you're always late. She knows you work in software and hate early meetings.
- How you met — Keywords: met, first date. You met when she photographed you by accident at a tram stop and chased you down to ask permission to keep the shot.
- Pastelaria Aurora — Keywords: café, Aurora, coffee. Tiny blue-tiled café in Alfama. Her usual is a galão; she teases you for adding three sugars.
- Her apartment — Keywords: apartment, home, darkroom. Top-floor flat with a cramped darkroom in the bathroom and a balcony covered in plants she forgets to water.
- Tomás — Keywords: Tomás, Tomas, brother. Her older brother, a ferry engineer in Porto. Protective but awkward; they argued at a cousin's wedding and haven't fully made up.
- The tram photo — Keywords: photo, tram, exhibition. The photo she took when you met is going into her first small gallery exhibition next month. She's nervous about it.
- Running joke — Keywords: sugar, sweet. Whenever sugar comes up, she pretends to count your teaspoons out loud.
Notice how entries 3 and 7 connect: the tram photo is both your origin story and an upcoming plot point. Lorebooks work best when entries reference each other lightly, giving the model threads it can weave together.
How do I keep a lorebook up to date as the story grows?
After each major story beat, add or edit one entry so the lorebook reflects what happened. Delete or rewrite entries that are no longer true. A monthly ten-minute review — merging duplicates, trimming long entries, and fixing contradictions — keeps even a large world book fast and reliable.
A simple maintenance routine:
- After big moments: add a one-line entry ("The exhibition opened; she sold two prints").
- When facts change: edit the old entry instead of adding a contradicting new one.
- Monthly: search for duplicate keywords and merge entries that overlap.
- When things feel off: read the entries for the current scene's keywords and look for outdated details.
Why isn't my lorebook entry triggering?
Usually the keyword doesn't match what was typed, the entry is disabled, or too many entries fired at once and lower-priority ones were dropped. Check spelling and variants, confirm the entry is active, and shorten other entries so there's room in context for the one you need.
Troubleshooting checklist:
- Keyword spelled exactly as typed (including accents)
- Variants and plurals added
- Entry enabled
- Entry under about 80 words
- Not competing with dozens of other entries on the same keyword
- Contradictions between card and lorebook removed
Does a lorebook work in other languages?
Yes. Lorebooks work in any language the model understands, including French, German, and Traditional Chinese. Write entries in the language you chat in, and add keywords in every language you might type. A French player can call it a livre de lore and a German player a Weltbuch; the feature is identical.
If you chat in French, read our guide to a petite amie IA. German readers can see KI-Freundin vs. Chatbot.
What's the fastest way to start?
Open your companion's lorebook, write five entries using the template above, and attach two or three keywords to each. Chat normally and watch for moments where she forgets something; each one is a cue for a new entry. Within a week you'll have a world that holds together.
For character fundamentals, pair this with AI character card basics. For the complete beginner path, see how to create an AI girlfriend and our guide. A small, tidy lorebook is the difference between a chatbot and a story that remembers itself.
Frequently asked questions
What is a lorebook in AI chat?
A lorebook is a set of short entries, each tied to keywords. When a keyword appears in the conversation, the app quietly adds that entry to the model's context. It keeps names, places, and history consistent over long roleplay without making the character card huge.
What is a Weltbuch?
Weltbuch is the German term German-speaking roleplayers use for a world book or lorebook. It works exactly the same way: keyword-triggered entries that remind the AI about characters, places, and events in your story.
What is a livre de lore?
Livre de lore, or simply lorebook, is how French-speaking users describe the same feature. It stores facts about your story world and injects them into the AI's memory when related words come up in the conversation.
How many lorebook entries should I have?
Start with five to ten entries for a single companion and grow to a few dozen for a large world. Quality matters more than quantity: short, specific entries with good keywords trigger reliably and use less of the model's context.
Does a lorebook cost extra?
Usually not. Lorebooks are a free feature in most roleplay apps. They do use some of the model's context window, so very large or long entries can slightly reduce how much recent chat the model can see.

