← Blog

What Is a Lorebook? The AI Roleplay Tool, Explained

A lorebook is how AI roleplayers make a model remember a world too big for its memory. What lorebooks are, how keywords and token budgets actually work, where to find them (SillyTavern, NovelAI, AI Dungeon, Janitor AI, Character.AI), and how to write entries that fire when they should.

Ty on his sticker beside the words "What is a lorebook?", on navy.

If you've spent any time in AI roleplay communities, you've seen someone say "just put it in the lorebook." Here's what that means, why it works, and how to write one that doesn't quietly waste half your context.

One thing worth saying up front: a lorebook is homework. Almost every roleplay platform relies on you to write one and keep it up to date, because that's how their characters stay consistent. We're building Pocket Femboy so you don't have to. The remembering happens on its own and you just get to roleplay. More on how at the end, but first, the tool itself.

The short answer

A lorebook is a list of facts about a story — people, places, factions, items, history — where each fact has keywords attached. When one of those keywords comes up in the conversation, the app slips that fact into what the AI can see for its next reply. When it stops coming up, the fact drops back out.

It's a way of giving the AI a world far bigger than it can hold in its head at once, by only showing it the part of the world the scene is currently about.

Different apps call it different things. World Info (SillyTavern, KoboldAI, and AI Dungeon's original name), Lorebook (NovelAI, Janitor AI, Chub, Character.AI), Story Cards (AI Dungeon today), and Characterbook or character book when it's attached to a single character. They're all the same idea.

Why they exist: the context window

A language model doesn't remember your chat the way you do. Every time it replies, the app sends it a block of text: the character's description, some instructions, and as much of the recent conversation as fits. That block is the context, and it has a fixed size, measured in tokens (a token is roughly three-quarters of a word).

Once a roleplay outgrows the context, the oldest messages fall off the back. That's why a character forgets your name, or the town you're in, or the thing that happened in chapter one. The model isn't being careless. It literally can't see it anymore.

You could stuff every fact about your world into the character description so it's always there. But that eats context you need for the actual conversation, and most of it is irrelevant most of the time. You don't need the history of the northern kingdom while two characters are arguing over breakfast.

A lorebook solves this by making the world info conditional: always available, but only loaded when it's relevant.

How a lorebook actually works

The details vary by app, but the moving parts are nearly always the same.

Entries. Each entry is a short block of text about one thing: Mira is the captain of the harbour guard. She is blunt, forty, and owes the protagonist a favour.

Keys. The words that trigger an entry, like Mira, captain, harbour guard. Most apps match them without caring about capital letters, and most let power users write regex patterns instead.

Scan depth. How far back the app looks for keys. A depth of 1 means only the latest message counts. A higher depth means a name mentioned four messages ago still keeps the entry loaded.

Token budget. The maximum share of the context the lorebook is allowed to take up. When more entries trigger than will fit, something has to give, and that's decided by…

Order or priority. Which entries go in first, and which get cut when you're over budget. In some apps it also decides where in the context an entry sits, which matters: text placed closer to the end of the context usually has more influence on the reply.

Constant entries. Entries with no keys that are always included. Good for the one or two facts that must never be forgotten, like the setting's era or the rule that magic is illegal. Bad for everything else, because they cost context every single turn.

Two more advanced tricks show up in the more serious tools:

  • Secondary keys. An entry fires only when a main key and another word appear (or when a main key appears without one). So Mira plus uniform could load her guard-duty entry, while Mira plus tavern loads her off-duty one.
  • Recursion. One entry's text can trigger other entries. Mention the harbour, and the harbour entry mentions Mira, which loads Mira.

Where you'll find lorebooks

SillyTavern has the most complete system, called World Info. Books can be global, bound to a character, bound to a single chat, or bound to your persona. It supports secondary-key logic, recursion, a trigger probability, inclusion groups (only one entry in a group fires) and timed effects such as sticky and cooldown. If a lorebook feature exists anywhere, SillyTavern probably has it.

NovelAI popularised the word "Lorebook." Entries can be sorted into categories with shared settings, and each entry can carry a phrase bias, which nudges the model towards or away from specific words while the entry is active. The search range is measured in characters, up to 10,000.

AI Dungeon calls them Story Cards (formerly World Info). Each card has triggers, and the AI sees only the card's entry text. AI Dungeon also has a separate Memory Bank, which automatically summarises what's happened and recalls it by similarity rather than keywords. The size of that bank depends on your subscription tier.

Janitor AI has lorebooks under Scripts. A basic Lorebook script is keyword entries, and Advanced Scripts let creators write JavaScript that changes a character's behaviour on conditions. You can paste SillyTavern lorebook entries in.

Chub calls a lorebook attached to a character a Characterbook, and supports the usual scan depth, budget, secondary keys, priority and recursion.

Character.AI added a Lorebook in July 2026, which its own blog called the most requested feature from its community. Entries are keyword-triggered and can be shared across a creator's characters, and characters using one get a "+Lore" tag. It's in beta, and creating lorebooks needs c.ai+.

There's also a shared file format. The Character Card V2 spec — the format most character cards move between apps in — has a character_book field, so a lorebook can travel inside the card itself.

Where the name came from

The idea is older than the word. AI Dungeon, launched in 2019, had World Info well before the term "lorebook" caught on, with entries capped at 500 characters and matched by simple text search. KoboldAI and later SillyTavern kept the World Info name. NovelAI, which launched in beta in June 2021, called its version a Lorebook, and that's the word most of the community uses now.

(If you searched "lorebook" and were expecting Dungeons & Dragons, you're thinking of the Heroes' Lorebook and Villains' Lorebook supplements for the Forgotten Realms. Different thing, excellent books.)

How to write a good lorebook

Almost every platform's own documentation gives the same advice, and it's the advice people ignore most often.

Make each entry stand on its own. The AI never sees the entry's title or its keys, only the text. So write Mira, captain of the harbour guard, is…, not She is….

Keep entries short. KoboldAI's guidance is roughly 50 tokens for a minor entry, around 100 for an important character, and under 150 for a major part of the setting. Lead with the most important fact. Skip long physical descriptions, which cost a lot and change very little.

Choose keys carefully. A key that's too common, like sword in a fantasy story, fires constantly and burns your budget. A key that's too narrow never fires. Names are the safest keys. A shortened stem (boat) also catches plurals (boats). Don't key an entry to something mentioned in nearly every message, like your own character's name, or it may as well be a constant entry.

Use constant entries sparingly. One or two, for things that must always be true.

Test that it fires. Most tools have a way to see the context the AI actually received — AI Dungeon's Context Viewer, SillyTavern's prompt inspector. Check that your entry shows up when it should and not when it shouldn't.

Link entries together. If your app supports recursion, mention related names inside entries, so the harbour pulls in its captain and the captain pulls in her rival.

A good small lorebook beats a huge bad one. Twenty tight entries with good keys will do more than two hundred paragraphs that fight over the budget.

What lorebooks can't do

A lorebook is for things that are true about the world. It's much weaker for things that change.

If Mira is angry with you because of something that happened last night, the lorebook still says she owes you a favour, unless you go and edit it. If your character got a job, moved house or fell out with a friend, someone has to write that down. In practice that someone is you, which is why long roleplays turn into part-time lorebook maintenance, and why summaries, memory notes and pinned messages exist alongside lorebooks in most apps.

That's not a flaw in the tool. Lorebooks were built to hold a setting, and they're very good at it.

How we handle it

We make an app, so here's where we come at this from.

Pocket Femboy is a small cast of original femboys with lives of their own — jobs, friends, routines, and things that happen to them while you're away. We built it around the problem lorebooks work around. There's no lorebook to write and no context meter to watch.

Keeping a character consistent is our job, not yours. What they learn about you, what's happened between you, and what's going on in their life are stored separately from the chat and kept up to date automatically, so none of it falls out of the context window. If you mention a new job, they remember it without you writing an entry. If something changes in their week, it's changed. Every conversation keeps its own memory, so a story you start with one character doesn't bleed into another. And if you want to see what they've remembered, you can, and tell them to forget anything you'd rather they didn't.

It's a different trade-off, not a better lorebook. You can't hand-build a sprawling fantasy world in it, and if that's what you love, SillyTavern or NovelAI will serve you far better. We're for the other case: one character you keep coming back to, who remembers you without homework. Jax is the first, a record-shop punk who takes some winning over.

Pocket Femboy hasn't launched yet. It's 18+ at the door — that's about who we let in, not about what's inside — and there's no explicit content on any tier.

Coming soon to iPhone and Android. Join the waitlist and we'll let you know when they're ready to text you.

More reading

The fine print

Feature details come from each platform's own documentation and announcements, checked on 28 September 2026. These tools change often, and settings get renamed. If something here is out of date, tell us at support@pocketfemboy.com and we'll fix it.

Keep reading

Waitlist

Pick your femboy, or make your own. He's cute, he's flirty, he texts you, and he remembers what you tell him.

You're on the waitlist!

18+ only. AI characters, not real people. Launching soon on iPhone and Android.

Jax

Pocket Femboy is coming soon

They aren't out in the world quite yet. Join the waitlist and we'll email you the moment they are.

You're on the waitlist!