Lorebooks & Entries (WyvernChat)

If you'd like a prettier version of the following guide: https://sway.cloud.microsoft/cROC7llNDMMgV6Yg?ref=Link


Part 0: Why?

Why did I make this guide?

Because Lorebooks are one of the most slept-on tools in bot making. Not just for mere lore; they can be used to give instructions at system depth, as I discuss later in this guide. In this way, Lorebooks give you an incredible ability. You can flag story conditions and events to specific phrases, as well as temporary instructions to turn up the temperature on the user.

How do I make a new Lorebook?

A. By selecting the create new button in the side menu or on the Lorebook page.

Accessing the Side Menu + Create button:

Step 1: Select the three line widget in the top left of your screen. This opens up the Side menu.
Step 2: Click the + Create New button at the top of the Side menu, followed by the Lorebook button. It is the bottommost option.

You can also jump straight into a new Lorebook by clicking this link


Part 1: Lorebook Settings

(Definitions sourced from the amazing team of WyvernChat Wiki)

Lorebook Look Ma! I'm on a website!

Import Lorebook from File

Allows you to import an existing Lorebook from a file. This is useful for reusing previously created Lorebooks.

Display Image

An optional image that represents the Lorebook visually. It does not affect the Lorebook's function.

Name

The name of the Lorebook entry. This helps identify the Lorebook.

Description

A brief description of what the Lorebook contains.

Scan Depth

Defines how many past messages the system scans for keywords. A setting of "2" means it will check the last two messages for keywords, helping to keep the prompts relevant to recent interactions.

Token Budget

Sets the maximum number of tokens that Lorebook entries can use in a single prompt. If the total combined tokens of triggered entries exceed the set budget, only the highest-priority entries are included, while the rest are ignored.

Recursive Scanning

Enables or disables the feature that allows one Lorebook entry to trigger another. For example, if "Sword" in one entry mentions "Excalibur," and there's a separate Lorebook entry for "Excalibur," it will pull in that entry as well.

Token Count

How many tokens are in the entire Lorebook. Visible after the first entry.

Visibility

Controls who can view the Lorebook.
Options include:

  • Public: Anyone can access and use this Lorebook.
  • Private: Only the creator can access the Lorebook.

Rating

Sets the maturity level of the content:
Options include:

  • None: Safe for all audiences.
  • Mature: Suitable for a 17+ audience without explicit content.
  • Explicit: Contains graphic content, including violence or adult themes.

Part.2: Entry Settings

An empty entry. Where all good things begin

Name:

Used for organization – not included in context.

Example: 1F: Security

Content:

The information in question that gets sent to the AI. Try to keep this as short as possible.

Example: Infrared cameras dot every corner.

Comment:

Where you can give info on what the entry is about, go wild with fully fleshing out the lore and not worry about keeping things efficient – not included in context. Comments are not visible to users or in prompts but can help keep track of each entry's purpose.

Example: The security features that protect the first floor of Ignalis bank.

Keys:

Your keywords given to the system, which when mentioned in the chat, activate their respective lorebook entry.

Example: Camera, Left hallway, Right hallway, Main entrance, Side entrance.

Secondary Keys:

Used in combination with “Selective.” Secondarily, it can also be used to only allow a second entry to be called if a certain other entry is already being called, in combination with recursive scanning.

Example: First floor, 1F.

Shoutout to Ultimate for his concise definition and explanation of Secondary Key's on the WyvernChat Discord that I had to reread seven times to understand this.

Priority:

When the token budget of the Lorebook is full, and a new entry is activated. Priority order dictates the order which old entries are overwritten.

Enabled:

If an entry is active in the Lorebook. Often used in Lorebooks that are used with multiple characters or sorting larger world lore. Disabling this means the entry will be unable to be activated.

Case Sensitive:

If active, keys in chat will have to match exactly with the key’s set in the Lorebook.

Example. Say “Case Sensitivity” is active, and 1f is mentioned in chat. Because it is a lower case ‘f’ it will not activate the 1F Security entry.

