• UnoRouterUNOROUTER
Documentation
  • Chat Guide
Getting Started
  • Getting Started
Characters & World
  • Characters
  • Personas
  • Lorebooks
  • Cards
Prompting
  • Presets
  • Prompt Template
  • Group Chats
Scripting
  • Macros (CBS)
  • Regex Scripts
  • Triggers & Lua
Context & Media
  • Memory & Context
  • Images
  • Custom Providers
Your Data
  • Your Data
Navigate
  • Models
  • Rankings
  • Inspector
  • Pricing
  • Chat
  • Status

Search docs...

Start typing to search documentation

PlatformIntegrationsChat
Chat Guide

Lorebooks

World knowledge that appears in the prompt exactly when it is relevant.

A lorebook is a collection of entries plus scan settings. Attach any number of books to a conversation; all attached books scan together as one pool.

SettingRangeEffect
scanDepth0-100How many recent messages are scanned for keywords. Both your messages and the character's count.
tokenBudget100-1000000Cap on the total tokens of activated entries. When books disagree, the highest budget wins.
recursiveScanningon / offActivated entry content is scanned again, letting lore activate more lore (up to 3 passes).

An entry has keys (comma-separated trigger words), optional secondary keys, and content. When any key appears in the scanned history, the entry activates and its content is injected.

Lorebook entry editor with content, activation keys, toggles, and insert order and priority fields

Selective mode requires a primary AND a secondary key to match. Constant entries skip matching and are always injected. Disabled entries stay in the book but never fire. Match whole words prevents fire from matching campfire.

Each entry has a display name (comment) used only for organizing the editor list; it is never sent to the model and survives import/export round-trips.

Two numbers control an entry's fate. Priority decides who survives the token budget: higher priority entries are kept first when space runs out.

Order (insertion order) decides placement among the survivors: higher order appears earlier in the prompt. Same order falls back to priority, then entry id.

All activated entries render into a single lorebook slot in the prompt template, each as its own message with its chosen role: system, user, or assistant.

There is no per-entry position concept; move the lorebook slot in the prompt template editor to control where lore lands relative to everything else.

Lines starting with @@ at the top of entry content tweak that entry's behavior:

text
@@probability 50
@@scan_depth 8
@@role assistant
@@activate_only_after 4
@@keep
DecoratorEffect
@@probabilityPercent chance to inject when activated; the roll is stable within a turn.
@@scan_depthOverride the book's scan depth for this entry.
@@order / @@priorityOverride placement order or budget priority for this entry.
@@roleOverride the injection role for this entry.
@@activate_only_after / @@activate_only_everyFire only after N messages, or only every N messages.
@@keep / @@dont_activate_after_matchKeep an entry active after its first match, or never activate again after a match.
@@is_greetingOnly active while the chat is still on the greeting message.

Token counting uses the active model's tokenizer, so the budget reflects what the model actually sees. When entries exceed the budget, the lowest-priority entries are dropped first.

If lore keeps getting cut, raise the budget, lower entry priority spread, or shorten entries. The request log shows exactly which entries made it into a given request.

PersonasCards

On this page

Books
Entries
Priority vs order
Injection
Decorators
Token budget behavior