Skip to content

Lorebooks

Lorebooks are your story's living reference library. Each lorebook contains world-info entries — nuggets of lore that the AI pulls in only when they're relevant to the current scene. Instead of cramming every detail into every prompt, lorebooks let keywords do the filtering: when a trigger word appears in your scene's characters, outline, or summaries, the matching entry is automatically injected into the AI's context.

Think of it as the AI's on-demand reference manual — it reads only the pages it needs.


Why Lorebooks Matter

  • Focused context — only relevant world info is sent to the AI, saving tokens and improving generation quality.
  • Consistency — the AI references the same lore every time a keyword comes up, reducing contradictions.
  • Scalability — you can build hundreds of entries without worrying about prompt size; keywords keep things lean.

Three Sources of Lorebooks

Every lorebook card displays a colored source badge so you can tell at a glance where it lives:

Badge Source Scope Best for
🌍 World (blue) Attached to a World Shared across all stories using that world Locations, factions, history, magic systems
📖 Story (green) Attached to a specific story Only visible when that story is filtered Story-specific plot devices, settings, arcs
👤 Character (orange) Attached to a character card Available whenever that character is in a story Backstory, wardrobe, relationships, abilities

The Lorebooks View

Open Library → World Info to reach the Lorebooks view.

  • Flat list — all lorebooks from every source appear in one scrollable list, each tagged with its source badge.
  • Story filter dropdown — at the top of the view. Defaults to "All sources." Pick a specific story to also surface its story-scoped lorebooks.
  • Summary bar — shows total lorebook and entry counts at a glance.
  • Search — filter entries by keyword or content text.
  • Advanced toggle — in the toolbar; shows or hides advanced fields on entry cards (secondary keys, selective logic, order, etc.).

Creating Entries

Use the Import button (↑ icon) in the toolbar to import a lorebook JSON file, or click "+ New" to create entries from scratch:

Option What it does
New World Creates a new named world (with its own lorebook)
World Entry Adds an entry to the active world's lorebook
Story Entry Adds an entry to the currently filtered story's lorebook
Import from File Imports a lorebook JSON file (see Importing)

Entry Fields

Every entry has three core fields:

  • Keys (primary keywords) — comma-separated trigger words. When any of these words appear in the scene context, this entry is included in the prompt.
  • Content — the information injected into the prompt. Can be multiple paragraphs of lore, rules, descriptions, or anything else.
  • Comment — a display name or label shown in the UI. Not sent to the AI unless the content field is empty.

How Keyword Matching Works

Primary keys are checked against:

  • Character names in the scene
  • The scene outline
  • Scene summaries
  • Previous scene text

If any primary key matches, the entry is included.

Secondary Keys and Selective Mode

For finer control, open the Advanced fields:

  • Secondary keys — additional trigger keywords used alongside primary keys.
  • Selective mode — when enabled, both a primary key and a secondary key must match for the entry to fire.
  • Selective logic — controls how secondary keys combine:
  • AND — all secondary keys must match.
  • OR — any secondary key can match.
  • NOT — the entry is excluded if a secondary key matches.

Constant Entries

Mark an entry as Constant to include it in every scene regardless of keywords. Use this sparingly — constant entries consume tokens on every generation.

Entry Order

When multiple entries match, the Order field controls their position in the prompt. Lower numbers appear first.


Advanced Fields

Toggle "Advanced" in the toolbar to reveal these fields on every entry card:

Field Description
Secondary Keys Additional trigger keywords for selective matching
Selective Enable or disable the secondary-key requirement
Selective Logic AND / OR / NOT
Constant Always include this entry (ignores keywords)
Order Numeric priority — lower numbers appear earlier in the prompt
Enabled / Disabled Temporarily disable an entry without deleting it
Character Filter Limit this entry to scenes involving specific characters

Managing Entries

  • Expand / collapse — click a lorebook card to reveal or hide its entries.
  • Edit — click any entry to edit it in place.
  • Delete — remove individual entries or entire lorebooks.
  • Toggle — flip the enable/disable switch to silence an entry without losing it.
  • Copy between scopes — use the copy menu on an entry to duplicate it from one scope to another (e.g., World → Story, Story → Character).

Importing Lorebook Files

Storywright supports the SillyTavern World Info JSON format.

  1. Click "+ New" → "Import from File".
  2. Select a .json lorebook file.
  3. All entries are imported with their keywords, content, and settings intact.

Tip: Character cards imported as PNG or JSON also bring their attached lorebook entries automatically.


Quality Inspection

Click the shield icon (🛡) on a lorebook card's header to run a quality check. The inspector looks for:

  • Duplicate keywords across entries
  • Entries with no keywords (they'll never trigger)
  • Very short or empty content
  • Inconsistent formatting

Findings are listed with suggestions and auto-fix options where possible.

Conflict Detection

The app can scan your lorebook entries for contradictions — for example, two entries that describe the same character's eye color differently, or conflicting dates for the same historical event. Conflicts are surfaced in the workspace so you can resolve them before they affect generation.

World Enrichment

As your story progresses, the continuity system accumulates facts about your world. The app can suggest new lorebook entries based on these continuity facts — turning emergent story details into permanent world-building that feeds into future generations. This keeps your world growing organically without manual data entry after every scene.


Tips

  • Be specific with keywords. Use character names, location names, and unique terms. Avoid common words like "the" or "said" — they'll trigger on almost every scene.
  • Keep entries focused. One concept per entry: a single location, a relationship, a rule of magic. This makes keyword matching precise and content easy to maintain.
  • Use secondary keys for context. For example, primary key sword + secondary key battle means the entry only fires when the sword is relevant to combat, not every casual mention.
  • Reserve constant entries for critical rules. Things like "magic always has a cost" that must apply everywhere. Too many constants waste tokens.
  • Watch your entry count. A handful of constant entries is fine; dozens will bloat every prompt. Let keywords do the filtering.
  • Choose the right scope. Put shared lore (locations, history, factions) in a World lorebook. Put personal details (wardrobe, relationships, secrets) in a Character lorebook.