Hey all. I was experimenting with Silly Tavern lorebooks and I found a great, non-obvious implementation for lorebooks. It turns out that we are able to precisely guide our LLM during roleplay by triggering instructions from a lorebook. It works like OOC but on steroids. With a properly prepared lorebook, we can automatically roll a positive/negative results of our actions, to combat a positive bias but not only that. It's possible giving all kinds of instructions like that. Want a character to always do something in a particular situation? No problem. Want to add flavor or diversity to your roleplays? It all becomes possible.

image/png
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License (https://www.goodfon.com/fantasy/wallpaper-the-lord-of-the-rings-sauron-dark-lord-metal-helm.html)

Example Lorebooks:

  1. Navigate to the files depository of this post, download two exemplary lorebooks: "Busy at work" and "TTRPG - Resolution Mechanic". Try them out, check on how they are written and use them as a template to write your own!
  2. Lorebooks are located in (...)\SillyTavern\data\default-user\worlds. Just copy-paste my files or import them through SillyTavern import button.

How to write your own lorebooks:

1. Create a lorebook in Silly Tavern (I will not teach you in detail how to do that, my appologies - you need to find a guide online, there are many of them and it is actually super simple (for instance - read this: https://rentry.co/world-info-encyclopedia).

2. Create the entries with your lorebook and put them in the same group - add multiple entries first, each representing a given instruction or anything you want to happen in a given situation (like table of results of dice rolls in TTRPG). So for instance: entry1: {{char}} is currently busy, entry2: {{char}} is currently free, entry3: {{char}} will not answer a phone because something happened, do not reveal the {{char}} circumstances yet.

Each entry must have: a) the same trigger words, b) position = (System) (entries inserterted as system are will be sent to the LLM right with a message you type but automatically and they do not appear in a chat - so they work even if models do not understand OOC and if they do - it is still a more elegant, immersive and smooth experience, it does not eat up tokens because instructions will be deleted from a context automatically), c) depth = 1/0 (it determines if instruction is sent before your actual chat message or after, it does not seem to make a difference to LLM but if you want it to be more elegant in context inspection, use depth = 0), d) order = 100, e) trigger = 100, f) Prevent further recursion option: ON (entry will not activate other entries), g) group weight = 100/number of entries within your group (100 divided per total number of entries in a group) (it is super important since weight determines the probability of a given entry being randomly rolled, you can adjust probabilites for each entry but always keep the whole weights sum within the same group = 100), h) sticky = 4 or more/less (it makes the instruction for LLM remain active for a given number of the following messages - so it actually triggers logically within the scene, LLMs seem to understand it and do things under logical circumstances in the scene).

image/png

image/png

Remember, you can change the weights to trigger different events with different probabilities but do not leave them at 100 even if you want to roll from 2 entries in a group. Use 100 when you do not want to roll but trigger the entry through a trigger word, use 100/number of entries in a group (100 divided per total number of entries in a group) if you want to roll randomly which entry will be inserted.

3. Write instructions inside of the entries. They must be short, clear and include a specific phrase if you want something to happen now: "WILL INSTANTLY". Do not ask me why but otherwise different LLMs more often fail in following the instruction. I've tried Mistral, LLAMAs, Qwen, Gemma and other tunes - all behave in a very similar manner.

Template: {{char}} will instantly [ACTION YOU WANT CHARACTER TO PERFORM] or [EVENT YOU WANT] will instantly [HAPPEN}. Something like: "enemies will instantly attack {{user}}" or "road ahead will instantly turn out to be blocked".

Again, it seems that a phrase "will instantly" is the best working trigger.

image/png

image/png

TRICKS:

  1. It may be good using one, specific word to trigger the entry group so it does not trigger again and again with different results as you or LLM repeats the trigger word. You can use something like... "DC"/"AP" (difficulty challenge/action-perform; or you can come up with good trigger words so it triggers without you even doing anything! (like: attack - will roll the attack result from a lorebook with entries "successful attack/failed attack" being activated randomly within a group with the same trigger word.
  2. Depending on the use-case, you will need a couple of such entry groups (like different "dice rolls" for social encounters, different for random events in the world and different for dungeons exploring). IT WORKS VERY WELL.
  3. You can also steer {{char}}'s behavior precisely using this method to stick to the personality better or to make character consistently do given things in given situations (it seems to work better than pure card definitions).
  4. Use it in NSFW to add variety and logic to your roleplays - this way, {{char}}'s behavior is influenced better than while using normal, random lorebooks in a classical manner.
  5. Use it to counter a positive bias of the LLMs (a bias of cooperating with {{user}} when {{user}} does something - for instance, your sword swing will fail to connect with the enemy if you set it up to trigger like that. It works VERY WELL.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference API
Unable to determine this model's library. Check the docs .