Selective:

Used in combination with “Secondary Keys”. When active, an entry will need both the primary and secondary keys to be present to activate in chat.

Constant:

If activated, it eliminates the need for keywords and always has the entry in the prompt regardless of what keywords are in the chat. Good for the most important entries, like a summary of overall world lore.

Position:

Allows you to select if an entry will be inserted before or after the Definition, which will give it a greater or lesser impact on the chat. Select ‘Before’ for less impact, ‘After’ for more impact. In-chat let's you set the exact depth of the entry insertion.

Insertion Order:

When multiple entries are active, “Insertion Order” determines how they are ordered. The higher the "Insertion Order," the greater an impact the entry will have on the chat.

If done right, your Lorebook entry will look something like this in the creator:

And like this from the user end:


Intermission: Insertion Order VS. Priority


Table High Insertion Order Low Insertion Order
High Priority HIO: Will have a greater weight on output. (Story) & HP: Will stick around in context (memory) for longer, until all lower priority entries are overwritten. LIO: Low impact on the output. & HP: Will stick around in context (memory) for longer, until all lower priority entries are overwritten.
Low Priority HIO: Will have a greater weight on output. (Story) & LP: Will be forgotten (overwritten) faster. LIO: Low impact on output. & LP: Will be forgotten (overwritten) faster.

Examples used here:

HIO: 07 insertion order
LIO: 01 insertion order
High priority: 1
Low priority: 2


Part 3: Beginner's Advice

Do's and Don'ts:

Do! :) Don't! >:(
Use your Lorebook to store any lore that isn’t of immediate concern Overtype. Try to keep an entry short (100 tokens),{1} don't be afraid to leave some gaps for the AI to fill in on its own.
Write entries about your characters equipment, feelings about specific subjects, and hobbies. Write entries for things the ai already knows. (Testing will be necessary.{2})

{1}Note: This is a rule of thumb. Should you have a reason to make a word heavy entry (depth level system prompting,for example) then don't be concerned about it.
{2}Note: Testing can involve if keywords are functioning, whenever specific lines of the entry are necessary or are wasting tokens and etc. For more info, scroll down to Part 6 or read StatouTW Write up on Lorebook Testing


The Art of Picking Keywords: By Nandarch

Imagine you're writing a character and Lorebook, and you have a Lorebook entry with the keywords 'zombie', 'undead', 'walking dead', 'living dead'.
If you write the character to be set in a zombie apocalypse, that type of setting is probably pretty well represented in any given model's training data, and... well, it's a zombie apocalypse, so the LLM playing the character would probably fairly frequently bring up one of those keywords without too much prompting.
Now imagine you're writing a science fiction character instead, but you still have a Lorebook entry 'zombie'. The LLM is much less likely to independently use the word 'zombie' because it doesn't as much belong in that setting; you'd need to hint to the LLM that zombies are present in the setting in how you write the character.
Just expecting a character to use odd keywords - here I used 'zombie', but things like... the name of a city in your setting, for example; something original - isn't something that happens without it being in context in the first place.


Part 4: Creating Entries


What makes a good Entry?

Anything Important enough to write down yet is situational. Some examples:

a. NPC characters.
b. Major locations. (I.e. castles, schools, ports, black markets.)
c. Worldbuilding: i.e Factions & Key members
d. Important memories
e. Laws of the land.
f. Facts important to the character but will not always be relevant. (I.e. Exercise routine, classes, club uniform.)


Intermition: A note On What Makes Good Entries, by Feldherren

  • Worldbuilding. Details on the locations, concepts, creatures that exist in the setting that might unnecessarily bloat character definitions if included in full; this is best paired with breadcrumbs in the main definition, so the character knows they exist and roughly what they're like.
  • Character opinions - Char A thinks Char B is immature. If you include this in the main definition for Char A, this may result in Char B being played as a immature... but what if Char A is wrong/biased/lying? Lorebooks let you section off information slightly to prevent it from influencing RP too much.
  • Extensions of character definitions for specific greetings. Make the lorebook entry a full sentence from a particular greeting, set the scan depth of the lorebook up to a high value, and insert it directly after character defs; this essentially lets you write a custom scenario or add details that are only present for that single greeting. Unfortunately due to needing to tweak scan depth, outside of frontends that let you specify that per entry, this is kind of incompatible with doing anything else with that lorebook.

