You mentioned one name. Five entries walked in.
"Why did one keyword pull five entries into my prompt?" That is recursive scanning doing its job: the content of an activated entry becomes scan text too, so entries can summon other entries. A spec sheet for the mechanism — how chains advance, the three things that stop them (dedup, depth, budget), what the three per-entry switches do, plus a reproducible five-entry runaway case and the two built-in tools that show you the chain.

“Let’s head back to the sect.” Six words. Then you open the prompt inspector and find five lorebook entries injected: the sect, its leader, the heirloom sword, the sword spirit, and the previous owner’s full biography. You typed exactly one of those names. Nothing is broken — that is recursive scanning doing precisely what it was built to do. Our case file on lorebooks handled the opposite complaint, entries that never fire. This is the spec sheet for the other direction: why entries trigger each other, how far a chain travels, where it stops, and which switch to reach for when it runs away.
What is lorebook recursion?
Recursion is the lorebook’s chaining mechanism. Normal activation scans only the last few chat messages for keywords. With recursion on, the content of every activated entry becomes scan text as well — if that content mentions another entry’s keyword, that entry is pulled in too. In one sentence: entries can summon entries.
The SillyTavern World Info docs demonstrate it with livestock (checked 2026-07-18): entry one is keyed to “Bessie” and its content says Bessie the cow is friends with Rufus; entry two is keyed to “Rufus.” Mention only Bessie in chat, and both entries enter the context. The problem it solves is real: lore has structure. When the sect comes up, the dossier on its heirloom sword should follow on its own — the player shouldn’t have to recite every proper noun out loud.
It only works if you switched it on. In Foreverse, recursive scan ships off; the toggle sits in Settings → Tavern global settings → Lorebook & rendering, and its one-line subtitle is the whole definition: entry content is also used as a keyword source.
How does a chain advance, and where does it stop?
Chains move in rounds. Round one scans only the chat history. Each round’s newly activated entries contribute their content to the next round’s scan. This repeats until there are no new matches — or until the chain hits one of two ceilings, depth or budget. One rule keeps every chain finite: an entry activates at most once per generation, so entry A mentioning B while B mentions A back produces no infinite loop. The chain must converge.
Of the stopping conditions, Max recursion steps is the dial in your hands, one row below the recursion toggle. The official docs’ reading (checked 2026-07-18): a value of 1 effectively disables recursion — the check stops after the first sweep; 2 lets the chain take one hop; 3 allows two. Note that steps limit depth, not volume: ten entries matching in the same round still count as a single hop.
Used deliberately, the same mechanism is the closest thing lorebooks have to associative memory, and it is worth designing for rather than merely surviving. Scan depth only covers the last few messages, so an entry the chat drifted away from six turns ago goes cold. A recursion hook fixes that: write the sword’s keyword into the sect’s entry on purpose, and the sword’s dossier rides along whenever the sect comes up, no matter how long ago the sword itself was last mentioned. The case file reached the same advice from the debugging side; the spec view adds the discipline — every name you drop in an entry’s content is a link you are wiring, so drop them on purpose.
What does a runaway look like? A five-entry repro
The recipe for a runaway is character and item entries name-dropping each other in their content. Five entries: the sect’s dossier mentions its leader and the heirloom sword; the sword’s entry mentions the sword spirit, Ruan; Ruan’s entry mentions the previous owner. The player types “back to the sect” — the chain takes three hops, and all five walk in.
Each entry reads fine in isolation; of course the sect’s dossier names its leader. The chain effect only appears when they combine, and it bills you twice. The token bill: five entries at 100 to 200 words each, and a six-word message has spent most of your injection budget. Once the budget fills, entries beyond it are dropped silently — the model never says which dossier it didn’t receive; it just starts improvising. The docs also specify the queue order (checked 2026-07-18): directly-keyed entries take budget priority over entries pulled in by recursion, so the end of the chain is sacrificed first. And the bill recurs: as long as “the sect” stays inside the scan window, all five re-inject on every single turn, not just the one where you typed it. The attention bill is sneakier: you wanted to visit the sect, but the model spends its paragraphs on Ruan and the previous owner’s old grudges, because that is what most of its handout covers. That is how a scene gets hijacked by a family tree.
Three per-entry switches, one job each
Below the global toggle, every entry carries three recursion switches of its own, grouped in the entry editor. They answer three different questions: can this entry be dragged in by a chain, does the chain continue past this entry, and is this entry reachable only through a chain.
| Switch | Behavior | Use it for |
|---|---|---|
| Non-recursable | only responds to keywords in chat; being name-dropped by other entries does nothing | entries keyed to common words that chains keep catching by accident |
| Prevent further recursion | once this entry is injected, the chain ends here | long encyclopedia entries that name-drop half the cast |
| Delay until recursion | skipped on the first sweep; only activates after another entry has matched first | deep lore and secrets, staged with a required recursion level |
Delay until recursion carries a number: Required recursion level — 0 means any level, N means the chain must be at least N levels deep before this entry unlocks. The docs describe it as staged matching: only when a shallower level produces no matches does the next level become eligible. If you want a mystery that reveals itself in layers, this is the one native mechanism for it. Concretely: give “the locked archive” a delay of level 1, and “what the archive actually hides” a delay of level 2. The player asking about the archive directly gets nothing; a chain that reaches the archive through the sect unlocks the first entry; only a conversation that keeps pulling on that thread ever surfaces the second.
How do you see the chain that actually ran?
No guessing required; two tools ship in the box. The entry editor has a single-entry dry run — type a sentence, see immediately whether that entry would fire, no model call involved. And the chat’s ⋮ menu has Last Generation Request, whose lorebook detail lists how many entries were scanned, roughly how many tokens were injected, and the specific reason each dropped entry didn’t make it in.
The dry run states its own limits on screen: it tests one entry only, while a real send also stacks other entries, recursion, cooldowns and character filters. So chain questions go to Last Generation Request, where drops carry named causes — over token budget, lost its inclusion group, on cooldown, skipped by a probability roll. There is also an over-budget alert in settings that warns when the lorebook got truncated. Both live behind the Show advanced SillyTavern tools switch.
One adjacent note: most lorebooks arrive embedded in character cards. Before debugging recursion, make sure the import itself survived — the card formats explainer covers what actually travels inside a card and which spec version carries it. An entry that never imported cannot chain.
Tuning cheat sheet
Chains too long: lower Max recursion steps. One encyclopedia entry keeps dragging in the whole family: give it Prevent further recursion. An entry keeps getting summoned by accident: Non-recursable. Secrets leak too early: Delay until recursion, plus a level. Back to our five: we ticked Prevent further recursion on the sword, so the chain now ends at the blade, and cut the previous owner’s 800-word biography down to a 150-word dossier for the day a player asks about him directly. The same six-word message now injects three entries instead of five, at less than half the budget. The chain didn’t die — it just stopped sprinting to the end of the family tree. And the whole ruleset — triggers, steps, budget — behaves the same in Foreverse on Android as in desktop SillyTavern, so a book you tuned on the desk doesn’t need re-learning on the phone. The only thing that changes is where you check your work: same inspector, smaller screen.
FAQ
Can lorebook entries trigger each other?
Yes, if recursive scanning is on (in Foreverse it ships off; the toggle lives in Tavern global settings under Lorebook & rendering). Once enabled, the content of every activated entry is scanned for other entries' keywords, and whoever gets name-dropped is injected too. Each entry activates at most once per generation, so two entries mentioning each other cannot loop forever.
What does recursive scanning mean in SillyTavern?
It adds one more scan source. Normal triggering only scans the last few chat messages for keywords; recursive scanning also treats the text of already-activated entries as scan material, letting entries summon related entries in a chain — mention the sect, and the heirloom sword named in the sect's dossier rides along. Chains stop on three conditions: no new matches, the max recursion steps cap, or an exhausted token budget.
Why did one keyword pull five entries into my prompt?
Most likely the entries name-drop each other's keywords in their content, and recursion strung them into a chain. Open Last Generation Request in the chat's ⋮ menu: the lorebook detail lists every injected entry with the keyword that matched it, so the chain is visible link by link. For an entry you never want dragged in by others, tick Non-recursable in the entry editor.
What should Max Recursion Steps be set to?
Per the SillyTavern docs: 1 effectively disables recursion, 2 lets a chain take one hop, 3 allows two hops, and so on. Two hops covers most real lore graphs — sect pulls in sword, sword pulls in sword spirit. The step count is a global dial; for surgical control over individual entries, the three per-entry switches (Non-recursable, Prevent further recursion, Delay until recursion) are the better tool.
Questions or ideas? Join our Discord →