← Back to NovelEXE

📚 Lorebook+ Tutorial

Learn how to create smart, trigger-based lorebooks that save tokens and enhance your roleplay

📋 Table of Contents

🤔 What is Lorebook+?

Lorebook+ is a smart lore injection system that automatically adds relevant information to your AI conversations based on what you're talking about.

The Problem with Traditional Lorebooks

Traditional lorebooks dump ALL your lore into every message. This wastes tokens and can confuse the AI with irrelevant information.

How Lorebook+ is Different

Lorebook+ uses trigger keywords to only inject lore when it's relevant. If you mention "magic" in your conversation, only magic-related lore gets added!

💾 Saves Tokens

Only relevant lore is injected, dramatically reducing token usage

🎯 Context-Aware

The AI only sees information relevant to the current conversation

⚡ Dynamic

Lore reveals naturally as topics come up in conversation

🔗 Interconnected

Entries can trigger other entries for rich world-building

🚀 Getting Started

Here's how to create your first Lorebook+ with trigger-based entries:

  1. Create a Lorebook

    Go to the Lorebook+ tab and click "Create New Lorebook". Give it a name and description.

  2. Add Entries

    Each entry is a piece of lore with keywords that trigger it. Think of entries as "facts" about your world.

  3. Set Keywords

    Choose words that, when mentioned in conversation, should trigger this lore to appear.

  4. Enable the Lorebook

    Make sure your lorebook is enabled in your collection. It will now work automatically!

💡 Pro Tip

Start simple! Create 3-5 entries for your most important world facts, then add more as needed.

✏️ Creating Entries

Each entry in your lorebook has several fields. Here's what they mean:

Field Required Description
Name Yes A label for this entry (e.g., "Kingdom History")
Keywords Yes Words that trigger this entry (e.g., ["kingdom", "eldoria"])
Content Yes The actual lore text to inject
Priority Optional 1-10, higher = more important (default: 5)
Triggers Optional Keywords that can activate OTHER entries
Filters Optional Conditions for when this entry activates

Example Entry

{
  "name": "Kingdom of Eldoria",
  "keywords": ["eldoria", "kingdom", "realm"],
  "content": "The Kingdom of Eldoria is a vast realm known for its magical academies and ancient forests. The capital city, Crystalspire, sits atop a mountain of pure quartz.",
  "priority": 8,
  "triggers": ["magic", "academy", "crystalspire"]
}

🔑 Keywords & Triggers

Keywords (Input)

Keywords are words that activate this entry. When any keyword appears in the conversation, the entry is considered for injection.

// This entry activates when someone mentions magic, spells, or mana
"keywords": ["magic", "spell", "mana", "arcane"]

Triggers (Output)

Triggers are keywords that this entry can use to activate other entries. This creates a chain reaction!

// When this entry activates, it can also trigger entries about leylines or academies
"triggers": ["leylines", "academy", "weave"]

💡 How Triggers Work

Example: You mention "kingdom" → Kingdom entry activates → Kingdom entry has trigger "magic" → Magic entry also activates!

This way, related lore automatically appears together.

Choosing Good Keywords

Good keywords are specific and meaningful. Here's what to use and what to avoid:

✅ Good Keywords ❌ Bad Keywords
kingdom, eldoria, castle the, is, and
magic, spell, wizard it, that, this
dragon, fire, scales very, good, bad
sword, blade, weapon have, was, were
forest, trees, woods some, many, few

💡 Why Avoid Common Words?

Words like "the", "is", "human", "street" appear in almost every conversation. If you use them as keywords, your entry will trigger constantly, wasting tokens and confusing the AI.

Instead: Use specific nouns, names, and unique terms that clearly relate to your lore.

Keyword Best Practices

Real-World Examples

// Character entry - use character name and related terms
"keywords": ["sarah", "blacksmith", "forge", "hammer"]

// Location entry - use place name and distinctive features
"keywords": ["tavern", "prancing pony", "inn", "ale"]

// Magic system - use magic-related terms
"keywords": ["magic", "spell", "mana", "cast", "enchant"]

// Combat style - use fighting terms
"keywords": ["sword", "blade", "duel", "combat"]

Priority System

Priority determines the order in which entries appear and which ones take precedence. Scale is 1-10.

Priority Use For Example
10 Critical / Safety Safewords, core rules
8-9 Very Important Main character info, key locations
5-7 Standard Lore World facts, side characters
3-4 Background Details Flavor text, minor details
1-2 Rare / Optional Easter eggs, random events

