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.
a small, useful book
A short, visual reference for what belongs inside a lorebook — and what is better kept on the character card. Written for beginners building bots in SillyTavern and JanitorAI.
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.
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.
The world around them: places, NPCs, secrets, events, kinks, backstory. Injected only when keywords fire.
If it's only relevant sometimes — it goes here.
The single most useful question to ask before writing a single word: does the AI need this on every turn, or only sometimes?
{{user}} — current dynamicRule of thumb — if the card grows past ~2,500 tokens, the rest belongs in lorebook entries that fire when relevant.
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.
{{char}}-centric.
{{user}} —
family, backstory, observed traits. Written as things the
character can see, not as AI instructions.
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.
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.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.
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.
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.
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.
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.
Start small. Five good entries beat fifty noisy ones.
The order you build things in matters. Each step depends on the last — skipping ahead usually means rewriting later.
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.
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.
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.
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.
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.
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.
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.
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:
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.
Six things that go wrong on every beginner's first lorebook — and how to fix them.
"jealous"
as a keyword but the chat says "can't stand seeing them
together". Add synonyms.
look, walk, say — that
shows up in nearly every message.
Margot Sable, not just
Margot if there's a Margot Lin too). Reserve
role keywords for genuinely shared contexts.
kiss
or touch appear in non-sexual contexts all the
time.
Quick definitions for the terms you'll see in lorebook editors. Names vary slightly between platforms — the concept is usually the same.
{{user}} identity layer. ST has a dedicated
slot for it; JAI keeps it in the chat setup.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).
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 →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 →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 →A beginner-friendly visual compendium of what to put inside lorebooks vs character cards — for SillyTavern (regex) and JanitorAI (wildcards).
Back to top ↑Honest tip from one lazy vibecoder to another — all of this (docs, templates, even your half-finished bot files) can be dropped into Claude / GPT / whichever agent you trust. They'll happily write entries, debug keywords, and fix your JSON. Use the tools you have. (˶˃ ᵕ ˂˶) .ᐟ.ᐟ