Silly Tavern lorebook guide: World Info, step by step
World Info is lorebook: one mechanism, different labels
When people say lorebook (or 世界书 in Chinese communities) and when SillyTavern says World Info (WI) or memory book, they mean the same pattern: keywords in the conversation activate short text inserts that get merged into the prompt, so the model can use world facts, tone, or instructions on demand instead of keeping everything in the main character description forever.
Products use different names—SillyTavern uses World Info; many sites say lorebook. On Chub.ai, lorebooks attached to a character are called Characterbooks. Different words, same skeleton: triggers + content + scan window + token budget.
First, Chub.ai Lorebooks in brief; then SillyTavern World Info from World Info. For behavior and UI, follow each product’s current documentation.
Silly Tavern 世界书与 Lorebook 实用指南
Not official Silly Tavern or Chub.ai documentation. This site is Sillycard’s notes.
Chub.ai lorebooks (excerpt from their docs)
Summarized from Lorebooks for cross-reference with SillyTavern.
Idea: A lorebook is a set of keywords; when a keyword is activated (mentioned in a message), its content is inserted into the prompt—backstory, setting, environment, etc.—without permanently consuming tokens in the base character definition.
Toy example (same spirit as their docs): keyword Apple, content “{{char}} really loves apples and will do anything to get one”—mentioning apples nudges the model’s behavior. (Macro support differs by platform.)
Characterbooks: lorebooks attached to a character. Standalone lorebooks via Lorebook Creator; character books also inside character creation.
Chat Settings (their terms):
- Scan depth: how many recent messages (from the end of history) are scanned for matches—depth 2 often means your last message and the character’s reply.
- Token budget: cap on how many tokens lorebook text may use; after it is hit, further matches are ignored.
Defaults: case-insensitive matching and whole-word matching—apple / aPPle can match Apple, but Applebottom does not.
Typical entry fields they list: Keywords (most important), Secondary keywords (extra conditions—e.g. both Apple and Banana), Content (what the model actually sees), Insertion order (when multiple entries fire; lower numbers insert earlier and tend to be “noticed” less), Case sensitivity, Priority (what drops first if budget is exceeded), Selective + Selective logic (e.g. NOT: Apple present and Banana absent), Constant (always insert within budget), Probability (chance to insert after trigger). Recursive scanning: entries can wake other entries via text.
Book-level metadata: Title and Description are not sent to the model; entry names are for your organization. A character book may ship its own scan depth / token budget / recursion defaults; Chat Settings values override those when set, otherwise the book defaults apply.
Using a lorebook in chat: import under Chat Settings; for character books, Use V2 Spec. must be on. Flow: pick a book from the lorebook repository, Copy Path (e.g. lorebooks/.../...), paste, confirm.
What you are actually building in SillyTavern
Think of World Info as a dynamic dictionary:
- You write entries with keys (triggers) and content (what gets inserted).
- During a reply, SillyTavern scans recent chat text (and optional extra sources) for those keys.
- Matching entries are activated and folded into the prompt within token budget rules.
World Info guides the model—it does not guarantee the model will quote your lore verbatim. Quality still depends on the model and your main instructions.
Pro tips (per SillyTavern docs):
- Treat WI as general prompt management, not only “character backstory.”
- Anything outside the Content field (titles, keys, memos) is not sent to the model—make each entry’s Content self-contained.
- Entries can chain via recursion when keywords in one entry’s text wake another entry.
- Token budget is real: short, dense entries usually beat walls of text.
For a deeper community encyclopedia, upstream also links **World Info Encyclopedia** (rentry).
Where lore can “attach” (context-specific sources)
Besides a global World Info selector, lorebooks can bind to specific contexts. When that character, persona, or chat is active, those entries participate automatically.
Character lore
- You can bind a primary World Info file to a character (Character Management → globe → pick file → OK).
- Exporting the character can embed that primary file in the character card data.
- Shift-click the globe (or More… → Link World Info) to reassign, add more files, or unbind. Only the primary file is what typically travels with the card export—double-check your build’s behavior in the official doc.
Persona lorebook
- Assign a World Info file to the active persona (Persona Management → Persona Lore).
- Those entries fire whenever that persona is selected, regardless of which character or chat is open.
- If a book is already bound, the button may open the editor; use long-press (mobile) or Shift/Alt-click (desktop) to reopen the assignment popup—per upstream.
Chat lorebook
- Bind a World Info file to one chat (Character Management → Chat Lore).
- Entries apply only in that conversation—not every chat with the same character.
- Same long-press / Shift / Alt-click pattern to reopen assignment when already bound.
Lore insertion strategy (order)
When ST builds a reply, Chat lore → Persona lore → (Character vs global) combine with the global selector. For character vs global, upstream documents three strategies:
- Sorted evenly (default) — merge all sources and sort by Insertion Order as one big list.
- Character lore first — character WI entries first (by order), then global.
- Global lore first — global first, then character.
Pick the strategy that matches how you want franchise-wide vs character-specific facts to stack.
Anatomy of a World Info entry
Keys (triggers)
- A comma-separated list of keywords (plaintext mode) or separate chips (fancy mode). Case-insensitive by default unless you override.
- Regex is supported: valid JavaScript-style patterns with
/…/flags. Regex keys can include commas; plain keys treat comma as a separator—upstream is explicit about that. - Advanced: from v1.12.6, messages in the WI scan buffer can be prefixed in ways that let regex target who said what; see the official examples for
\x01and character names.
Optional filter keys implement AND ANY / AND ALL / NOT ANY / NOT ALL logic on top of the primary key (also regex-capable).
Entry content
The only part that is normally injected into the prompt when the entry fires. Write it so it stands alone.
Insertion order
Numeric priority among co-active entries. Upstream: larger order numbers sit closer to the end of the assembled context (often stronger influence on the model). Tune this when two entries conflict.
Insertion position & depth
Entries can land at configured depth and role-shaped slots (system / user / assistant), subject to your Instruct or Chat Completion prompt layout. Author’s Note-relative positions exist; if Author’s Note frequency is 0, entries targeting A/N positions may be ignored—check the official note.
Outlet name (manual placement)
Outlet entries do not auto-inject. You group them under a name and pull them with the {{outlet::YourName}} macro in Prompt Manager or Advanced Formatting fields.
Upstream caveats worth memorizing:
- No outlet macros inside WI entry bodies (evaluation order / loops).
- No nested outlets.
- Character card fields like Description / Personality / Scenario cannot expand outlets (parsed too early).
- Author’s Note editor also cannot resolve outlets—use Top/Bottom of AN positions instead.
- Outlet names are case-sensitive; trim stray spaces.
Title / memo
For you, not the model. Empty memos can be filled from first key via the UI helper.
Strategy icons (constant vs keyword vs vector)
Upstream uses three visual strategies:
- Always present (“blue circle”) — constant insertion (still subject to budget).
- Keyword-triggered (“green circle”) — normal lore behavior.
- Embedding similarity (“chain link”) — requires Vector Storage extension path; see below.
Each entry also has an enable toggle.
Probability (trigger %)
Adds a random gate: 100 = always insert when otherwise activated; 50 = coin flip; 0 = never. Use sparingly for variety or “rare event” flavor.
Inclusion groups & weights
Give multiple entries the same group label. If several group members fire together, only one is chosen—default random weighted by Group Weight. Prioritize Inclusion can make the highest Order win deterministically instead. Group scoring mode prefers entries that matched more keys before the random tie-break.
Automation ID
Hooks entries to STscript / Quick Replies automations when IDs match—execution order follows WI sorting + recursion rules; duplicate IDs run once.
Character filter
Limit activation to named characters or tags, or invert to exclude—handy for cast-specific lore.
Triggers (generation type)
Restrict when an entry may fire: Normal, Continue, Impersonate, Swipe, Regenerate, Quiet (background jobs). If none selected, upstream says all types apply. Regenerate nuances differ in group chats—see upstream.
Additional matching sources
Beyond raw chat text, entries can optionally match against character description, personality, scenario, persona description, character note, creator notes (often not in the prompt, but usable as a signal), etc.—useful for shared lore across many characters without huge tag lists.
Vector Storage matching (short guide)
With the Vector Storage extension configured and enabled for World Info:
- Similarity between recent messages and entry text can replace pure keyword hits for eligible entries.
- Max Entries, budget, filters, and trigger % still apply—only the key check is swapped for embedding retrieval.
- Scan Depth for classic WI may be unused for vector path; extension query message depth applies instead.
- A Vectorized marker does not remove keyword behavior unless you clear keys—upstream warns embeddings are non-deterministic; need predictability → stay on keywords.
Timed effects (stateful lore)
Usually WI is stateless per evaluation. Timed effects add message-count semantics:
- Delay — needs enough messages before first activation.
- Sticky — stays on for N messages after firing.
- Cooldown — suppresses re-triggers for N messages.
Rules inherit on branches, reset on destructive edits to the entry, and do not refresh duration if the keyword hits again while active—see upstream’s numeric walkthrough.
Activation settings (global panel)
Collapsible controls at the top of the World Info screen—per-entry overrides exist for several fields.
- Scan depth — how many past messages participate in key scans.
0→ special case (recursion / Author’s Note paths only—read upstream carefully). - Include names — prefix lines with
Alice:/Bob:style labels so name-shaped keys work without spelling names in dialogue. - Context % / budget — hard cap on how many tokens WI may consume; when exhausted, further matches are dropped. Constant entries tend to win first; then higher insertion orders; direct key mentions beat “mentioned only inside another entry’s content.”
- Min activations vs max depth — can force extra backward scans for keywords up to limits (mutually exclusive with max recursion steps in upstream).
- Recursive scanning — entries can wake entries via keywords appearing in injected text. Per-entry flags: non-recursable, stop recursion after this, delay until recursion with levels. Max recursion steps caps nesting when Min Activations is off.
- Case-sensitive keys / match whole words — powerful for English; whole-word can hurt CJK without spaces—upstream advises disabling for Japanese/Chinese-heavy lore.
- Alert on overflow — UI warning when WI busts the budget.
How this relates to “character cards” and JSON
World Info files in the UI are one storage shape; *embedded character_book* inside a Character Card is another. They overlap in purpose (keyword lore) but differ in portability and UI. See:
- SillyTavern world lorebook logic — tables / icons, no UI walkthrough
- SillyTavern lorebook order for beginners — Insertion Order in plain language
Official sources (read next)
- **World Info** (core concepts) — authoritative field definitions.
- **World Info Encyclopedia** (rentry) — community deep dive linked from upstream.
- Data Bank → Vector Storage — embedding stack details.
Browse PNG + embedded JSON on Mac with Sillycard.
Topic: Blog · Latest posts