guide

Lorebooks Explained: The Memory Trick Hosted Apps Don't Give You

A lorebook is the closest thing this hobby has to a cheat code: world details that stay out of the prompt until a keyword summons them, so your setting can be enormous without eating the context window. Here's how the mechanism works, how to write entries that fire correctly, and the mistakes that make lorebooks worse than useless.

By Ash Kepler · Jul 24, 2026 · 9 min read

Ask experienced roleplayers what non-negotiable feature keeps them on a particular setup and you'll hear the same word repeatedly: lorebooks. Ask what a lorebook is and most explanations are circular. So here's the plain version, because it's the closest thing this hobby has to a cheat code.

The problem lorebooks solve

Everything in a character card is sent to the AI with every single message. That's why cards work — the personality is always present — and it's also why cards can't hold a world. Write forty paragraphs of political history into a card and you've spent your context window on facts that matter to one scene in fifty, leaving less room for the actual conversation. The model is now expensively well-informed about your kingdom's tax policy and has forgotten what you said ten messages ago.

A lorebook fixes this with one idea: conditional context. Each entry has trigger keywords. When a keyword shows up in conversation, that entry is injected into the prompt for that exchange. When it doesn't, the entry costs you nothing — it's sitting in a file, not in the prompt.

The result is a setting that can be enormous while the prompt stays small. Mention the northern fortress and its details arrive; talk about anything else and they stay out of the way.

How an entry actually works

Two fields carry nearly all the weight.

Keys are the trigger words, comma-separated, and this is where most lorebooks succeed or fail. Good keys are terms that naturally occur in play: a faction name, a place, a character's nickname, a signature object. Bad keys are abstract labels you'd never type mid-scene — an entry keyed to "economic system" will never fire, because nobody says that in a conversation.

Content is what gets injected. Short and specific beats long and atmospheric: a few sentences of concrete fact. You're writing a reference card, not prose. Everything you add here is tokens spent every time the entry fires, so density matters.

Two secondary controls become useful once you're comfortable. Insertion order decides which entries land first when several fire at once. Depth decides where the injected text sits relative to recent conversation — closer to the current exchange means more influence over the immediate reply, further back means quieter background presence. Defaults are fine at the start; adjust only when something isn't behaving.

The organizing principle: identity vs. world

The cleanest rule for deciding what goes where:

The card holds what's always true — who they are, how they speak, what they'd never do, where your relationship stands. The five-field method is exactly this, and it should stay lean.

The lorebook holds what's sometimes relevant — places, factions, history, side characters, rules of magic, past events, recurring in-jokes, anything that matters in some scenes and not others.

Most bloated character cards are lorebooks that haven't been separated yet. Splitting them typically improves both: the character gets sharper because their identity isn't buried in geography, and the world gets deeper because it's no longer competing for permanent space.

Building your first one (the boring, correct method)

Create one book. Add three to five entries. Test each one in chat before adding more.

That's genuinely the whole recommendation, and it's the step people skip. Testing means mentioning the keyword naturally and confirming the entry fired and the reply reflects it. An untested lorebook is a folder of assumptions — half the entries never trigger and you spend weeks wondering why the world feels thin.

Once the first few work, grow by splitting along purpose rather than piling into one book: a global "world bible" for setting rules that apply everywhere, a character-bound book for one companion's personal history, a chat-bound book for a single story arc. Keeping them separate means unrelated entries don't fire every turn, which is the most common way lorebooks quietly degrade a chat — twelve entries triggering at once turns a scene into an encyclopedia recital.

Many community character cards arrive with lore already embedded; import it, bind it, then edit it down to what you actually use.

The four mistakes

Keys nobody says. The number one failure. Trigger on words that occur in play.

Essays instead of facts. Every fired entry is tokens taken from the conversation. Three sentences that a model can act on beat three paragraphs it has to summarize.

Everything in one book. Unrelated entries firing together crowds the prompt and flattens the scene. Split by purpose.

Lore that should have been in the card. If it's true in every scene, it belongs in the card — a lorebook entry that fires constantly is just a card entry with extra steps.

Where you can actually do this

Full lorebook support lives in the open ecosystemSillyTavern is the reference implementation, with global, character-bound, and chat-bound books that combine. Some hosted platforms offer simplified versions under names like world info, memory entries, or story notes; useful, usually shallower.

Most mainstream companion apps have nothing equivalent, and that's not an oversight — conditional context is engineering work with no upside for a product optimized around a single ongoing relationship. It's precisely why long-form worldbuilders keep drifting toward self-hosted setups even when they liked the app they were on.

If you're staying hosted, the closest substitute is disciplined use of the relationship summary habit — a manually maintained digest you re-paste when the model drifts. It's a lorebook operated by hand, and it works better than nothing by a wide margin.

But if you've ever wanted a world that stays consistent across a hundred sessions without strangling your context window, this is the feature you were missing — and it's free, in software you can install this evening.

questions

Frequently asked

A collection of world-information entries, each attached to trigger keywords. When a keyword appears in conversation, that entry is injected into the prompt automatically; when it doesn't, the entry costs nothing. It lets you maintain a large, detailed setting without permanently occupying the context window — background detail that appears exactly when it's relevant.