Crafting a Lorebook Entry:

How should you write an entry? There are a variety of formats you can choose to follow when writting entries. Here are some formatted examples:

danger: Some front ends include the name segment of your Lorebook in the "message" sent to the ai. Others do not. Unless you know without a doubt, default to including the name in the content.

Make sure to write your entries in the same format as your character to prevent confusion from the model


1. Plist (Keywords) Example:

  • Name: Red ogre
  • Key: Ruby, Ogre
  • Content: [Ruby ogre: enemy, red, valuable gem embedded in forehead, large, violent]

2. Ali:Chat Example:

On Wyvernchat, instead of using the '<START>' macro, we use '[Scene: xxx]' which allows a writter to add additional details.

  • Name: [Scene: {{char}} opinion about red ogres.]
  • Key: Ruby, Ogre
  • Content:

    {{user}}: “Ruby Ogres?”
    {{char}}: "Oh... Those things." {{char}} looks down at the beast with a grimace. "There so gross and always explode into a smelly mess when they finally go down. What’s worse, can barely even hit them or else that stupid ruby in their head will shatter. How they don’t shatter it on their own, by how aggressive they are is a miracle." {{char}} then shakes their head, whipping away the memory. "Point is, their gross. Now let’s get this over with."


3. JED (Point form) & Plaintext Hybrid Example:

  • Name: D&D Devil
  • Key: Abyss, Devil
  • Content:

    A lawful evil race that lives in the Nine Hells.
    Traits: Vindictive, monstrous, ambitious, cruel.
    Features:
    • Contracts: Devils make binding deals with mortals for exchanges.


4. Plaintext Example:

  • Name: Barbed Devil
  • Primary Key: Devil, Abyss
  • Secondary Key: Barbed, Hamatula
  • Content: Hamatulas, also known as Barbed Devils, are the guardians and patrollers of the Nine Hells. They are the greatest of the lesser devils and safeguard important, infernal locations. Barbed Devils are lithe, tall humanoids with purple scaly skin that are completely covered in barbs.

5. Worldbuilding Plist Example:

  • Name: Anchorome
  • Key: Anchorome, Archipelago, Maztica, Evermeet, Trackless Sea
  • Content: [Anchorome Achipelago(unexplored mysterious region of Faerûn.): Archipelago(Fertile islands and rough sea), locations(dungeon of Lopango, hidden societies), dangers(rough sea, pirates, unknown threats), geography(northwestern to the Trackless Sea, west of Evermeet, north of Maztica), icy region, lawless land.]

6. Worldbuilding Plaintext Example:

  • Name: Faerûn
  • Key: Faerûn, Faerun, Continent
  • Content: A fantastical landmass in the northern hemisphere of Toril. The defining feature on the continent is the Sea of Fallen Stars. Other such major locations are the Shaar, separating the area around the inland sea from the coastal nations. To Faerûn east is a vast region of steppes. To the north is massive glaciers and tundra. The south leads to the tropical land of Zakhara.

Part 5: Advanced Techniques


System Prompt Entries:


Introduction:

If you find that Character Note, Author Note, Reinforcement Prompt etc. are being too or not effective enough then you can use your Lorebook as an alternative. In addition, you can use it to make little tweaks to the narrative that activate at specific milestones.

Some examples of what you can put in entries:

  1. Genres
  2. Rules
  3. Lore
  4. A/N
  5. [Scene: xxx] notes to guide next scenes.
    Just remember to include the relevant keys. For example: If you want the story to become more suspenseful when the {{user}} enters the boss room, you can do what I did in the Setting/Event Example.

