The first versionПервая версия
The original single-page compendium from 2025. Исходный одностраничный сборник 2025 года.
Материал архива доступен только на английском.
Everything below is preserved from the 2025 version and is no longer how I build lorebooks. It stays here because people linked to it, and because deleting the older version of an opinion is a way of pretending you never held it. Ниже сохранены материалы версии 2025 года, которые больше не отражают того, как я собираю лорбуки. Они остаются здесь, потому что на них ссылались, и потому что удалять прежнюю версию своего мнения — значит делать вид, будто его никогда не было.
Start at the current version instead. Лучше начните с текущей версии.
What changed sinceЧто изменилось с тех пор
In this version, I recommended three lorebooks, lots of entries, and a hard split between platforms. In practice, none of the three held up.В этой версии я предлагала три лорбука, много записей и жёсткое разделение между платформами. На практике ни один из этих трёх подходов не оправдал себя.
Inline notes in six sections link to their current replacements.В шести разделах пометки ведут к соответствующим главам текущей версии.
§ 01What is a lorebook?
A lorebook is a library of small notes the AI only sees when it needs them. Each note (an entry) is triggered by keywords in the chat. This keeps the prompt short and the character consistent — facts arrive just-in-time, not all at once.
Always-on identity
The character's permanent self: name, look, voice,
personality, the dynamic with {{user}}. Loaded every
single turn.
If the AI must know it to stay in character — it goes here.
Triggered context
The world around them: places, NPCs, secrets, events, kinks, backstory. Injected only when keywords fire.
If it's only relevant sometimes — it goes here.
§ 02What belongs where?
The single most useful question to ask before writing a single word: does the AI need this on every turn, or only sometimes?
Always-on
Keep on the Card
- Name, age, pronouns, occupation
- Appearance (hair, eyes, build, voice, scent)
- Core personality & speech patterns
- Default mood, defense mechanisms
- Relationship with
{{user}}— current dynamic - Sexuality summary & hard limits
- 2–3 line backstory summary
- One-line names of key people in their life
Triggered
Move to a Lorebook
- Full backstory events & memories
- Hidden traits (jealousy, drunk behavior, attraction tells)
- Secrets & reveals (with delay/cooldown)
- NPCs — friends, family, rivals, exes
- Locations — apartment, bar, workplace
- Organizations & factions
- World setting, lore, culture
- Detailed NSFW behavior (kinks, sounds, aftercare)
- Recurring events & their reactions
Rule of thumb — if the card grows past ~2,500 tokens, the rest belongs in lorebook entries that fire when relevant.
§ 03The three layers
A clean setup uses three lorebooks, each looking at the story from a different angle. SillyTavern keeps them as separate files; on JanitorAI, the same logic lives inside one Advanced Script.
scope
{{char}}-centric.
the card
{{user}} —
family, backstory, observed traits. Written as things the
character can see, not as AI instructions.
the persona
Not every bot needs all three. A simple OC can ship with just a
Character lorebook. Add layers when the world or {{user}}
get rich enough to deserve their own pages.
§ 04Common entry categories
Most lorebooks organize entries into a handful of repeatable categories. You don't need all of them — pick what your story actually needs and skip the rest.
One entry per supporting character. Name, role, look, quirks,
and how they relate to {{char}}.
A place that matters: home, workplace, school, hangout. Includes atmosphere, who's usually there, what happens.
Triggered by place name and type.Friend group, company, school, club, gang. Members, purpose, reputation, internal dynamics.
Triggered by group name + member names.Setting facts: era, geography, technology, customs, slang. Use one entry per theme — don't dump it all in one.
Triggered by topic words.Specific past events that shaped the character. What happened, who was there, the lasting emotional mark.
Triggered by event-specific words.Reactions the AI should know but only show on cue: jealousy, drunkenness, vulnerability, attraction tells.
Triggered by emotional / situational words.A specific scene that fires when conditions align. Often gets a cooldown so it doesn't repeat every turn.
Triggered by precise keywords.Something the character is hiding. Usually delayed — not revealed in the first few messages of a chat.
Triggered by reveal-adjacent words.How the character behaves in intimate moments — sounds, physical tells, kinks, aftercare. Always gate with explicit secondary keywords.
Triggered only when clearly sexual.§ 05Anatomy of an entry
SillyTavern — field names below are ST's. JAI scripts use the same writing logic, but keywords follow wildcard syntax instead.
Every entry has the same three core parts: a name, keywords that trigger it, and content the AI sees when it fires.
Good entries lean on sensory specifics — brand names, smells, what the room sounds like, who else is there. The AI uses these as anchors to stay grounded in the scene. Vague entries ("she is shy and kind") are mostly wasted tokens.
Aim for 80–300 tokens per entry. Bracketed section
headers ([BASICS], [NOW]) help both you
and the AI parse the entry quickly when several fire at once.
§ 06Keywords — the trigger
Keywords decide when an entry fires. Each platform handles them differently, but the principles are the same: be specific, cover plurals and synonyms, avoid words that show up everywhere.
SillyTavern
Regex
Wrap a pattern in slashes — full regex syntax works, including word boundaries and alternation.
/\bbar\b/i — exact word
/\bdrink(?:s|ing)?\b/i — with suffixes
/\b(?:mom|mother|mama)\b/i — synonyms
Plain text like Margot also works for proper nouns.
JanitorAI
Wildcards
No regex. Two options only: an exact word, or a stem ending
with * that matches anything starting with it.
bar — exact word
drink* — stem (drinks, drinking, drunken…)
margot — names match exactly
For synonyms, list each as a separate keyword.
Pick keywords that only mean what you want
The biggest beginner mistake is using broad words like
look, feel, walk as triggers —
they fire on every other message. Either use a specific word, or pair
a broad keyword with a secondary key (most
platforms support this) so both have to appear before the entry
fires.
§ 07Quick rules
Do
- Keep the card focused on identity — everything else moves out
- One entry per topic, per NPC, per location
- Write content in plain language — the AI reads it like text
- Use specific keywords (names, places, exact terms)
- Set cooldowns on events and secrets so they don't repeat
- Reference NPC names exactly the same across entries
Don't
- Don't duplicate info between the card and lorebook
- Don't write entries as instructions ("the AI should…")
- Don't use common verbs as keywords without a gate
- Don't gate NSFW entries on soft words alone — be explicit
- Don't ship 100+ entries; consolidate aggressively
- Don't forget — entries only fire if their keywords appear in chat
Start small. Five good entries beat fifty noisy ones.
§ 08Build order
The order you build things in matters. Each step depends on the last — skipping ahead usually means rewriting later.
Sketch the world (or skip)
If your bot has a setting that matters — a tour, a school, a fictional town — outline it first. If it's just two people in a room, you can skip straight to the card.
→ The world is the stage everything else stands on.
Write the character card
Identity, look, voice, personality, dynamic with
{{user}}. This is the always-on layer — the AI
sees it every single turn.
→ Until the card holds together, no lorebook can rescue it.
Build the character lorebook
Pull anything from the card that's only relevant sometimes — backstory events, hidden traits, NPCs, kinks. Each becomes a triggered entry.
→ This is where bots actually get their depth.
Add the world lorebook (if needed)
Locations, factions, lore, supporting NPCs. Only worth it if the world is rich enough to deserve its own pages.
→ Optional. Many bots ship without one.
User / persona lorebook (advanced)
What {{char}} has noticed about
{{user}}. Optional — most beginners skip this
and add it later when the dynamic gets specific.
→ Skip this on your first bot. Come back later.
Test & trim
Roleplay with the bot. Notice which entries never fire (bad keywords) or fire constantly (broad keywords). Fix or delete. Repeat until it feels right.
→ The first draft is never the final one.
§ 09Card field cheat-sheet
SillyTavern — field names below are ST's. JAI cards have a similar split (Personality, Scenario, Example dialogues) — same logic applies.
A character card has several fields. Beginners constantly mix them up — here's what each one is actually for.
{{user}}. This is the bulk of the card.
{{user}}'s role in it. Two to five
sentences. Not the whole story — just the entry point.
§ 10Where do tokens go?
Every model has a context window — the total number of tokens it can hold per turn. Lorebooks live inside that window, fighting for space with everything else. Here's a rough split for a typical 32k-token chat mid-conversation:
fixed
always loaded
typically 25–35%
grows every turn
reserved
When the lorebook section overflows its budget, entries get dropped — usually the lowest-priority ones first. That's why fewer good entries beat many bloated ones: a 600-token entry that fires twice a chat is worse than a 150-token one that fires every time it's needed.
§ 11Common mistakes
Six things that go wrong on every beginner's first lorebook — and how to fix them.
My entry never fires.
"jealous"
as a keyword but the chat says "can't stand seeing them
together". Add synonyms.
My entry fires every single message.
look, walk, say — that
shows up in nearly every message.
The bot keeps repeating the same scene.
My context is full and the bot forgot everything.
The AI keeps mixing up two NPCs.
Margot Sable, not just
Margot if there's a Margot Lin too). Reserve
role keywords for genuinely shared contexts.
My NSFW entry leaks into normal scenes.
kiss
or touch appear in non-sexual contexts all the
time.
§ 12Glossary
Quick definitions for the terms you'll see in lorebook editors. Names vary slightly between platforms — the concept is usually the same.
- Token
- A chunk of text the AI counts. Roughly ¾ of a word in English. "Hello world" is about 2 tokens.
- Context window
- The total tokens an AI can hold at once — system prompt, card, lorebook, chat history, and reply combined.
- Entry
- One note inside a lorebook. Has a name, keywords, and content. Fires when its keywords appear in chat.
- Keyword / key
- The trigger word(s). When any of them appears in recent messages, the entry activates.
- Secondary key
- An extra word that also has to appear for the entry to fire. Used to gate broad keywords.
- Order / priority
- Which entries get dropped first when the budget is tight. Higher order = survives longer.
- Depth
- How far back into the chat the entry's content gets injected. Lower = closer to the AI's reply = stronger influence.
- Constant
- An entry that fires every turn regardless of keywords. Use sparingly — it's expensive.
- Sticky
- Once fired, the entry stays active for N more turns, even if its keywords disappear. Good for ongoing events.
- Cooldown
- After firing, the entry can't fire again for N turns. Stops scenes from repeating.
- Delay
- The entry can't fire at all until N messages have happened. Useful for secrets that shouldn't surface immediately.
- Recursion
- When a fired entry's content contains keywords that trigger more entries. Powerful, but easy to spiral.
- Selective
- Mode where a primary key plus a secondary key are both required to fire. Used to prevent broad-keyword pollution.
- Probability
- Chance (0–100%) that a triggered entry actually fires. Useful for variant outcomes.
- Scenario
- A short setup field on the character card describing where and when the chat opens.
- Persona
- The
{{user}}identity layer. ST has a dedicated slot for it; JAI keeps it in the chat setup.
§ 13Further reading
This compendium covers the basics. For everything else, read the official docs — they're more accurate, more current, and more thorough than any third-party guide (mine included).
SillyTavern Documentation
The official wiki. Covers world info, scripts, regex, extensions, and every checkbox in the UI. Genuinely worth reading top-to-bottom once.
docs.sillytavern.app →JanitorAI Help Center
JAI's official guides — character creation, advanced scripts, lorebook setup. Their script docs are essential if you're building anything beyond a basic bot.
help.janitorai.com →Community guides & Discord
Both platforms have active communities sharing prompts, tips, and lorebook examples. Search for the ST or JAI Discord — that's where the working knowledge actually lives.
SillyTavern Discord →