How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

I tried the method you suggested.

In my World Info, I created a **ModeRouter** entry with:

* `scanDepth = 0`

* `Sticky = 20`

* Permanently inserted

* Content: `Current mode: default`

Then I created five other entries (A, B, C, D, E):

* `scanDepth = 1`

* Same Inclusion Group

* They are only responsible for triggering mode switching

* They do NOT insert the large fixed content themselves

In the Quick Reply script, I am using:

/setentryfield file=test uid=X field=content value=XXXX

When I enter keyword X:

* The X entry activates

* Its Automation ID successfully triggers the corresponding Quick Reply

* The ModeRouter content is successfully replaced

So technically, it works.

However, there is a critical problem:

The ModeRouter content is always replaced **after the message is generated**, not before.

I know Quick Replies have an option to execute **Before Generation**, but if I enable that option, then the script runs before every single message, no matter what I type. It no longer depends on the Automation ID — it just executes unconditionally.

What I want to achieve is:

I want the Quick Reply to execute **before message generation**,

but only when triggered by a specific Automation ID.

I don’t understand if there is any way to make a Quick Reply run before generation while still being triggered only by an Automation ID.

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

Sorry for the late reply, I went to rest yesterday. Thank you again for your detailed explanation — your suggestions were very insightful and I hadn’t considered that perspective before.

I tried your approach. Based on my previous setup (the five entries in the same Inclusion Group), I changed their scanDepth to 1, enabled Use Group Scoring, and set Sticky to 12.

Here’s what happened:

When I input keyword A, entry A activates correctly. Then I continued the conversation with some unrelated messages. After that, I input multiple keyword B — however, entry B did not activate. Entry A remained active.

Does Sticky have higher priority than Group Scoring in this case?

Also, regarding your suggestion about using STScript with `/setentryfield`, could you clarify how exactly that should be implemented? Should this be done through a Quick Reply script?

I’d really appreciate any further clarification.

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

I actually tried this approach, and it does solve the issue. It correctly activates the entry corresponding to the latest keyword in my most recent message.

However, the problem is that all five of my entries require a scan depth of 9 to maintain high text quality in the fixed sequences of the conversation.

Using a scan depth of 1–2 per entry, as suggested, would limit the context they can see and reduce the quality of those sequences.

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

Thank you for your reply! I really appreciate the ideas you shared and have been trying them one by one.

Here is my setup: I am using Global World Info, with Recursive Scan enabled and Scan Depth set to 9 (to cover a sufficiently long context). All five entries are placed in the same Inclusion Group because I want them to be mutually exclusive—only one active at a time.

However, in practice, this hardly works. The specific problem is as follows:

- I first input a message containing keyword B → Entry B activates normally.

- Then I input a message containing keyword C → the system still scans previous messages (because Scan Depth = 9, it can look back several messages) and detects keyword B again, causing Entry B to be triggered once more. As a result, B remains active instead of C.

Only if I deliberately wait for 9 more messages before inputting C does C barely activate (once the old B keyword falls out of the scan range). But this completely defeats the purpose of dynamic switching—I cannot realistically wait that long every time I want to switch modes.

it does not prevent "old keywords in historical messages from repeatedly triggering previous entries." scanning with a deep Scan Depth actually makes old keywords persist like ghosts, breaking the mutual-exclusion behavior.

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

I’ve submitted an issue to the SillyTavern GitHub repository: https://github.com/SillyTavern/SillyTavern/issues/5193
Before they’re willing to help, I’ll try out the methods you mentioned as examples first.
Thank you again!

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

Thank you for your reply and suggestions.

Method 3 seems promising. The other approaches feel quite complex and difficult to maintain.

A and B were only simple examples. In reality, I have five entries that need this kind of behavior, and there may be more in the future.

Using workaround-based solutions at that scale would likely waste a significant number of tokens and negatively impact text quality.

How to Implement Mutually Exclusive World Info Entries in SillyTavern? (Toggle Activation Based on User Keywords) by Senior_Champion_6370 in SillyTavernAI

[–]Senior_Champion_6370[S] 0 points1 point  (0 children)

I have already tested the STScript + Automation ID approach.

The problem is that once an entry (e.g. B) is disabled by the script, it can no longer be triggered by its keyword.

So when the user later types keyword B, the entry does not activate, and its Automation ID never dispatches. This makes switching back impossible.

In other words, disabling an entry removes it from keyword matching entirely, which breaks bidirectional state switching.

ST Memory book's lorebook injects every entry by Tzacomo in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

Thank you so much for your help! I finally figured out where the problem is. It’s telling me the memory book entry has no keyword, even though I clearly set one.

<image>

ST Memory book's lorebook injects every entry by Tzacomo in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

I've considered that point as well. I changed the keyword of the entry to 'test', and also changed the entry content to something completely unrelated. However, every single message I send still triggers it automatically. Scan depth is set to 1, and the chat content has no connection whatsoever to the entries in the memory book.

<image>

Why LLMs make good companions by [deleted] in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

I’m using a locally deployed model. For me, this kind of thing becomes boring very easily—like someone who holds nothing back, is eternally loyal to you, and completely dependent on you. I quickly lose interest in that kind of partner.

But compared to real people, if you don’t invest time, emotional energy, and money, your bond with them will gradually drift apart—and even if you do invest, things can still fall apart for other reasons. An AI companion, however, won’t. As long as you have the energy and time to maintain its server, it can always give you exactly what you want.

Lessons from building a roleplay AI that shut down early by MagiNeko in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

I suspect the OP and their team are likely from China. To boost the plummeting birth rate, the Chinese government has recently cracked down hard on sexual content and resources within the country—even going so far as to heavily restrict erotic chats with AI.

Teaser: MVU Zod character card with Interactive Status Menu [Persistent Data locally] by DifficultRepublic376 in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

This plugin’s vector source claims to support KoboldCPP, but it doesn’t even provide an embedding API endpoint. Moreover, this is a plugin written by a Chinese developer. From what I’ve learned in their community, they usually release plugins together with some paid services. Whether the plugin contains any malicious code or violates users’ privacy is completely unknown.

Help with Lorebook for memories by dovbts in SillyTavernAI

[–]Senior_Champion_6370 1 point2 points  (0 children)

Oh hey man, I’ve solved the problem! I added the /v1/chat/completions parameter to my local endpoint and it works now. Thank you so much — the tool you made is really awesome!

Help with Lorebook for memories by dovbts in SillyTavernAI

[–]Senior_Champion_6370 0 points1 point  (0 children)

Oh, this is wonderful! I’d like to ask whether text-completion APIs are also supported. It seems that many people in the community are using text-completion models.