Lorebooks
A lorebook is how your world stays alive between sessions. It holds entries — a city, a faction, a magic system, a person — and on every message the story searches them and adds the ones that matter to what the AI reads. Mention Shadowkeep, and the entry about Shadowkeep comes along; leave it out, and it costs nothing.
Lorebooks are free. You write and edit them in the writing app. On the chat site you choose which lorebooks a story searches.
Where to find it
- Forge: Workbench → Make something → New lorebook; entries are under Entries → New entry. Step by step: Building a Lorebook.
- Writing app: Creator's Forge in the side navigation → pick a project or All Items → a lorebook's ⋮ menu → Edit. Your lorebooks are also listed in Creator's Space → Lorebooks.
- Writing app, in a chat: open the chat → the character panel (its toggle in the header, or press
]) → World Knowledge. - Chat site: open your story → Story at the top (or press
S) → About → Lorebooks this story searches.
Step by step
Create a lorebook
- In the writing app, open Creator's Forge.
- Select Create at the top of the projects list.
- Pick New Lorebook.
- Leave the Create tab selected. Under Project, choose where it goes, or Unassigned to keep it in All Items.
- Enter a Name (up to 60 characters) and, if you like, a Description.
- Select Create.
If you're a contributor on the project rather than a manager, the new lorebook is added as a proposal and the toast says it is waiting for the project owner's approval.
Add an entry
- Open the lorebook in the Forge: its ⋮ menu → Edit.
- In the Entries panel, select New Entry.
- Fill in Content — the text the AI reads when the entry comes up. It is the only required field.
- Give it a Name so you can find it in the list, and a Category to group it with similar entries.
- Open Trigger Rules and add Keywords: the words that bring this entry in. Press Enter after each one.
- Pick a Matching archetype (see the table below). If you're unsure, leave it on Lore.
- Select Create.
To change an entry later, select it in the list, edit, and select Save. Drag entries to reorder them; reordering works while the list is sorted by Sort: Position with no search typed.
Index your entries
Search by meaning only reaches entries that have been indexed. New entries aren't indexed until you do it, and saving a change to an entry's Content clears its index — the old text is never searched. Changing only its keywords, priority or other settings keeps the index.
- Open the lorebook in the Forge.
- Look at the Vector index card above the entry list. It shows how many entries are indexed out of the total.
- Select Reindex. A progress bar fills while the entries are processed.
- When it finishes, a toast says how many entries were indexed and how many failed, with the reason.
If you're editing many entries, reindex once at the end.
Link a lorebook to a character
A linked lorebook is searched in every story with that character.
- In the Forge, open the character: its ⋮ menu → Edit.
- Under the character's details, find Lorebooks and select Link Lorebook.
- Search for the lorebook. Each result is marked Yours, Shared (someone gave you access) or Public (published by another creator).
- Select Link next to the one you want.
You can drag linked lorebooks into an order. The order is how they're listed on the character's page; it doesn't change which entries win in a search.
Add a lorebook to one story
On the chat site:
- Open your story and select Story at the top.
- Stay on the About tab and find Lorebooks this story searches. Each lorebook shows its entry count and where it comes from: from the character, from your persona or from this story.
- Select Add a lorebook.
- In Lorebooks for this story, search and select Add next to a lorebook. Remove takes off one you added here.
A package can keep its lorebooks fixed — then the section says so and offers nothing to add or remove.
In the writing app:
- Open the chat and open the character panel (or press
]). - Under World Knowledge, select Add Lorebook (or Manage lorebooks if some are already there).
- In Manage Lorebooks, select Bind next to a lorebook, or Unbind to remove one you bound to this chat. Lorebooks that come from the character or persona show via character or via persona and can't be removed here.
Lorebooks that aren't fully indexed show a count like 8/12 embedded. If the lorebook is yours, Generate missing embeddings (writing app) or Generate the missing ones (chat site) fixes it. If it's someone else's, ask its creator.
How Matching Works
Every message, the story looks at your recent messages and checks every enabled entry in every lorebook the story searches. Four methods run together, and each one scores an entry from 0 to 1:
| Method | What it catches | Example |
|---|---|---|
| Keyword | Your entry's keywords appearing in the text, as whole words, ignoring case | dragon matches "a Dragon lands" — not "dragonfly" |
| Full-text | Word forms and roots in the entry's content | "kingdoms" finds an entry that talks about a "kingdom" |
| Meaning (vector) | Text that is about the same thing, even with no shared words | "the beast breathed ice" finds your Frost Dragon entry. Needs indexed entries |
| Regex | A pattern you write in Trigger Regex | \mwyrms?\M matches "wyrm" and "wyrms" |
The four scores are added up, after the entry's archetype weights them. An entry several methods agree on rises to the top. The highest-scoring entries go in, up to your limit (see How Many Entries Get In).
All lorebooks the story searches compete together — the character's, your persona's, the ones added to the story, and a package's. None is preferred over another.
Keywords, Include Keywords and Exclude Keywords
| Field | Rule |
|---|---|
| Keywords | Any one of them appearing counts as a keyword match. Each extra keyword that appears raises the score a little. |
| Include Keywords | All of them must also appear for the keyword match to count. Use them to narrow a broad keyword. |
| Exclude Keywords | If any one appears, the entry is out for this message — no search method can bring it in. (An Always Include entry still goes in.) |
Example:
Entry: "Frost Dragons"
Keywords: dragon, wyrm
Include Keywords: frost
Exclude Keywords: statue
Content: Frost dragons breathe ice. They nest above the snowline...
| Recent text | Result |
|---|---|
| "A dragon lands on the frost-covered ridge." | Keyword match: dragon plus the include word frost |
| "A dragon circles the tower." | No keyword match — frost is missing. The entry can still come in by meaning, because its content is about dragons |
| "The dragon statue in the square is rimed with frost." | Out. statue is an exclude keyword, so nothing brings it in |
| "A wyrmling hatches." | No keyword match — wyrm matches whole words only. Add wyrmling, or use a regex |
Keep keywords short and distinctive: names and unique terms like elara or shadowkeep. Words like the, is or magic match far too often.
Trigger Regex
Trigger Regex is for patterns keywords can't express. It is a PostgreSQL pattern and ignores case. A match counts as one more method in the score.
PostgreSQL marks whole words differently from most regex you'll have seen: use \m at the start of a word and \M at the end, or \y on either side. \b is a backspace there, so \bdragon\b never matches anything. The field warns you if you use it.
Trigger Regex: \mwyrm(s|ling)?\M
Matches: "a wyrm", "two wyrms", "the wyrmling"
Doesn't match: "wyrmwood"
Matching Archetypes
The Matching archetype tells the search what kind of entry this is, and weights the four methods to suit. A weight of 0 switches a method off for the entry.
| Archetype | Use it for | Keyword | Full-text | Meaning | Regex |
|---|---|---|---|---|---|
| Lore (default) | Background, history, rules, world systems | 1.0 | 1.0 | 1.0 | 1.0 |
| Entity | A named character, place, item or faction | 1.3 | 1.0 | 0.7 | 1.0 |
| Scene | A kind of situation: combat, a negotiation, a ritual | 0.5 | 1.2 | 1.3 | 1.0 |
| Vibe | Tone, mood, atmosphere | 0.0 | 0.5 | 1.5 | 1.0 |
| Custom | Your own weights, each from 0 to 2 | you set | you set | you set | you set |
Pick Custom to get four sliders: Keyword, Full-text, Semantic (vector) and Regex.
Always Include, Trigger Probability, Priority
| Field | What it does |
|---|---|
| Always Include | The entry goes in on every message, whatever was said. It doesn't count against your entry limit and is never trimmed — so it costs tokens every message. Use it for the few things the story must never forget. |
| Trigger Probability | 1–100%, default 100%. When the entry matches, this is the chance it actually goes in. At 50% a flavor entry shows up about half the time it matches. |
| Priority | A number; higher is more important. Two entries with the same score are ordered by priority, and always-included entries are added in priority order. It doesn't beat a better match. |
| Enabled | Off means the entry is skipped entirely — in chat and in Reading Mode. |
Entry Fields
| Field | Required | Notes |
|---|---|---|
| Name | No | Up to 60 characters. Shown in the list; untitled entries show their first keywords. |
| Content | Yes | Up to 10,000 characters. The text the AI reads. The editor shows its token count. |
| Category | No | Up to 100 characters. Groups entries; becomes a chapter in Reading Mode. |
| Color | No | A label color for the list. |
| Picture | No | An image from your gallery. See Picture Entries. |
| This is a place | No | Marks the entry as a place a story can be in. While a story is there, the entry is always included. Inside sets the place it's part of, like a room in a palace, from this lorebook's places. See Place and Time, built in. |
| Trigger Rules | — | Keywords, Include Keywords, Exclude Keywords, Trigger Regex, Trigger Probability, Always Include. Collapsed by default; its header summarizes what's set. |
| Matching archetype | — | See the table above. |
| Priority | — | 0 by default. |
| Enabled | — | On by default. |
| Hide in Reading Mode | — | Keeps the entry secret from readers. See Lorebook Reading Mode. |
How Many Entries Get In
You set the limits in the writing app under Settings → Context, in the Knowledge Retrieval group. They apply to all your stories.
| Setting | Default | What it does |
|---|---|---|
| Max Entries | 10 | The most searched entries added per message (0–50). Always-included entries don't count. 0 turns the search off, leaving only always-included entries. |
| Limit Lorebook Search | By count | By count uses Max Entries. By token budget caps how much room entries take. By count and token budget stops at whichever runs out first. |
| Token Budget | 0 (no limit) | Up to 32,000 tokens for searched entries. The top-ranked entry always gets in, even if it alone is over budget. |
| Message Scan Depth | 5 | How many recent messages are searched (1–20). Keywords and patterns are read from the newest 2,000 characters of them. |
| Min Keyword Matches | 1 | How many of an entry's keywords must appear (1–10). |
| Min Combined Score | 0.5 | The lowest total score that gets in (0–2). 0 turns the gate off. |
| Simple Keyword Search, Full-Text Search, Vector Search | On | Turn a search method off for all your stories. |
| Vector Score Threshold | 0.6 | How close in meaning an entry must be. Try 0.4–0.5 for broader matching. |
| FTS Score Threshold | 0.3 | How strong a full-text match must be. |
| Expand Depth | 0 (off) | When an entry matches, also pull in entries related to it, up to 3 levels. 1–2 suits tightly connected worlds. |
| Expand Similarity Threshold | 0.75 | How closely related an entry must be to be pulled in. |
| Recency Decay | 1.0 (off) | Below 1.0, older messages count for less, so an entry that came up once doesn't keep coming back. |
The Lorebook row in a story's Feature settings turns lorebook search on or off for that story. See Chat Feature Settings.
Lorebook Settings
Open the lorebook in the Forge and select Edit on its details:
| Setting | What it does |
|---|---|
| Name, Description | How the lorebook is listed. |
| Picture | The lorebook's cover. |
| Tags | Help people find it in Browse once it's public. |
| Allow Reading Mode | Lets people open the lorebook as a book. Off by default. See Lorebook Reading Mode. |
| Make this lorebook public | Submits the lorebook for review to appear in Browse. See Publishing. |
Select Save to keep your changes, or Cancel.
Under the details (when you're not editing) are Export and Open in Assistant; the lorebook's ⋮ menu in the project list has Export and Lorebook Assistant too. See Import and Export and Lorebook Assistant.