Building a Lorebook

A character's prompt is sent on every turn, so it has to stay short. A lorebook holds everything else: places, people, history, rules of magic. Each fact is an entry, and an entry comes into the story only when what it describes comes up.

This guide builds a small lorebook in the Forge and links it to a character.

1. Create the lorebook

  1. In the Forge, open Workbench.
  2. Under Make something, press New lorebook.
  3. Type a Name and a Description. Readers see the description; the AI doesn't.
  4. Press Create lorebook.

The Forge's new lorebook page with the name Saltmarsh Folk and a description typed, and Create lorebook lit in the header.

2. Write your first entry

  1. Under Entries, press New entry.
  2. Name it: a short name to find it by in the list.
  3. Write the Content: the lore the story pulls in when this entry fires.
  4. Under Triggers, add Keywords. Any one of them in the conversation fires the entry.
  5. Press Create entry.

A new lorebook entry, The Saltmarsh Fair, with its content written and three keywords, fair, midsummer and market day, added under Triggers.

Writing content the AI can use

Write each entry to stand alone

The AI never sees your whole lorebook. Each turn, only the few entries whose keywords or meaning match the conversation reach it. So write every entry as if it were the only one the story gets: it should carry enough for the scene to play out on its own.

That's why a pointer doesn't work. "See 'X'" only helps when X is picked in the same turn, and usually it isn't, since X has its own keywords. The AI reads a reference to something it can't see and fills the gap by inventing. "This lorebook" has the same problem.

Every entry carries:

Repeating a fact in two entries is fine: a repeated sentence costs fewer tokens than a scene the AI has to invent.

Before:

Name: How Magic Works
Magic draws on the caster's own body heat.
See 'Magic Perception' for how characters experience it.
The mechanics in this lorebook always govern outcomes, but most people in the world do NOT know them.

After:

Name: How Magic Works
Keywords: magic, spell, spells, casting, mage, mages
Content:
Every spell draws on the caster's own body heat. A small working
leaves the hands numb; a large one can stop the heart. This rule
decides every outcome, whatever anyone in the story believes.
In a scene: a caster's breath fogs and their fingers whiten while
they work; afterwards they shiver, reach for fire and eat like a
laborer. People nearby feel the air go cold.
What people believe: most don't know the rule. Villagers say mages
sell their warmth to spirits; the academies teach that magic is a
gift of the stars. Characters act on what they believe; the outcome
follows the rule.

"Magic Perception" can stay its own entry with more detail. This entry now carries what any magic scene needs.

Choosing keywords

Keywords aren't the only way in. A story can also find entries by meaning; see step 5.

3. Tune when an entry fires

The ⚙ Entry settings button holds the fine controls.

Setting What it does
Priority Higher goes into the story first.
Trigger chance How often it fires when it matches. Lower adds variety.
Always include In every reply, whatever the keywords. Use it sparingly.
Enabled A disabled entry is skipped entirely.
Category Groups related entries. Reading Mode turns categories into chapters.

4. Keep secrets

Some facts are for the story, not for the reader: who the killer is, what's behind the door.

  1. Open the entry's ⚙ Entry settings and find Readers.
  2. Turn on Hide in Reading Mode.

A hidden entry still works in stories. It carries a "Hidden from readers" mark in your list.

5. Know the other ways an entry is found

Keywords work the moment you save. A story can also find an entry by meaning, even when no keyword was typed. Whether a story uses keyword search, meaning search or both, and how many entries come in each turn, is set per story: on the chat site, in the story's Context settings.

How the four ways of matching work together: Lorebooks.

  1. Open your character in the Workbench.
  2. Under Lorebooks, press Link a lorebook.
  3. Pick the lorebook from the list.
  4. Press Save.

Every story with that character now searches this lorebook. A reader can also add a lorebook to one of their own stories on the chat site, under Story → Settings → Lorebooks this story searches.

The Link a lorebook picker open over a character, listing Saltmarsh Folk, Songs of the Estuary and The Lantern Coast, with The Lantern Coast marked Linked.

7. Read it like a book

With Allow Reading Mode on (⚙ Lorebook settings → Search), readers can browse the entries like a book, grouped by category. Entries you hid stay hidden.

Check your work