Creator guide · World Info & CCv3
How to write a lorebook that actually triggers
To create a good lorebook, keep each entry focused on one person, place, or rule in plain facts (we aim for 80–200 tokens), list specific keyword aliases, cap constant entries at five or fewer, and set scan depth wide enough to catch names from two or three turns back. Test triggers free in our browser Lorebook Trigger Simulator, then run the book in SillyTavern or on Android inside Foreverse, our mobile roleplay and novel app.
Available for iPhone and iPad in selected regions outside mainland China. Not available on the mainland China App Store. Download help
What actually happens inside a lorebook when you hit send?
A lorebook—called World Info in SillyTavern's documentation and character_book in the Character Card V2 and V3 specs—is a conditional lookup table that stays out of your prompt until recent dialogue matches an entry's keys. Every time you send a message, the client runs four mechanical steps: scan the latest N turns case-insensitively for matching keywords, sort matched entries by insertion position and priority, drop lower-priority hits once the token budget fills up, and (when recursion is enabled) scan newly injected entries for keys that pull in chained entries.
Notice what never happens in that pipeline: no pop-up warning fires when an entry gets left behind. Lorebook bugs fail silently. Whether an entry toggle was left off, five bloated constant entries ate the entire token budget, or the player typed “the Harbor” while your key only matched “Port Valen,” the model simply replies as if that lore never existed. As our Worldbook Spec stresses, start every debugging session by checking whether the entry actually made it into the prompt before blaming the model's memory.
Which five lorebook knobs cause most missed or runaway triggers?
Five parameters account for most World Info headaches across SillyTavern, Foreverse, and V2/V3 card editors. The starting numbers below are our own practical rules of thumb rather than spec mandates:
| Parameter | What it controls | Our rule-of-thumb starting point | Common failure mode |
|---|---|---|---|
| Keywords & aliases | Match list (not case-sensitive by default in SillyTavern); only Content is sent to the AI, never the key list itself | A handful of keys per entry: full name, first name, nickname, role title | Using common verbs or pronouns ('the', 'king', 'home') so the entry fires on every turn |
| Constant | Forces injection on every turn regardless of keywords | 0–5 short entries total (world laws, calendar, status format) | Marking 20 character bios constant, starving the token budget for situational entries |
| Scan depth | How many recent turns the scanner checks for keywords | SillyTavern's default is 2 turns; Foreverse on Android defaults to 4. Raise it if scenes linger without repeating names | Depth set to 1: the player names a city, the bot replies without repeating the name, and turn 2 forgets the city |
| Token budget | Hard ceiling shared by all matched + constant entries on that turn | Set it explicitly as a modest share of the context window, and raise it if entries go missing | One very long history essay eats the budget and silently drops the smaller entries after it |
| Recursion | Scans injected entry text for keys belonging to other entries | Short chains: a Faction entry mentions its Leader's unique title, pulling in the Leader entry | Mutual references (Entry A names B, Entry B names A) without non-recursable guards, pulling half the book in at once |
Authoring for chara_card_v3 apps? Two inline decorators can sit at the top of an entry's content: @@activate forces injection unconditionally (still honoring cooldowns), while @@dont_activate freezes work-in-progress entries so no keyword or recursion chain can pull them in. Foreverse strips @@ lines before assembling the prompt; an app that does not recognize decorators may pass those raw lines straight to the model as plain text, so double-check before sharing a V3 book with a V2-only client.
How should you phrase an individual entry so the model actually uses it?
Write entries like a stage manager's cheat sheet, not a wiki essay. Both SillyTavern's World Info docs and NovelAI's Lorebook guide treat entry text and activation keys as separate things; SillyTavern's docs say keywords, titles, and anything else outside the content field are not inserted into context. If you title an entry “Ironhaven” with key ironhaven and start the body with “A northern port famous for smuggling,” the AI receives a headless sentence and has to guess what subject it belongs to. Put the proper noun inside the first five words of content every time.
Stick to one entity per entry and trim atmospheric fluff. Three paragraphs chronicling a guild's founding four hundred years ago eat your budget and nudge the model into stiff encyclopedia prose during casual dialogue. Give it 120 tokens of playable facts instead: who runs Ironhaven right now, how gate guards treat outsiders, what coin buys passage, and why {{char}} hates going back. Lean entries let three or four relevant facts share the budget in a busy scene without crowding each other out.
Indirect phrasing is the classic edge case: a player asks “can we afford dinner?” without ever typing your custom currency's name, so plain keyword matching misses. In Foreverse, entries flagged “vector” still match by keywords out of the box. They switch over to semantic similarity only after you enable Lorebook vector activation under Me → Advanced settings → AI models & services → Vector Memory (RAG) and configure an embedding model (our official channel bundles one ready to go; if the toggle is on with no embedding model set, vector entries are skipped for that turn). Even with embeddings available, adding everyday words players actually type (“dinner”, “tab”, “coins”) as backup keys—or parking a short currency rule in a constant entry—saves headaches.
How can I test and debug a lorebook for $0 before burning API tokens?
We build Foreverse, so weigh our view accordingly. We put our lorebook diagnostic tools in the browser for free because spending twenty paid API turns hunting down a misspelled secondary key gets old fast. Run through these four checks before starting a real campaign:
- Extract a starter skeleton or merge scattered books
Adapting a web novel or worldbuilding doc? Drop the TXT or EPUB into Novel to Lorebook Skeleton to tally recurring names, places, and terms into a clean SillyTavern JSON skeleton, then write 80–200 tokens of plain facts per slot. Combining several downloaded books? Clean up colliding keys in Lorebook Merger.
- Dry-run sample chat inside the Lorebook Trigger Simulator
Open /labs/lore-trigger, load your World Info JSON or embedded card, and paste five turns of realistic player dialogue. You will see every keyword match, constant injection, and multi-hop recursion chain light up instantly with zero model calls.
- Scan for cross-frontend dialect bugs before publishing
Sharing your book across SillyTavern, JanitorAI, RisuAI, or Agnai? Drop the file into Lorebook Migration Doctor to catch silent incompatibilities such as 1% probability defaults or stripped constant flags.
- Inspect the live assembled prompt on desktop or Android
When something still feels off in play, read the exact prompt sent to the model. In a browser, load your preset, card, and lorebook into Prompt Assembly Inspector. In Foreverse on Android, attach or edit the book via Chat → ⋮ → Current status → World lore, send one neutral probe message, then long-press the reply and tap Prompt to search Prompt Inspector for your entry text—walkthrough in our memory and worldbook troubleshooting guide.
When is Foreverse not the right place to run your lorebook?
- Creators whose cards depend on desktop-only SillyTavern World Info extensions or full STscript pipelines that rewrite lorebook entries mid-turn: Foreverse supports scan depth, constants, recursion, token budgets, and V3 decorators, but defaults differ (scan depth 4 on Android vs. 2 in SillyTavern) and third-party SillyTavern extensions cannot be installed.
- Pure prose co-writers who want inline desktop completion with NovelAI's ATTG headers and lorebook generators on a wide monitor: NovelAI or desktop SillyTavern fits long keyboard sessions better than a phone.
- Collectors keeping huge local libraries at zero software cost: Foreverse is free to install with BYOK or 5,000 starter credits (1 credit = $0.0001), but the free tier caps local slots at 3 cards, 3 books, and 3 companions until the one-time $19.99 Pro unlock.
FAQ
How many entries can one lorebook hold without slowing down or breaking the AI?
Dormant entries cost zero context tokens, so we know of no hard ceiling on total entry count. What matters is how many entries fire on the same turn: once active entries hit your token budget, lower-priority matches drop silently without an error, so set a deliberate budget and keep constant entries scarce.
Should core protagonist traits go in the character card or the lorebook?
Keep facts needed on every single turn—name, baseline personality, relationship to {{user}}, and signature speech habits—inside the character card's description. Move situational lore such as childhood flashbacks, coworkers, inventory items, and specific districts into keyword-triggered lorebook entries.
Why is my lorebook not triggering at all in SillyTavern or JanitorAI?
Walk through four checks in order: confirm the lorebook is actually bound to the active character or chat, check that the individual entry switch is enabled, verify the keyword appeared within your last N scan-depth turns, and make sure oversized constant entries have not already eaten 100% of your token budget.
What does recursive activation do in a lorebook, and should I leave it on?
Recursion scans newly injected entry text for keywords belonging to other entries. Typing 'Seventh Ward' can pull in the district entry, which mentions 'Captain Vance' and automatically pulls in Vance's bio on the same turn. Leave it on for linked worldbuilding, but use distinct keys so one hit does not chain-react across twenty entries.
Can a lorebook work during novel continuation, not just roleplay chat?
Yes. Inside Foreverse's novel reader, every book has its own Book lore list whose entries attach to a continuation request whenever your instruction hits their keywords. Because a continuation sends nearby chapter text plus attached entries rather than the whole book, durable facts such as relationships and world rules belong in Book lore.
Sources
- SillyTavern Documentation — World Info (Lorebooks, Recursion & Context Budget) (checked 2026-11-15)
- Character Card V2 Specification — CharacterBook Schema (checked 2026-11-15)
- Character Card V3 Specification — Lorebook Decorators (@@activate / @@dont_activate) (checked 2026-11-15)
- Moonshot Kimi API Docs — Context Caching Best Practices (checked 2026-11-15)
- NovelAI Documentation — Lorebook Entry & Key Design (checked 2026-11-15)