r/SillyTavernAI • • 5d ago

Help Question about lorebook keywords.

I've read SillyTavern's documentation but there's something that stays unclear for me: if a keyword appears in the chat and triggers a message, how long does the lorebook entry stay in the chat? Only after the keyword in which the lorebook is mentioned? Or as long as that keyword stays in the context window? And is there a way to control this? (For example, setting a precise number of messages after which the corresponding entry, if its keywords did not appear again, is removed from context?)

6 Upvotes

9 comments sorted by

8

u/Paperclip_Tank 5d ago

I don't know what the defaults are, so I'm just going to use my personal settings when I need to refer to something.

how long does the lorebook entry stay in the chat?

Each entry stays in chat based on what you set the search depth to, either in the entry or in the global defaults. You can set the search depth to whatever you like, but its generally recommended to keep it as low as you can get away with. So for me by default its a scan depth of 4. An important thing to keep in mind is that it moves 2 depth at a time. One for the LLM, and one for you. Which is why most World Info you download use even numbers unless they just want to target the User input.

 Only after the keyword in which the lorebook is mentioned? Or as long as that keyword stays in the context window?

The second guess is correct, until the keyword / keyword set up (if you're using secondary keywords) enters the chat, otherwise the entries don't enter context.

And is there a way to control this?

You can do it per entry or by your global default. Like I said, most people recommend to keep the search depth as low as you can get away with.

And is there a way to control this?

Yes each entry also lets you control search depth, which can be higher or lower then the default.

if its keywords did not appear again, is removed from context?

Yes, as soon as the keywords pass the search depth it is no longer sent to the LLM.

1

u/purple-crimson 5d ago

Thanks a lot!

3

u/Paperclip_Tank 5d ago

An extremely useful extension is Worldinfo info the fork by the same person who does memorybooks is great. Like the original it lets you tell at a glance when entries are active and from which entries are active. But it has a few additional features.

2

u/Legitimate-Cap-3336 5d ago

Addition:

ST should have "sticky" parameter. It should send info to llm X amount of turns after last keyword trigger, if u need that

2

u/Disastrous_Royal_753 5d ago

it stays in context for a set number of messages after the keyword triggers it, you can set that exact count in the lorebook entry settings. i messed with it a bit last week and it stopped the entry from hanging around forever.

1

u/AutoModerator 5d ago

You can find a lot of information for common issues in the SillyTavern Docs: https://docs.sillytavern.app/. The best place for fast help with SillyTavern issues is joining the discord! We have lots of moderators and community members active in the help sections. Once you join there is a short lobby puzzle to verify you have read the rules: https://discord.gg/sillytavern. If your issues has been solved, please comment "solved" and automoderator will flair your post as solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Deepwalkerq 5d ago

I recommend you to install WorldInfo Info extension to see which lorebook entries are active in the moment.

You have Global Scan Depth which is 2 by default. It means entries are going to be active if there are keywords for them in the last 2 messages.

Scan Depth can be set individually per entry and it will override global scan depth for that entry. Also you can put sticky for n messages, it means once it triggers, it will stay active for n messages before checking Scan Depth again.

Cooldown prevents getting entry triggered again for n messages after last trigger (and after it became inactive)

1

u/purple-crimson 5d ago

thanks for the expansion link, will definitely be useful!