Yumina

Guides

What is a lorebook? How keyword entries work in AI roleplay, with an example

A lorebook holds the facts of an AI roleplay world and sends each one to the model only when the chat mentions it. Here is how entries trigger and how to write one.

A lorebook is a set of notes about a story's world, such as places, people and rules, that an AI roleplay app keeps beside the chat. Each note, called an entry, has keywords, and the app sends the entry to the model only on turns where one of those keywords appears in the recent conversation. SillyTavern calls the same feature World Info and describes it as "a dynamic dictionary that only inserts relevant information".

How does a lorebook entry reach the model?

A model reads only the text the app sends it on each turn. Before sending, the app does four things with the lorebook.

  1. It scans the last few chat messages. SillyTavern's Scan Depth setting is the number of messages it looks at.
  2. It compares every entry's keywords with that text. In SillyTavern, keys are not case-sensitive by default.
  3. It inserts the content of each matching entry into the prompt. The entry's title and keywords are not sent, only the content.
  4. It stops when the lorebook's token budget is full. Past the budget, SillyTavern's docs say, "no more entries are activated even if the keys are present in the prompt".

An entry can also be set to send on every turn with no keyword.

Why does a lorebook save memory?

Everything the app sends takes room in the context window, the limit on what the model reads each turn. A character description is sent every turn, and a lorebook entry only when it is needed.

Take a world with 20 entries of 150 tokens each. Sent every turn, they cost 3,000 tokens. On a free plan that reads 4,096 tokens, that leaves about 1,100 for the chat, which is four turns. With keywords, a normal turn triggers one or two entries, 150 to 300 tokens, and the rest of the window goes to the conversation.

A large window has room for all 20, but Yumina's creator docs give a second reason to hold them back: the more lore the AI reads each turn, the worse it gets "at telling what matters".

How do you write a good lorebook entry?

Length. One fact or one subject per entry, in 50 to 150 words. SillyTavern's docs advise keeping entry contents concise "to conserve prompt tokens".

Make it stand alone. The model never sees the title or the keywords. The content has to name its subject in the first sentence.

Keywords. Use two to five specific words: the name, a nickname, the thing a player would type. "Veln" is a good keyword. "City" is a bad one, because it fires on every city in the story. Add the words a player types before they know the name, such as "harbor".

What to leave out.

  • Anything the AI needs on every turn, such as the main character's personality or the writing style. That belongs in the character description, which is always sent.
  • Lists of things the AI must not do. Yumina's docs put it this way: "Describe fights with rich sensory detail" works, and "Don't write boring fights" does not.
  • A fact already written in another entry.

What does a good lorebook entry look like?

Keywords: Veln, the harbor, harbor city, Lantern Quay

Veln is a harbor city built on the wreck of an older, flooded one. Its streets are bridges between rooftops, and the lower floors of every house are under water. The Tide Wardens run the city and tax each boat at Lantern Quay. Visitors must carry a brass token or be turned back at the gate. People in Veln do not speak of the flood, and they call the drowned streets "the downstairs".

That is 73 words, about 97 tokens. It names Veln in the first sentence, gives the AI three facts for a scene, and adds one detail of local speech.

How do lore entries work on Yumina?

Yumina, an open-source engine for AI roleplay and AI games, calls lorebook entries lore and sorts them by when they are sent.

Block When the AI sees it Use it for
Character and world every turn the main character, the setting, the narration style
Keyword lore when a keyword shows up in the recent conversation an NPC's backstory, a place, one mechanic
Conditional lore when a variable meets a condition "Drunk descriptions", sent only when Tipsiness is 5 or more
Standby lore never, until a behavior opens it a hidden storyline that opens when affection reaches 80

Separate keywords with commas. Any one of them triggers the entry.

How is Yumina's lore different from a SillyTavern lorebook?

The keyword part works the same way, and Yumina imports SillyTavern lorebooks with their keywords. There are three differences.

  1. Game state can trigger an entry. Conditional lore reads a variable the engine keeps, so an entry can depend on a number such as trust or health.
  2. A rule can open an entry. Standby lore stays out until a behavior, an if-this-then-that rule the engine runs, switches it on.
  3. SillyTavern's trigger percentage has no match. In SillyTavern an entry can fire on only some of its activations. Yumina's importer skips that setting, so an imported entry fires every time its keyword matches.

In Yumina, a bar on the canvas counts lore per turn and in total, and its dot turns yellow past 30,000 tokens and red past 60,000.

FAQ

How long should a lorebook entry be?

50 to 150 words is a good target. The entry is sent whole each time it triggers, so every extra sentence takes room from the conversation.

Why is my lorebook entry not triggering?

The keyword did not appear in the messages the app scans, or the lorebook's budget was already full. On Yumina, a playtest lists the entries that were not sent on that turn.

Does a lorebook replace a long memory?

No. A lorebook holds facts written before the story starts, and it does not record what happened in your chat. Can AI remember a long roleplay? covers that part.

Sources

Checked 15 November 2026. SillyTavern's scan depth, key matching, budget, trigger percentage and the quoted lines: docs.sillytavern.app (World Info). The 4,096-token free plan: SpicyChat alternatives. Yumina's lore blocks, writing tips and token bar: Openings and lore. The list of unsent entries: Playtest. The importer skipping trigger percentage: convert-tavern-card.ts in the open-source repository. Counts assume 0.75 words per token and 200 words per turn.

Worlds you can play now

See every world on Yumina

More on how-to guides

Read next