⚠️ Important

Higher priority entries appear FIRST in the injected content. The AI pays more attention to content at the beginning!

🔍 Using Filters

Filters give you fine-grained control over when entries activate. There are three types:

1. requires_any

Entry only activates if at least one of these words is also present.

// This magic entry only activates if "eldoria" or "academy" is also mentioned
"filters": {
  "requires_any": ["eldoria", "academy"]
}

2. requires_all

Entry only activates if ALL of these words are present.

// This secret only reveals if BOTH "ancient" AND "war" are mentioned
"filters": {
  "requires_all": ["ancient", "war"]
}

3. not_with

Entry will NOT activate if any of these words are present.

// Don't show magic lore if the conversation is about mundane/normal things
"filters": {
  "not_with": ["mundane", "ordinary", "normal"]
}

Combining Filters

You can use multiple filter types together:

"filters": {
  "requires_any": ["battle", "fight", "combat"],
  "not_with": ["peaceful", "calm"]
}

🔧 Advanced Features

Minimum Messages

Some lore should only appear after the conversation has progressed. Use min_messages to delay entries.

// This secret only appears after 20+ messages in the conversation
"min_messages": 20

Use cases:

Probability

Add randomness with probability (0.0 to 1.0). Great for random events!

// 30% chance to activate when keywords match
"probability": 0.3

// 80% chance (fairly likely)
"probability": 0.8

// 100% chance (always, this is the default)
"probability": 1.0

Injection Types

Control WHERE the lore gets injected with injection_type:

Type Description Best For
context General context (default) Most lore entries
scenario Scene/setting information Location descriptions
personality Character traits Character behavior
system System-level instructions Safewords, rules

📖 Real Examples

Example 1: Safeword System

A critical entry that should always take priority:

{
  "name": "Safeword Protocol",
  "keywords": ["red", "yellow", "safeword"],
  "priority": 10,
  "content": "[SYSTEM] If user says 'Red', immediately stop all actions and check in. If 'Yellow', pause and ask if they want to continue differently.",
  "injection_type": "system"
}

Example 2: Character Background

Reveals character history when relevant topics come up:

{
  "name": "Character Childhood",
  "keywords": ["past", "childhood", "grew up", "family"],
  "priority": 7,
  "min_messages": 5,
  "content": " grew up in a small fishing village. Their father was a sailor who was lost at sea when they were young.",
  "triggers": ["father", "village", "sea"]
}

Example 3: Location with Conditions

Only shows when talking about the location in a magical context:

{
  "name": "Enchanted Forest",
  "keywords": ["forest", "woods", "trees"],
  "priority": 6,
  "filters": {
    "requires_any": ["magic", "enchanted", "mysterious"],
    "not_with": ["city", "urban"]
  },
  "content": "The Whispering Woods are ancient and magical. The trees here can speak, and spirits roam freely at night."
}

Example 4: Secret with Probability

A secret that might reveal itself randomly:

{
  "name": "Hidden Truth",
  "keywords": ["secret", "truth", "hidden"],
  "priority": 9,
  "min_messages": 30,
  "probability": 0.5,
  "content": " harbors a dark secret: they were once a member of the Shadow Cult before escaping."
}

Tips & Best Practices

💡 Start Small

Begin with 5-10 essential entries. You can always add more later. Too many entries can be overwhelming to manage.

💡 Use Specific Keywords

Avoid generic words like "the", "is", "good". Use specific terms that clearly relate to your lore.

💡 Test Your Triggers

After creating entries, test them by having conversations that mention your keywords. Make sure the right lore appears!

💡 Use Triggers for Related Lore

If Entry A is about a kingdom and Entry B is about its magic system, have Entry A trigger "magic" so both appear together.

💡 Reserve High Priority

Save priority 9-10 for truly critical information like safewords or core character facts. Most entries should be 5-7.

⚠️ Common Mistakes

  • Using too many keywords (causes false triggers)
  • Setting all entries to priority 10 (defeats the purpose)
  • Writing very long content (wastes tokens)
  • Forgetting to enable the lorebook

Content Writing Tips

📋 Bulk Import (Advanced)

Don't want to create entries one by one? Use Bulk Import to paste a complete JSON script with all your entries at once!

