ROLECALLFeatures
Features

Lorebooks

Deep dives into every tool on stage

Lorebooks

Lorebook tab of the World wing — entry list, selective triggers, injection position, timing controls, and entry body all visible

A Lorebook is a collection of world information entries that get injected into the AI's context when their trigger conditions are met. They're the tool you use to build rich, consistent worlds — lore that the AI remembers only when it's relevant.

Think of a lorebook as a reference library for the AI. Instead of cramming every detail about your world into the system prompt (which wastes context tokens), you define entries that activate only when the conversation touches on their topic. Mention "dragon" and the AI suddenly knows about Dragonspire Peaks. Talk about the queen and the court's political intrigues materialize.


How Lorebooks Fit In

Every chat session in RoleCall can use one or more lorebooks alongside a character, preset, and persona:

Chat Session
├── Character      — Who the AI plays
├── Preset         — How the AI behaves
├── Persona        — Who you are
├── Lorebooks (0+) — World context (activated by triggers)
└── Extra Prompts  — Additional injected snippets

When you send a message, RoleCall scans the recent chat history for keywords defined in your lorebook entries. Any entries whose triggers match get their content injected into the AI's context — silently, behind the scenes — so the AI "knows" that information for its next response.

A single chat can layer many lorebooks. They share one trigger engine and one token budget, so an entry from your campaign lorebook competes with an entry from your world lorebook on priority and probability alone.


Anatomy of a Lorebook

Every lorebook has a top-level identity and a bag of global defaults that its entries inherit unless they override them.

Identity

FieldDescription
NameThe lorebook's display name. Shown in pickers, in the active list, in Discovery.
DescriptionLong-form blurb shown on the lorebook's page and in Discovery.
Image / ThumbnailCover art used on cards and detail pages. Two slots so the thumbnail can be cropped tighter than the hero.
Lorebook TypeOne of world, character, scenario, rules, utility, or other. Helps users filter Discovery and reminds you what role this book plays.
Genre / FandomFree-text labels for browsing — e.g. "dark fantasy" or "Final Fantasy XIV".
TagsCategorization labels for Discovery search and filtering.

Global Matching Defaults

These apply to every entry unless the entry sets its own override.

SettingDefaultDescription
Global Scan Depth100How many recent messages get scanned for keyword matches. Higher values scan further into the past — useful for slow-burn lore, wasteful when entries are time-sensitive.
Global Case SensitiveOffWhen off, Dragon and dragon both match. When on, capitalization matters.
Global Match Whole WordsOffWhen on, dragon matches "dragon" but not "dragonfly" or "dragons". When off, substring matches count.
Global RecursionOffWhen on, the trigger engine performs multiple scan passes so entries can trigger each other in chains. See Recursion below.
Token Budget0 (unlimited)The combined token ceiling for everything this lorebook injects in a single turn. When set, the engine drops lowest-priority entries first to stay under the cap.
Budget ModetokenWhether Token Budget counts tokens (token) or entries (entry).
Entry Budget20Used when Budget Mode is entry. Caps how many entries can fire in a single turn.

Display Preferences

SettingDescription
Default SortHow entries are ordered in the editor: manual (your drag order), priority, alpha, tokens, or uid.
Default Sort Directionasc or desc. Applies on top of the sort mode.

Anatomy of an Entry

A lorebook is a stack of entries. Each entry is a self-contained piece of world info with its own trigger conditions, injection rules, and content.

Core Fields

FieldDescription
TitleA short name shown in the editor and used for XML wrapping when Memo is on. Required.
ContentThe actual text injected into the AI's context when the entry fires. Supports the full macro system.
CommentInternal notes visible only to you in the editor. Never sent to the AI. RoleCall-specific — does not survive export to SillyTavern format.
EnabledOn/off switch. Disabled entries are skipped during processing entirely (no trigger work, no token cost).
ConstantAlways-on. Constant entries bypass keyword matching and inject every turn.

When to Use Constant

Constant entries are great for foundational world facts that should always be present:

  • The core rules of your magic system
  • The current story arc or main quest objective
  • Physical laws that differ from the real world
  • A relationship state that always matters

Since constant entries always consume context tokens, keep them lean. Reserve them for the essentials — every constant entry is a tax on every single turn.

When NOT to Use Constant

If a fact only matters in specific scenes, use keywords instead. Marking a 600-token character backstory as Constant means you pay 600 tokens every turn forever, even when that character is asleep three towns away.


Trigger Modes

Every entry runs in one of two trigger modes. They use the same keyword list but treat probability differently.

Simple Mode

The default. You list keywords; if any of them match in the scan window, the entry triggers. A single entry-level Probability value gates whether it actually fires (more on probability below).

  • Enter keywords separated by commas: dragon, wyrm, drake
  • Any single keyword matching is enough to activate the entry
  • A 100% probability means "always trigger when matched"

Simple mode is the right default for almost everything. Reach for advanced mode only when you need per-keyword probability or special triggers.

Advanced Mode

Same keyword list, plus access to the full special trigger vocabulary and per-keyword probability weights.

