Learn how to create smart, trigger-based lorebooks that save tokens and enhance your roleplay
Lorebook+ is a smart lore injection system that automatically adds relevant information to your AI conversations based on what you're talking about.
Traditional lorebooks dump ALL your lore into every message. This wastes tokens and can confuse the AI with irrelevant information.
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!
Only relevant lore is injected, dramatically reducing token usage
The AI only sees information relevant to the current conversation
Lore reveals naturally as topics come up in conversation
Entries can trigger other entries for rich world-building
Here's how to create your first Lorebook+ with trigger-based entries:
Go to the Lorebook+ tab and click "Create New Lorebook". Give it a name and description.
Each entry is a piece of lore with keywords that trigger it. Think of entries as "facts" about your world.
Choose words that, when mentioned in conversation, should trigger this lore to appear.
Make sure your lorebook is enabled in your collection. It will now work automatically!
Start simple! Create 3-5 entries for your most important world facts, then add more as needed.
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 |
{
"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 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 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"]
Example: You mention "kingdom" → Kingdom entry activates → Kingdom entry has trigger "magic" → Magic entry also activates!
This way, related lore automatically appears together.
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 |
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.
// 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 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 |
Higher priority entries appear FIRST in the injected content. The AI pays more attention to content at the beginning!
Filters give you fine-grained control over when entries activate. There are three types:
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"] }
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"] }
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"] }
You can use multiple filter types together:
"filters": { "requires_any": ["battle", "fight", "combat"], "not_with": ["peaceful", "calm"] }
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:
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
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 |
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"
}
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"]
}
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."
}
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."
}
Begin with 5-10 essential entries. You can always add more later. Too many entries can be overwhelming to manage.
Avoid generic words like "the", "is", "good". Use specific terms that clearly relate to your lore.
After creating entries, test them by having conversations that mention your keywords. Make sure the right lore appears!
If Entry A is about a kingdom and Entry B is about its magic system, have Entry A trigger "magic" so both appear together.
Save priority 9-10 for truly critical information like safewords or core character facts. Most entries should be 5-7.
Don't want to create entries one by one? Use Bulk Import to paste a complete JSON script with all your entries at once!
Go to the Lorebook+ tab and find the lorebook you want to add entries to.
This opens the bulk import modal where you can paste your JSON script.
Paste a JSON array containing all your entries. Each entry needs at least: name, keywords, and content.
Click "Validate JSON" to check for errors, then "Import Entries" to add them all at once!
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"]
}
}
]
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"]
}
}
]
" not single quotes '["word1", "word2"] not "word1, word2"" not ' or " (curly quotes)[ and end with ]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!