How to Use Bulk Import

  1. Open Your Lorebook

    Go to the Lorebook+ tab and find the lorebook you want to add entries to.

  2. Click "📋 Bulk Import"

    This opens the bulk import modal where you can paste your JSON script.

  3. Paste Your JSON Script

    Paste a JSON array containing all your entries. Each entry needs at least: name, keywords, and content.

  4. Validate & Import

    Click "Validate JSON" to check for errors, then "Import Entries" to add them all at once!

JSON Script Format

Your script must be a JSON array (starts with [ and ends with ]). Each entry is an object with these fields:

[
  {
    "name": "Entry Name",           // Required
    "keywords": ["word1", "word2"],  // Required - array of strings
    "content": "The lore text...",   // Required
    "priority": 5,                   // Optional (1-10, default: 5)
    "triggers": ["trigger1"],        // Optional - activates other entries
    "min_messages": 0,              // Optional (default: 0)
    "probability": 1.0,             // Optional (0.0-1.0, default: 1.0)
    "filters": {                     // Optional
      "requires_any": ["word"],
      "requires_all": ["word"],
      "not_with": ["word"]
    }
  }
]

Complete Example Script

Here's a full example you can copy and modify:

[
  {
    "name": "Safeword Protocol",
    "keywords": ["red", "yellow", "safeword", "stop"],
    "content": "[SYSTEM] If the user says 'Red', immediately stop and check in. If 'Yellow', pause and ask if they want to slow down.",
    "priority": 10,
    "min_messages": 0
  },
  {
    "name": "Kingdom of Eldoria",
    "keywords": ["eldoria", "kingdom", "realm", "castle"],
    "content": "The Kingdom of Eldoria is a vast realm known for its magical academies. The capital, Crystalspire, sits atop a mountain of pure quartz.",
    "priority": 8,
    "triggers": ["magic", "academy", "crystalspire"]
  },
  {
    "name": "Magic System",
    "keywords": ["magic", "spell", "mana", "arcane"],
    "content": "Magic in Eldoria flows through ley lines beneath the earth. Practitioners can sense and manipulate this energy.",
    "priority": 7,
    "triggers": ["leylines", "energy"],
    "filters": {
      "not_with": ["mundane", "ordinary"]
    }
  },
  {
    "name": "Romance Scene",
    "keywords": ["kiss", "romantic", "love", "intimate"],
    "content": " feels a warm flutter in their chest, drawn to 's presence. The atmosphere becomes tender and romantic.",
    "priority": 7,
    "triggers": ["affection", "tender"],
    "min_messages": 3
  },
  {
    "name": "Combat Mode",
    "keywords": ["fight", "attack", "battle", "combat"],
    "content": " shifts into a combat stance, muscles tensing as adrenaline surges through their body. They are ready to fight.",
    "priority": 8,
    "triggers": ["weapon", "defense"],
    "filters": {
      "not_with": ["peaceful", "calm", "relaxed"]
    }
  }
]

💡 Pro Tips for Bulk Import

  • Use a code editor (VS Code, Notepad++) to write your JSON - it helps catch syntax errors
  • Always click "Validate JSON" before importing to check for errors
  • Make sure strings use double quotes " not single quotes '
  • Don't forget commas between entries (but no comma after the last one!)
  • Keywords must be an array: ["word1", "word2"] not "word1, word2"

⚠️ Common JSON Errors

  • Missing comma: Each entry needs a comma after it (except the last one)
  • Wrong quotes: Use " not ' or " (curly quotes)
  • Trailing comma: No comma after the last entry in the array
  • Missing brackets: Array must start with [ and end with ]

Plain Text Version (Copy-Paste Ready)

Here's the same example without syntax highlighting - ready to copy:

[
  {
    "name": "Safeword Protocol",
    "keywords": ["red", "yellow", "safeword", "stop"],
    "content": "[SYSTEM] If the user says 'Red', immediately stop and check in. If 'Yellow', pause and ask if they want to slow down.",
    "priority": 10
  },
  {
    "name": "Kingdom of Eldoria",
    "keywords": ["eldoria", "kingdom", "realm", "castle"],
    "content": "The Kingdom of Eldoria is a vast realm known for its magical academies. The capital, Crystalspire, sits atop a mountain of pure quartz.",
    "priority": 8,
    "triggers": ["magic", "academy"]
  },
  {
    "name": "Romance Scene",
    "keywords": ["kiss", "romantic", "love", "intimate"],
    "content": " feels a warm flutter in their chest, drawn to 's presence.",
    "priority": 7,
    "min_messages": 3
  }
]

Need help? Join our Discord server for support!

← Back to NovelEXE