Trigger TypeSyntaxWhat It Matches
Plain keywordmotherSimple text match in the scan window
Regex pattern/drag(on|ons)/iRegular expression with optional flags (g, i, m, s, u, y)
Emotion[emotion:sadness]Emotional tone in recent messages
Message count[messageCount:>=50]Conversation has reached that many messages
Random chance[randomChance:25]A flat X% probability each turn
Generation type[generationType:swipe]The current action: normal, continue, swipe, regenerate, impersonate
Swipe count[swipeCount:>=3]User has swiped on the current message at least N times
Group chat[isGroupChat:true]Only in group performances (false for 1:1)
Speaker[speaker:Elena]The named character is currently speaking
Lorebook active[lorebookActive:DragonLore]Another entry or lorebook is already triggered
Recency[recency:5m]A message was sent within the last X seconds, minutes, or hours

You can mix plain keywords and special triggers freely in the same entry.

Numeric Comparisons in Special Triggers

[messageCount:...] and [swipeCount:...] accept full comparison operators:

FormMeaning
>=50At least 50
<=10At most 10
>5More than 5
<3Fewer than 3
=10 or ==10Exactly 10

Recency Units

[recency:X] accepts seconds, minutes, or hours:

ValueMeaning
30sA message was sent within the last 30 seconds (very active conversation)
2mWithin the last 2 minutes
5mWithin the last 5 minutes (recent activity)
15mWithin the last quarter hour
1hWithin the last hour

If no message timestamps are available, recency defaults to true — it doesn't lock you out of a fresh session.


Narrative Conditionals (Compendium-Powered)

Some triggers can't be evaluated by simple pattern matching — they need to understand the scene. RoleCall's Compendium (formerly known as TunnelVision) uses a small sidecar model to read recent messages and decide whether these conditions are true.

TriggerWhat It Asks
[emotion:sadness]What emotions are the characters feeling? (See the emotion table below.)
[mood:tense]What's the overall vibe — tense, romantic, eerie, foreboding?
[timeOfDay:night]What time is it in the fiction — dawn, dusk, the witching hour?
[location:tavern]Where are the characters right now — indoors, outdoors, somewhere specific?
[weather:storm]What are the environmental conditions — rain, blizzard, acid rain, clear?
[activity:combat]What are the characters doing — fighting, traveling, performing a ritual?
[relationship:hostile]What's the dynamic between characters — hostile, flirting, reluctant allies?

These narrative conditionals are evaluated by an AI that reads the scene, so they understand subtext. You write the condition in plain language ("foreboding", "the witching hour", "performing a ritual") and the sidecar judges whether the scene matches.

When Compendium Is Off

  • Emotion falls back to regex pattern banks that match emotion-related vocabulary. Faster and free, but it only catches obvious cues.
  • All other narrative conditionals don't fire at all. No sidecar means no evaluation. Plain keywords and pattern-based special triggers still work as normal.

What Compendium Brings to Lorebooks

When Compendium is enabled, a lorebook can be promoted to managed by Compendium. That changes how it behaves:

  • Its entries are organized into a hierarchical tree (categories → sub-categories → entries) instead of a flat list.
  • Before each AI response, the sidecar reads recent messages and picks which entries are relevant — you get smarter selection than keyword matching alone can achieve.
  • After each response, the sidecar can update the lorebook itself: writing new entries, fixing facts, summarizing scenes, reorganizing entries between categories.
  • The narrator can be given a search_lorebook tool to look things up mid-generation.

Compendium-managed lorebooks suppress the normal keyword engine by default. You can re-enable keyword hint matching so that classic matches are run anyway and shown to the sidecar as suggestions it can accept or ignore.

See the Compendium guide for the full surface.


Emotion Triggers

In Advanced mode, you can trigger entries based on the emotional tone of the conversation using [emotion:type]. RoleCall recognizes 28 emotion types:

admirationamusementangerannoyance
approvalcaringconfusioncuriosity
desiredisappointmentdisapprovaldisgust
embarrassmentexcitementfeargratitude
griefjoylovenervousness
optimismpriderealizationrelief
remorsesadnesssurpriseneutral

When Compendium is on, emotion is evaluated by the sidecar reading the scene — that's the upgraded path. When Compendium is off, RoleCall falls back to scanning recent messages against keyword and regex banks associated with each emotion type. It's not as nuanced as AI sentiment analysis, but it's fast and predictable.

Example

An entry about a character's tragic backstory with the trigger [emotion:sadness] activates when the conversation drifts into melancholic territory — tears, loss, grief-related language — making the backstory available to the AI exactly when it's most dramatically relevant.


Primary, Secondary & Selective Logic

For more precise control than "any keyword matches", entries split their triggers into two groups — primary and secondary — joined by a logic operator.

[Primary Keywords] — [Logic Operator] — [Secondary Keywords]

The primary keywords determine the initial match. The logic operator and secondary keywords act as a gate:

OperatorMeaning
AND ANYPrimary matches AND at least one secondary matches
AND ALLPrimary matches AND every secondary matches
NOT ANYPrimary matches AND no secondary matches
NOT ALLPrimary matches AND not every secondary matches

Either group can mix plain keywords with special triggers in Advanced mode — that's how you build "dragon scenes during tense moods" or "the queen unless she's in the tavern."

Example: Contextual Dragon Lore

Imagine you have lore about a specific dragon encounter at a specific location:

  • Primary: dragon, wyrm
  • Logic: AND ANY
  • Secondary: mountain, peaks, Dragonspire

This entry only triggers when someone mentions a dragon and the mountains. Talking about a dragon in a tavern scene won't activate it — only the mountain dragon encounter does.

Example: Exclusive Lore

  • Primary: sword, blade
  • Logic: NOT ANY
  • Secondary: rusty, broken, old