Setting/Event Example:

  • Name: Final Boss Fight
  • Primary Key: Final boss, Arthuria, Floor 99, The spire, Spire
  • Secondary Key: Boss room
  • Content:
    [Scene: After a long, hard fought journey against impossible odds, {{user}} has made it to the final fight to save princess. This will be their toughest, most unfair and brutal fight yet.]
    [Genre: Dark fantasy, Dungeon crawler, Thriller.]
    [System instructions for writing the final boss fight with Arthuria: Emphasize their monstrous form and nature, do not allow them to be beaten easily for they are unbeatable, use vivid imagery.]
    [Ways to defeat Arthuria: Activate the exposed water main pipe under her while she’s distracted.]

Constant Example:

As explained earlier: A constant entry is one that is always active regardless of keywords.

  • Name: Death Rule

-Key: N/A

  • Setting active: ‘Constant’
  • Content: [System note: Once a character dies, they are unable to revive.]

Story Flag (Plaintext & JED) Example:

  • Name: Vault Security
  • Key: Pellanstra, Secret, Drider, Spiderwebs, Inner vault
  • Content:

    [Scenario: After entering the vault, the narration shifts from action to horror. The vault is a 50-foot cube covered in indestructible webbing. The team will be ambushed by Pellanistra—scorned of the spider queen, the vault overseer and a gigantic, 8-armed, armoured Drider.]

[Writing instructions for Pellanistra: 1. Emphasize her monstrosity; her towering height and inhuman personality; and her delight in sadistically tormenting her enemies. 2. Convey her power; she is an unbeatable opponent for {{user}}. 3. Use vivid imagery. 4. Do not allow yourself to be easily beaten, seduced, or overpowered. Genre: Dark fantasy.]

[Pellanistra Combat: Pellanstra uses her size and mobility to her advantage, capturing enemies, then injecting them with her paralysis venom. Once paralyzed, she will web them up and hang them from the ceiling]


Effectively Using Secondary Keys:

As explained earlier, secondary keys allow us to control the activation of a entry even further by preventing false activations from common keywords. Bellow is two examples of the effective use of secondary keys and an explanation of what is happening.


1. Preventing duplicate information:

  • Name: Magical School Hogwarts
  • Primary Key: School
  • Secondary Key: Hogwarts
  • Content: Hogwarts is a Magical School with a bunch of idiots in it. I swear to God why are children fighting dark lords.

Q. What’s being done here?

A. Using Hogwarts as a Secondary Key prevents any haywire activations, say preventing the ai from auto generating Hogwarts when you’re exploring a Durmstrang, a different magical school.


2. Preventing lore leaks.

  • Name: Information about SCP-2000 restricted to security clearance level 4 personel
  • Primary Key: Restricted SCP, SCP2000, SCP-2000, Yellowstone, Revival
  • Secondary Key: Security clearance 4, restricted to security clearance level 4
  • Content: SCP-2000 is not just another foundation site. SCP-2000 is a subterranean Foundation installation originally constructed sometime in the last [REDACTED] years for the purpose of reconstructing civilization in the event that a K-Class end-of-the-world scenario could not be averted in time to prevent humanity's extinction or near-extinction. Since its inception, SCP-2000 has been activated at least twice.

Q. What are we doing here?

A. We are including lore/info that can only be accessed with additional requirements. It prevents characters with lower security clearances from leaking lore, while allowing those who should know the full SCP document, do.


Part 6: Help!


My entry isn't working properly!

Checklist:

• Check your entries, are they missing info? Do you forget to include the name of your subject manner?
• Did you mistype a keyword?
• Did you activate selective or recursive settings incorrectly?
• Did you write too much for the model to handle? (200+ tokens)

If your answer was 'NO' to all the above, you may wish to:

  1. Increase the token budget
  2. Use priority
  3. Increase scan depth
  4. Set entries to be inserted after character instead of before.

Index:

Edit Report
Pub: 28 Feb 2025 19:26 UTC
Edit: 21 Apr 2025 18:25 UTC
Views: 982