Lorebooks and world info

This guide is adapted from the one found at https://rentry.co/world-info-encyclopedia

World Info is a crucial component in crafting a consistent and immersive environment for your characters. It provides essential background details that enrich the storytelling experience. At a high level, World Info lets you customize the chat experience using "Lorebooks". You can think of lorebooks as dictionaries that insert definitions of certain terms if the term is discovered in the chat text. Here’s a structured guide to utilizing World Info effectively:

How World Info functions:

  • Lorebook attachment: Multiple Lorebooks can be linked to a chat, each containing various entries. Every entry is like a dictionary with a key and a value.

  • Message scanning: Chat messages undergo a scan to identify matching lorebook entries.

  • Entry activation: When a message contains a key matching an entry, the content of that entry is incorporated into the chat.

  • Content integration: Only the content of an activated entry is added to the chat.

Core components:

  1. Lorebooks: Dictionaries that contain multiple entries. Every entry is like a dictionary where a term (a key) is associated with a value (the content).

  2. Scan depth: Defines the number of past messages reviewed for Lorebook entries.

  3. World info allocation: Determines the proportion of context devoted to Lorebooks, as opposed to chat history and other elements.


Lorebooks let you add more context about the world and the characters. Every lorebook consists of multiple entries that can be activated by a set of primary keys and (optionally) secondary keys.

Lorebooks serve as the foundation for embedding detailed background information into chats. Each Lorebook is customizable with the following settings:

Basic settings:

  1. Name: Identifies the Lorebook.

  2. Description: Provides context and details about the Lorebook.

  3. Public Lorebook: Option to make the Lorebook accessible to other users.

  4. Lorebook Entries: A list of all entries tied to the Lorebook. Unless disabled, all entries are utilized in a chat when the Lorebook is added.

Entry activation mechanics:

  1. Key: Keywords or phrases triggering Lorebook entries upon their detection in a chat.

  2. Condition (Optional):

    • AND: Requires both a primary key and a secondary key to activate an entry.

      • Example: An entry with primary key [John Snow] and secondary key [Castle Black] activates only if both appear in the chat.

    • NOT: Activates an entry if a primary key is present, but none of the secondary keys are.

      • Example: With primary key [John Snow] and secondary key [Castle Black], the entry triggers only if John Snow appears without Castle Black.

  3. Secondary Key (Optional): Additional keys that influence entry activation.

Content and prioritization:

  1. Content: The text inserted into the context when an entry is activated.

  2. Probability: Dictates the likelihood of entry insertion upon key activation, adding an element of unpredictability to the story.

  3. Order: Determines the sequence of entry insertion in the Lorebook, with higher numbers indicating later placement in the prompt.

  4. Enabled: Controls whether an entry is active for key matching. Useful for keeping work-in-progress entries without deletion.

  5. Recursive Disabled: Prevents the entry from being triggered by other entries when recursive scanning is enabled.

Scan depth

Definition: Scan Depth refers to the specific count of the most recent messages in the chat history that are analyzed for matching keywords.


  • Starting point: The scanning process initiates from the end of the chat history.

  • Depth calculation: The value of Scan Depth determines the number of messages reviewed, counting backwards from the most recent.

  • Example: With a Scan Depth set to 2, the system will examine the two latest messages in the chat, which includes the user's most recent input.

Usage Note: The chosen Scan Depth value directly influences the relevance and immediacy of the keywords detected, impacting the subsequent interactions and content generation.

World info allocation

World info allocation is a key feature that helps in fine-tuning the balance between the contextual background provided by World Info and the immediacy of chat history, memories, and example dialogues. Here's how to manage this effectively:

  • Purpose: It determines the priority given to World Info versus recent interactions and stored memories.

  • Adjustment:

    • Increase: To emphasize the lore and background details, raise the World Info Allocation. This makes the generated responses more reflective of the established world and its nuances.

    • Decrease: If the focus should be more on recent chat interactions, memories, and direct dialogues, lowering this setting will achieve that. It ensures responses are more aligned with recent chat history and immediate context.

By adjusting the World Info Allocation, you can shape the narrative experience to either highlight the rich background of your world or focus on the dynamics of recent conversations and interactions.

Advanced settings

The advanced settings in World info offer nuanced control over how your lore is integrated into the chat. Let's delve deeper into these features:

Recursive Search

  • Functionality: When activated, entries can trigger additional entries.

  • Concept of Recursion: Essentially, recursion means repeating a process under certain conditions, akin to looping. In World Info, recursion manifests through the interplay of keys and subkeys.

  • Example with Farlandia's Monsters:

    • Primary Key: "monsters"; Value: [Farlandia's monsters: slimes]

    • Subkey: "slimes"; Value: [slime: enemy, slimeball, made of gelatin, bounces to move, annoyance]

  • Behavior with Recursion: If "monsters" is mentioned, both the primary and subkey information ("monsters" and "slimes") are injected into the context.

  • Recursion Mechanics: It scans words from a primary pair and seeks matching subkeys, injecting relevant pairs into the context. This enables a hierarchical, tree-like structure of lore elements.

  • Strategic Use: Recursion can be used to construct detailed lore hierarchies, enhancing world complexity.

Match Whole Words

  • Functionality: When enabled, keys are activated only if they appear as standalone words.

  • Behavioral example: With a key like "now", it won't trigger in the phrase "John Snow" because it's part of a larger word.

  • Default setting: This feature is typically turned off by default.

Case sensitivity

  • Functionality: When this setting is enabled, key matching becomes sensitive to letter case.

  • Example: The key "tyrion" will not match with "Tyrion" due to the difference in case (lowercase vs. uppercase 'T').

  • Selective recursion: Sometimes, it might be beneficial to disable recursion for specific entries, like alternative outfits or buildings. This prevents unwanted triggering of related lore.

  • Customizing settings: Experiment with these settings to determine the best configuration for your world's lore and storytelling needs.

Last updated