This triggers for swords, but not if the conversation is about damaged weapons. Your pristine legendary blade lore stays quiet when someone's complaining about a rusty dagger.

Example: Layered Conditions

  • Primary: Elena
  • Logic: AND ANY
  • Secondary: [mood:tense], [location:outdoors]

Elena's "wary in the wilderness" entry fires when she's mentioned AND the scene is either tense OR set outdoors. Mention her in a tavern over a quiet ale and the entry stays quiet.


Per-Entry Matching Overrides

Each entry can override the lorebook's global matching defaults. When the override is left blank (the default), the entry uses the lorebook setting.

OverrideEffect
Case SensitiveForces the entry's keyword matches to honor (or ignore) capitalization regardless of the lorebook default.
Match Whole WordsForces whole-word matching (or substring matching) for this entry only. Useful when 90% of your entries match cat substring-style but one entry needs Cat as a precise proper noun.
Scan DepthA custom scan window for this entry alone. Lower values keep ephemeral lore from cluttering long conversations; higher values catch slow-burn references.

Per-keyword regex patterns also carry their own flags (/.../gi, etc.), so you can mix case-sensitive and case-insensitive matches even inside a single entry.


Activation Conditions Per Entry

Beyond keyword matching, each entry has a handful of gates that decide whether a matched entry actually fires.

GateDefaultEffect
Probability100After keywords match, the engine rolls 0–100. Below this value, the entry fires. 100 means always; 50 is a coin flip.
Probability ModehighestHow per-trigger probabilities combine in Advanced mode (see Probability section).
Min/Max Activations (via cooldown)The cooldown field caps re-fire rate; there is no separate hard cap on "activations per chat." Use cooldown + sticky to shape activation cadence.
ConstantOffBypasses every gate above — fires every turn regardless of keywords or probability.
Frequency (per trigger)NoneA trigger-level cooldown: this specific keyword can only cause activation every N messages. Different triggers on the same entry can still fire.

Probability Modes

In Advanced mode each individual trigger has its own probability weight. Probability Mode decides how those weights combine when multiple triggers match in the same turn:

ModeBehavior
HighestThe single best-matching trigger's probability is used. "Mother (70%)" matching with "[emotion:sadness] (80%)" rolls at 80%.
AdditiveMatched trigger probabilities stack, capped at 100%. The same scene rolls at 100% (70 + 80 → 150 → capped at 100).

Highest is conservative — partial signals stay partial. Additive is dramatic — overlapping triggers push toward certainty.


Probability & Boosting

Not every matching entry needs to fire every time. Probability adds variety.

Simple Mode Probability

In Simple mode, each entry has a single Probability field (0–100%). When keywords match, the engine rolls against this percentage. 100% means always trigger. 50% means a coin flip. This is great for ambient flavor entries you don't want appearing every single turn.

Advanced Mode Probability

In Advanced mode, the entry-level probability is ignored. Instead, each individual trigger has its own probability weight:

Trigger              Probability
mother               70%
dead mother          100%
mom                  50%
[emotion:sadness]    80%

When multiple triggers match, Probability Mode (above) decides whether to take the highest or stack them together.

Cross-Entry Boosting

Entries can boost other entries' probability with a flat bonus. For example:

  • "Dragon Sighting" has a 40% base probability
  • "Dragon Territory" is active and is configured to boost "Dragon Sighting" by +30%
  • "Dragon Sighting" now has a 70% chance of triggering
SettingDescription
Boost IDsA list of other entry IDs this entry boosts when it fires.
Boost AmountThe probability bonus applied (0–1, where 0.3 = +30 percentage points).

This lets you create cascading probability chains — being in dragon territory makes dragon sightings more likely.


Injection: Where Content Lands in the Prompt

When an entry triggers, where does its content appear in the AI's context? The Position field controls this.

Positions

PositionWhere It Lands
WorldInjected early, before the character card. Treated as background knowledge. Good for geography, history, world rules.
CharacterInjected near the character definitions. Good for character-specific lore, relationships, secrets the AI keeps.
Before ExampleInjected immediately before the example dialogues. Useful for context the AI should see before it studies how the character talks.
After ExampleInjected immediately after the example dialogues. Good for state that applies after the demonstrative scenes.
SceneLegacy generic position that maps near recent messages. Good for active quests, immediate surroundings, ongoing events.
@ DepthInjected at a specific position in the recent message stack — see Depth below.

Before Example and After Example are kept distinct so round-trips to and from SillyTavern format don't collapse them — your lorebook survives a trip through other tools intact.

Depth (only when Position is "@ Depth")

For fine-grained control, choose @ Depth to inject at a specific position in the message stack:

  • Depth 0 = right before the latest message (maximum influence)
  • Depth 4 = four messages back (moderate influence; the default)
  • Higher depths = further back in context (less immediate influence)

Lower depth means the AI pays more attention to the content, since LLMs weight recent context more heavily.

Role

Each entry can also specify what role its content is injected as:

RoleEffect
SystemPart of the system prompt (default). The AI treats it as instructions.
UserAppears as if the user said it. Can be useful for steering behavior.
AssistantAppears as if the AI said it. Useful for establishing tone or "memories."

Preset Integration

Preset creators can place lorebook content precisely using macros in their prompt stack:

MacroInjects
{{lorebook:world}}All triggered entries with World position
{{lorebook:character}}All triggered entries with Character position
{{lorebook:scene}}All triggered entries with Scene position
{{lorebook:all}}All triggered entries (respects bucket ordering)

If the preset doesn't use these macros, RoleCall auto-injects lore at sensible default positions.


Priority, Sort Order & Budget Drops

Two fields control the order entries are processed and what happens when budget runs out:

SettingDescription
Sort OrderThe position of the entry in the lorebook list. Drag entries to reorder. This is the default processing order.
PriorityAn explicit number that overrides list position. Higher priority = processed first. Default 100.

When the token (or entry) budget fills up, entries are dropped starting from the lowest priority. If you have lore that must always appear, give it a high priority — or use Ignore Budget.

Ignore Budget

The Ignore Budget flag forces an entry to always inject, regardless of the lorebook's token or entry cap. Use it sparingly for absolutely critical lore — the core rules of your world, the current main quest objective, safety-relevant context.

Example

You have 20 entries but only budget for 10. The engine processes entries by priority, highest first. Once the budget is full, remaining entries are skipped. Your core world rules (priority 100) always make it in; flavor text about tavern decor (priority 5) gets dropped first.


Inclusion Groups

Sometimes you have several variations of the same lore and only want one to appear. Inclusion groups solve this.

Give multiple entries the same Group Name (any text string). When the group triggers, only one entry from the group is selected per turn.

Group Weight

Each entry in a group has a Group Weight value. Higher weight means that entry is more likely to be chosen:

EntryGroupWeightChance
Sunny weatherweather6060%
Rainy weatherweather3030%
Thunderstormweather1010%

Every turn, if the "weather" group triggers, one of these three entries is selected based on their weights. This creates natural variety — mostly sunny, sometimes rain, rarely storms.

Mutual Exclusion Mechanics

  • Only one entry per group fires per turn, regardless of how many of the group's entries match.
  • If you want a guaranteed "always pick one of these," make sure every entry in the group shares at least one keyword (so the group is always eligible).
  • If you want a "sometimes nothing happens," add lower-weight entries with Probability < 100 — the engine first picks an entry by weight, then rolls its own probability gate before injecting.
  • Constant entries inside a group still mutually exclude; the group rule wins.

Recursion (Chain Reactions)

Recursion is when triggered entries scan each other's content for additional keyword matches, creating chain reactions.

Example: You have an entry for "Elves" that mentions "Silverwood Forest." If recursion is enabled, the "Silverwood Forest" entry also triggers because its keyword appeared in the Elves entry's content — even though nobody in the chat actually mentioned the forest.

Global Setting

Recursion is controlled at the lorebook level (on/off). When enabled, the engine performs multiple scan passes, each one scanning the previous pass's triggered entries as if they were new chat messages.

Per-Entry Recursion Controls

Each entry has four recursion settings for fine-grained control:

SettingEffect
Allow RecursionThis entry can be found via chain reactions. Default: off (entries are direct-match only unless you opt in).
Exclude RecursionThis entry will NOT be found during chain reactions — only direct chat matches trigger it.
Prevent RecursionThis entry's content will NOT trigger other entries. It stops the chain at itself.
Delay Until RecursionThis entry only activates at recursion level N. Level 0 = first pass (normal), level 1 = first recursion, level 2 = second recursion, etc.

Practical Scenarios

"I can start chains, but don't chain into me." Use Exclude Recursion. Good for important entries that should only respond to actual player discussion, not get swept up by tangential lore chains.

"I can be found, but I don't cascade." Use Prevent Recursion. Good for leaf-node entries that provide detail without spawning more chain reactions.

"Only find me in deep chains." Use Delay Until Recursion: 2. This entry only appears when the chain has gone at least two levels deep. Good for deeply hidden lore that only surfaces through a sequence of connections.

"I'm an explicit chain-starter." Set Allow Recursion on the entries that should be reachable by chain. Without it, the recursive scan ignores them.


Timing: Sticky, Cooldown, Delay & Frequency

Four timing controls let you manage when entries fire relative to their trigger moment.

Sticky

Once triggered, the entry stays active for N additional messages even if its keywords no longer appear. Useful for lore that should linger — if someone mentions the haunted forest, the eerie atmosphere should persist for a few turns, not vanish the moment the topic shifts.

Cooldown

After firing, the entry cannot fire again for N messages. Prevents the same lore from being re-injected every single turn. A cooldown of 5 means the entry waits at least 5 messages before it can trigger again.

Delay

The entry won't fire until N messages after its keywords first match. This creates a buildup effect — the party mentions the ancient temple, but the detailed lore about its traps doesn't appear until a few turns later, as if the characters are gradually discovering it.

Trigger Frequency (Advanced Mode)

In Advanced mode, each individual trigger keyword can have its own Frequency — a cooldown that applies only to that single keyword's ability to cause activation. Different triggers on the same entry can still fire while one is on cooldown.

This is different from the entry-level cooldown:

  • Entry cooldown: "After this entry fires, wait N turns before the whole entry can fire again."
  • Trigger frequency: "This specific keyword can only cause activation every N messages, but other keywords on this entry are unaffected."

Use trigger frequency to throttle hyperactive keywords ("dragon" appears in every paragraph of dragon-themed RP) without muting the rest of an entry's trigger list.


Additional Scan Sources

By default, entries only scan chat messages for keyword matches. You can expand what gets scanned per-entry:

SourceDefaultWhen to Enable
Chat messagesAlways on
Character descriptionOffEntries tied to what a character is (race, class, appearance)
Character personalityOffEntries tied to personality traits
User personaOffEntries that react to who the player is
ScenarioOffEntries tied to the current scenario or setting
Active presetOffEntries that adapt based on which preset is in use

These are per-entry settings — enable them only where they help. Scanning everything for every entry burns work the engine doesn't need to do.

Example

A lorebook entry about "Elven customs" has Character Description scanning enabled. If the character card mentions "elf" in its description, the customs entry activates for every turn — no chat keyword needed. The AI always knows elven customs when playing an elf character.


Character Filter (Whitelist / Blacklist)

Entries can be restricted to specific characters using whitelist or blacklist filtering:

ModeBehavior
WhitelistEntry only triggers when chatting with these characters or characters with these tags
BlacklistEntry never triggers for these characters or characters with these tags

Filter by character name or character tag. This is especially useful for shared lorebooks used across multiple characters:

  • A "Vampire Clans" entry whitelisted to characters tagged vampire
  • A "Human History" entry blacklisted from characters tagged alien (they wouldn't know it)
  • An "Embarrassing Memory" entry whitelisted to a specific character by name

In group chats, the filter is evaluated against the character currently speaking, so the same lorebook can serve different members of a party without leaking lore between them.


Memo (XML Wrapping)

Enabling Use Memo on an entry wraps its content in XML-style tags using the entry's title:

<Dragon Lore>
Dragons in this world are ancient beings of immense power.
They hoard knowledge, not gold.
</Dragon Lore>

This helps the AI distinguish between different pieces of injected lore. Without wrapping, multiple entries blend together as one wall of text. With wrapping, the AI can "see" where one piece of world info ends and another begins.

When to Use Memo

  • When you have many entries injecting at the same position
  • When entries contain conflicting or contrasting information that the AI needs to keep separate
  • When you want the AI to reference specific lore by name in its responses

When NOT to Use Memo

  • When a single entry is the only thing injected at a given position — wrapping adds noise without helping the AI separate anything.
  • When the AI is producing prose and the wrapper tag risks bleeding into the output.

Side Effects (Variable Mutations)

A triggered entry can change variables when it fires. This makes lorebooks active participants in stateful storytelling — not just passive context — and lets variables drive macros elsewhere in the prompt.

Each side effect has:

FieldDescription
TypeOne of: setvar (set to a value), addvar (append/concatenate), incvar (increase by amount), decvar (decrease by amount), delvar (delete).
VariableThe variable name to mutate.
ValueFor setvar/addvar — the string value.
AmountFor incvar/decvar — the numeric delta.
Scopelocal (this chat only) or global (across all chats for this user).

Two entry-level toggles shape when the effects run:

ToggleBehavior
Only On First TriggerThe effects run only the first time the entry fires in a session. Useful for "discovery" entries that should grant a flag once but not on every re-trigger.
Clear On DeactivateVariables set by this entry are reset when the entry stops matching. Useful for transient state — atmosphere flags, scene-specific moods.

Example

An entry "Met the Queen" with a side effect of setvar: met_queen = true (global) and Only On First Trigger fires once when the queen is first mentioned, sets a permanent flag, and then never sets it again. A different entry can read {{getvar::met_queen}} to remember whether you've actually met her in this campaign.


Macros in Lorebooks

Lorebook entry content supports the full macro system. Macros are resolved at injection time, so they always contain current values.

Common Macros in Entries

{{char}} is known throughout the land as a master swordsman.
{{user}} has heard rumors about the cursed blade.
The current time is {{time}}, and the {{weather}} weather affects visibility.

Lorebook-Specific Macros

You can reference other entries and lorebook metadata:

MacroDescription
{{lorebook::EntryName}}Get another entry's content by name
{{lorebookrandom::GroupName}}Random entry from an inclusion group
{{lorebookcount}}Number of currently triggered entries
{{lorebooktokens}}Token count of triggered entries
{{triggeredentries}}Comma-separated list of triggered entry names

Outlet Macros (Reusable Snippets)

Use {{lorebook:EntryName}} in your chat messages to expand an entry's content inline. This turns lorebook entries into reusable snippets:

Entry named "Shibuya Incident":

A catastrophic event that occurred on October 31st when cursed spirits launched a coordinated attack on Shibuya...

You type:

Remind me about {{lorebook:Shibuya Incident}}

What the AI sees:

Remind me about A catastrophic event that occurred on October 31st when cursed spirits launched a coordinated attack on Shibuya...

The entry must exist in an active lorebook attached to the current chat.


Multiple Lorebooks in One Chat

A single chat can use many lorebooks simultaneously. All attached lorebooks are processed together — their entries are merged into one pool and evaluated by the same trigger engine.

Layer lorebooks by role:

  • World lorebook — Geography, factions, history, magic system
  • Character lorebook — Deep lore specific to one character
  • Campaign lorebook — Current story arc, active quests, session notes

Entries from all lorebooks share the same token budget and compete on priority. An entry in your campaign lorebook with priority 100 will outrank a world lorebook entry with priority 10.

Active vs Available

  • Available lorebooks are everything in your library plus published lorebooks added from Discovery.
  • Active lorebooks are the subset attached to the current chat session.
  • Inside the chat panel, each active lorebook also has its own enabled toggle. Disabled but still-attached lorebooks contribute nothing to the prompt this turn but stay one click away from being switched back on.

You can reorder active lorebooks within a chat (drag in the panel). Order affects nothing engine-side — it's purely a sidebar convenience.


Per-Chat Overrides

You can customize a lorebook for your chats without modifying the upstream lorebook. Overrides apply to:

  • Top-level lorebook fields (name, description, global settings)
  • Individual entries (any field — content, triggers, priority, enabled state, etc.)
  • Added entries (new entries created locally without touching the source)

Overrides are stored separately from the base lorebook. They survive even if the upstream creator pushes updates — your tweaks aren't blown away. You can also republish your overrides back to the lorebook if you own it, turning your local drafts into the new canonical version.

For forked lorebooks, overrides are the layer where you make the fork yours without giving up the ability to sync upstream changes later.


The Editor: Two Views

Lorebooks ship with two editing surfaces. You pick what's right for the lorebook at hand.

Flat List

The traditional lorebook editor. Entries are grouped by behavior into collapsible buckets:

BucketContains
ConstantEntries with the Constant flag set (always fire)
SelectiveEntries with secondary-keyword logic (selective gating)
OtherEverything else (regular keyword-triggered entries)

Each entry shows its title, token cost, and a small badge for enabled/disabled state. You can:

  • Search — Filter by entry title or content via the search bar
  • Drag to reorder — Reorder entries within their bucket (sort order)
  • Bulk operations — Select multiple entries to toggle enabled, change category, or delete
  • Inline preview — Hover an entry to see its content preview
  • Quick-toggle — Click the enabled dot to flip a single entry on or off without opening it

Tree View

When a lorebook is managed by Compendium, the editor switches to a hierarchical tree:

  • Root nodes represent top-level categories (Characters, Locations, History, etc.)
  • Sub-nodes drill down into finer categories
  • Entries live at the leaves, with their full text accessible inline
  • Drag entries between nodes to reorganize (or let Compendium do it for you)
  • Each node carries an AI-written summary describing what's in the branch, used during retrieval

Tree User Constraints

Compendium-managed trees let you pin AI behavior per node. Right-click any node to set:

FlagBehavior
LockedThe AI may not modify, move, or delete anything inside this node. Safe haven for canon you don't want rewritten.
ForbiddenThe AI may not write new entries into this node. Existing entries can still be edited and read.
ReorganizeThe AI is encouraged to actively re-sort entries inside this node — explicitly opting in to AI shuffling for a branch you don't mind being touched.

Constraints persist with the lorebook and apply across every chat where Compendium is on. They're how you draw a line between "AI sandbox" and "my canon, hands off."

Both views support a search bar that filters entries by title and content. Matching nodes auto-expand in tree view so you can drill straight to what you're looking for.

Bulk Operations

Across both views, multi-select supports:

  • Toggle enabled on/off in bulk
  • Move to a different category (flat) or node (tree)
  • Delete (with confirm)
  • Adjust priority by delta (+10/-10)

The Chat Wing Panel

Inside an active chat, the Lorebook wing panel is your live workspace. It exposes:

  • Active lorebooks sidebar with per-book enabled toggles, entry/token stats, and a search bar for adding more
  • Add to chat — Pull a lorebook from your library or from Discovery into the active set
  • Inline editor — Click into an active lorebook to view and edit its entries without leaving the chat
  • Quick stats panel — Across all active lorebooks: total entries, active entries, total tokens
  • Compendium section — When Compendium is enabled, surfaces the tree, the activity feed, and the settings drawer for any managed lorebooks
  • Tree overview — A compact view of the active managed lorebooks' trees, with click-through to drill in

The wing remembers expand/collapse state, sidebar collapse state, and which lorebook you were viewing last.


Activation Logging (Activity Feed)

When a lorebook is managed by Compendium, the Activity Feed records every operation the engine and the sidecar perform — visible right there in the wing panel. Each entry shows:

FieldMeaning
PhaseWhen it happened: pre-gen, during-gen, post-gen, or summary
ActionWhat happened: Searched, Remembered, Updated, Forgot, Summarized, Reorganized, Merged/Split, Ingested, Triggered, Post-Gen status, Read History, Historian status
Entry / NodeWhich entry or tree node was touched
ModelWhich model performed the action (sidecar or narrator)
TimestampRelative time (5s, 2m, 1h, etc.) — updates live
Pulse glowFresh activity pulses for a few seconds before fading

The feed makes it visible why a particular piece of lore showed up (or didn't) — you can see the sidecar's reasoning trail and confirm that your trigger conditions are doing what you expect.

Even when Compendium is off, the regular keyword engine surfaces "Triggered" events so you can see which entries fired on each turn.


Token Budget & Cost Awareness

The lorebook editor and wing panel both surface token costs at multiple levels:

DisplayWhere
Per-entry token countIn the entry list and on the entry's detail panel
Per-lorebook totalIn the active lorebooks sidebar and on the lorebook's page
Cross-lorebook totalIn the wing panel's aggregate stats
Average tokens per entryIn the lorebook stats panel

Watching these numbers is the difference between a lorebook that quietly enriches scenes and one that eats the entire context window.

Budget Behaviors

Budget ModeWhat "Exceeded" Means
TokenThe sum of triggered entries' token counts exceeds the cap. Lowest-priority entries are dropped first.
EntryThe number of triggered entries exceeds the cap. Same priority-based dropping rules apply.

Entries with Ignore Budget are added first and never dropped. They count against the cap but they're guaranteed.


Lorebook Statuses & Visibility

Lorebooks share the same five-state lifecycle as other RoleCall content:

StatusWho Sees ItIn Discovery?
DraftOnly you (work in progress)No
PrivateOnly you (finished but private)No
PublishedEveryoneYes
ArchivedOnly you (read-only)No
Pending ReviewYou + moderatorsNo

Publishing a lorebook makes it discoverable. You can unpublish back to private at any time without losing the lorebook itself — your library copy stays intact.


Versioning & Rollback

Lorebooks support versioned snapshots so you can publish updates without breaking forks:

  • Every published version carries a version number
  • Snapshots capture the lorebook's state at a moment in time
  • Rollback restores the lorebook to an earlier snapshot
  • Content versions track entry-level history (you can see what changed in each entry between versions)
  • Publish from version lets you publish a specific snapshot as the new canonical version

When you fork someone else's lorebook, your fork records the source version. Later, upstream-diff can show you what changed between your fork's source version and the latest upstream — and sync lets you cherry-pick the upstream changes you want without losing your own customizations.


Forking

Forking lets you copy someone else's published lorebook into your library.

How It Works

  1. Find a lorebook on Discovery
  2. Click Fork — a copy lands in your library as a draft
  3. Customize anything: rename, edit entries, add new entries, delete what doesn't fit
  4. Attribution to the original creator is preserved

Attribution

Forked lorebooks preserve attribution to the original creator:

  • "Forked from Aetheria by @worldbuilder"
  • Attribution persists even if the original is later deleted or made private
  • The original lorebook's fork count increments as social proof

Syncing With Upstream

If the original creator publishes updates after you've forked, you can check for updates and selectively pull in changes:

  • Accept content — Pull updated entry content from upstream
  • Accept toggle — Pull upstream's enabled/disabled state for an entry
  • Reject — Keep your version for that entry
  • New entries on upstream can be added to your fork
  • Entries removed upstream stay in your fork (they're yours now)

It's cherry-picking, not auto-merging. Your customizations survive intact.


Bundling a Lorebook to a Character

Your lorebook can be bundled to a character by its creator — meaning every time someone starts a scene with that character, your lorebook auto-attaches to the session. This is one of the most powerful distribution paths a lorebook has: instead of waiting for users to find your lorebook on Discovery and manually add it to their chats, it arrives automatically when they open the character it belongs to.

How Bundling Works (Creator Perspective)

Character creators bundle lorebooks from the Lorebooks tab of the character editor. They can bundle:

  • Lorebooks they own — works you wrote specifically for this character
  • Lorebooks from their Library — including lorebooks they forked from other creators

When your lorebook is bundled by another creator, you receive attribution in the bundle — users can see that the lorebook came from you, with a link to your profile and the original lorebook's page.

What Bundling Means for Your Lorebook

When your lorebook is bundled to a character:

  • New users who play that character see your lorebook offered at session start
  • Each auto-attach is counted in your lorebook's usage stats
  • Users can disable the bundle per-session without affecting other users or the character itself
  • Forks of the character inherit the bundle — your lorebook travels with every fork of that character

Your lorebook retains its own publishing status independently. If you update or unpublish your lorebook, the bundle reflects the change — characters that bundled you will pull the new version (or stop offering the lorebook, if it's unpublished).

Cross-Creator Bundles

Another creator can bundle your lorebook if:

  • Your lorebook is published (publicly available)
  • The creator has forked your lorebook into their Library (they then bundle their fork, not the original)

If they bundle their fork, the lineage chain is preserved — the fork traces back to your original, and attribution is kept. You'll see fork counts accumulate from bundle inheritance as every fork of their character also inherits the fork of your lorebook.

Entry Order and Priority

When your lorebook is bundled alongside other lorebooks in the same character, all lorebooks share one trigger engine and one token budget per session. Your entries compete with entries from other active lorebooks on priority and probability.

If your lorebook covers topics where another bundled lorebook might also have entries, consider your default priority values carefully — higher priority entries are preserved when the token budget fills. Add clear titles and use Memo wrapping on entries that overlap with common topics.

Tips for Creators Whose Lorebooks Get Bundled

  • Write the lorebook as if it will be read without the character card. Users who bundle it with different characters need it to be self-contained — don't assume the character's name or backstory will always be present.
  • Keep bundled-ready lorebooks focused. A tight, well-organized lorebook with 30 targeted entries is a more compelling bundle than a 200-entry omnibus. Character creators are more likely to bundle something that complements their character card without overwhelming it.
  • Use clear, descriptive entry titles. Titles appear in the Lorebook wing panel inside the chat. Users who see "Dragon Clans of the Thornwood" understand what they're getting; "Entry 12" tells them nothing.
  • Version your lorebook. When you push an update, all characters that have bundled your lorebook (directly or via forks) will update automatically. Breaking changes can affect a lot of sessions — publish updates thoughtfully.

See the Characters doc for the character-creator's perspective on bundling, including how to add lorebooks to a character's bundle and set per-lorebook activation toggles.


Recommendations on Characters

Characters can list lorebooks as recommended content — and optionally flag them to auto-enable when the character is used in a chat.

  • Auto-enabled lorebooks are pulled into the active set automatically when a chat starts with that character
  • Recommendations show on the character's profile so users can one-click add them
  • Embedded lorebooks (see Import / Export below) come along when a character is exported

This is how you bundle a character with the world it lives in.


Import & Export

RoleCall supports importing and exporting lorebooks in several formats.

Import Formats

FormatNotes
SillyTavern World Info (JSON)Full round-trip compatible. The most common format.
SillyTavern Character Book (embedded in character JSON or PNG)Detected on character import — you're prompted to import the lorebook alongside
AgnaiConverted to RoleCall entries on import. One-way.
RoleCall v1.0 (JSON)Native format with all RoleCall-specific fields preserved.
Compendium Export (JSON)A managed lorebook plus its tree, summaries, and Compendium settings — round-trips between RoleCall users with everything intact.

When importing from SillyTavern, all entries arrive in Simple trigger mode. Switch to Advanced manually if you want per-keyword probability or special triggers.

Export Formats

FormatWhat's Included
SillyTavernCore fields preserved: keywords, secondary keywords, content, position, priority, scan depth, case sensitivity, match whole words, recursion settings, probability, sticky, cooldown, delay, group settings. RoleCall-only fields are dropped.
RoleCall v1.0All fields including comments, advanced triggers, per-trigger probabilities, character filters, side effects, boosting, scan source flags, recursion modes, origin tracking.
Compendium ExportThe lorebook plus its Compendium tree, AI-written node summaries, and Compendium settings.

Filtering on Export

When exporting you can filter entries before serialization:

FilterEffect
Enabled statusExport only enabled / only disabled / both
Constant flagExport only constants / only non-constants / both
PositionExport only entries at a specific injection position
TagsExport only entries with selected tags
Exclude IDsSkip a manual list of entry IDs

What Doesn't Survive a SillyTavern Round-Trip

These RoleCall-only features are preserved in the native format but won't transfer through SillyTavern:

  • Entry comments (internal notes)
  • Per-trigger probabilities (Advanced mode)
  • Probability mode (highest vs additive)
  • Emotion and narrative-conditional special triggers
  • Character filters (whitelist/blacklist)
  • Side effects (variable mutations)
  • Cross-entry boosting
  • Recursion exclude / prevent / delay-until controls
  • Scan source flags beyond chat messages
  • Origin tracking, tree categories, and Compendium metadata

Use the RoleCall format when sharing between RoleCall users; use SillyTavern when interoperability with other tools matters more than feature completeness.


Entry Origin Tracking

Every entry quietly tracks how it came into being. You see this as a small label on the entry's row.

OriginMeaning
InitialCreated when the lorebook was first imported or made
CreatedYou manually added it later
ImportedAdded by importing a file into an existing lorebook
DuplicatedCopied from another entry in this lorebook
MergedPulled in from another lorebook you own
ForkedCame along when you forked someone else's lorebook
RestoredBrought back from a rollback / earlier version

Origin labels are mostly informational — they make it easier to audit which entries are yours, which came from upstream, and which were generated by Compendium during ingest or post-gen.


Discovery & Social

Published lorebooks appear on the Discovery page where other users can find them.

How Discovery Works

  • Lorebooks are searchable by name, description, genre, fandom, and tag
  • Filter by tags, lorebook type, and content rating (when applicable)
  • Sort by rating, downloads, forks, or recency
  • Featured lorebooks are highlighted by staff curation

Social Metrics

Your lorebook's page shows engagement metrics:

MetricTracks
FavoritesHow many users have favorited the lorebook
DownloadsExport count
ForksHow many users have forked the lorebook
FansLorebook-specific patronage tracking

These metrics help users find well-received lorebooks and serve as social proof for your work.


Tips & Best Practices

Start simple. Use plain keywords in Simple mode. Add Advanced triggers only when you need them. Most lorebooks never need anything fancier.

Keep entries focused. One topic per entry. "Elven Culture" is better as separate entries for "Elven Language," "Elven Architecture," and "Elven Customs" — each with its own keywords and budget cost. The AI does better with five 100-token snippets than one 500-token wall.

Use priority strategically. Core world rules get high priority. Flavor text gets low priority. When the budget fills up, your essential lore survives.

Test with different scan depths. Too shallow and entries never trigger. Too deep and irrelevant lore from 50 messages ago keeps appearing. Start at 100 and tighten when you notice noise.

Combine inclusion groups with probability. A "Random Encounter" group with weighted entries creates organic variety without overwhelming the AI.

Don't overuse constants. Every constant entry burns tokens every turn. If something is truly static world info, consider putting it in the character description or system prompt instead — and reserve Constant for things that must be in every prompt.

Use Memo wrapping for clarity. When you have 10+ entries triggering at once, XML wrapping helps the AI parse what's what. For a single entry per position, leave Memo off — wrapping just adds noise.

Reach for sticky and cooldown before you increase scan depth. A 200-message scan depth catches everything but pays for it on every turn. Sticky + smaller scan depth gives you the same "lore lingers" feel for a fraction of the work.

Let Compendium organize big lorebooks. Above 50 entries, the flat list gets unwieldy and the regex engine gets noisy. Promote it to a managed lorebook, build the tree, and let the sidecar do retrieval. Use Locked on canon you don't want it touching.

Audit before publishing. Strip your comments out (or accept they'll be visible in RoleCall format export), make sure no test entries are left enabled, and run the Compendium diagnostics if it's a managed book. A clean publish is a forked publish.