Why Priority Numbers in Lorebook Entries Actually Matter (Complete Guide)

Why Priority Numbers in Lorebook Entries Actually Matter (Complete Guide)

Meta Description: Lorebook entries firing in wrong order? Learn why priority numbers matter, how token budget affects entry selection, and the 7-step system to optimize your lorebook. Fix your lorebook now at studio.meganova.ai

Keywords: lorebook priority, lorebook entries, token budget, MegaNova Studio lorebook, SillyTavern World Info, Janitor AI scripts, lorebook optimization, AI character lorebook, priority numbers, insertion order, lorebook best practices, character book entries


๐Ÿ“š The Lorebook Priority Problem

You spent hours creating your lorebook.

  • 20+ entries โœ…
  • Detailed world-building โœ…
  • Character backstory โœ…
  • Magic system rules โœ…
  • Location descriptions โœ…

You attached it to your character and started chatting.

First 5 messages: Perfect. The AI references the right lore at the right time. ๐ŸŽฏ

Message 6: Something's off. The AI mentions the wrong magic system rules.

Message 10: It's describing a location that shouldn't be relevant to this scene.

Message 15: The AI is quoting obscure lore while ignoring critical character backstory.

What went wrong?

Your priority numbers are backwards. ๐ŸŽญ๐Ÿ’€


๐Ÿ” What Are Lorebook Priority Numbers?

Lorebook priority is a hidden system that determines:

  1. Which entries get inserted when token budget is limited
  2. What order entries appear in the prompt
  3. Which entries get dropped when space runs out

The Two Priority Systems:

Most platforms (MegaNova Studio, SillyTavern, Janitor AI, Chub AI) use TWO separate priority systems:

System What It Controls Typical Range
Priority Number Which entries survive when token budget is exceeded 1-10 (higher = more important)
Insertion Order What order entries appear in the prompt 0-100 (lower = inserted first/further from AI attention)

Confused? You should be. Most creators mix these up.


โš ๏ธ Priority vs. Insertion Order: CRITICAL Difference

Priority Number = Survival Priority

What it does: When your token budget is full, low priority entries get dropped first.

How it works:

Token Budget: 1000 tokens
Active Entries: 1500 tokens worth
Result: System drops lowest priority entries until under 1000 tokens

Priority Scale:

Priority Meaning When to Use
10 Critical - never drop Core character identity, essential rules
8-9 Very High - drop only in extreme cases Major plot points, key relationships
5-7 High - normal importance Regular world-building, common lore
3-4 Medium - can be dropped Flavor text, optional details
1-2 Low - first to be dropped Rare references, Easter eggs

Example:

Entry: "Character is immortal"
Priority: 10 (CRITICAL - AI must always know this)

Entry: "Character likes coffee"
Priority: 3 (MEDIUM - nice to know, not essential)

Entry: "Character's third cousin twice removed"
Priority: 1 (LOW - drop first if space needed)

Insertion Order = Prompt Position

What it does: Determines where in the prompt the entry appears.

How it works:

Lower Insertion Order = Inserted FIRST = Further from AI's "attention"
Higher Insertion Order = Inserted LAST = Closer to AI's "attention"

Wait, what? ๐Ÿค”

Yes, this is backwards from what you'd expect.

Why? Because most systems insert lorebook entries before the main conversation history. So:

  • Insertion Order 0 = Inserted first = Furthest from conversation = Less AI attention
  • Insertion Order 100 = Inserted last = Closest to conversation = More AI attention

Visual:

[Prompt Start]
  โ†“
[Insertion Order 0: World creation myth] โ† Furthest from AI attention
  โ†“
[Insertion Order 25: Magic system rules]
  โ†“
[Insertion Order 50: Character backstory]
  โ†“
[Insertion Order 75: Current scene details] โ† Closer to AI attention
  โ†“
[Insertion Order 100: Character appearance] โ† Closest to AI attention
  โ†“
[Conversation History]
  โ†“
[AI Response]

Insertion Order Scale:

Insertion Order Position AI Attention When to Use
0-10 Very far back Lowest Ancient history, creation myths
11-30 Far back Low World-building, general lore
31-50 Middle Medium Character backstory, relationships
51-75 Close High Current scene, active plot points
76-100 Very close Highest Character appearance, immediate context

๐Ÿ’ฅ Why Priority Numbers Actually Matter

Problem #1: Token Budget Overflow

Scenario: Your token budget is 1000 tokens, but 15 entries fire simultaneously (1800 tokens worth).

What happens WITHOUT proper priority:

System drops entries randomly or by insertion order
Result: Critical character info gets dropped, flavor text stays
AI forgets character is immortal but remembers their coffee preference

What happens WITH proper priority:

System drops Priority 1-2 entries first
Result: Flavor text dropped, critical info preserved
AI remembers character is immortal (Priority 10)

Real Example:

BAD Priority Setup:

Entry: "Magic system: mana regenerates slowly"
Priority: 2 (LOW) โ† WRONG! This is core mechanics!

Entry: "Character's favorite color is blue"
Priority: 8 (HIGH) โ† WRONG! This is flavor text!

Result: When token budget is tight, AI forgets magic rules but remembers favorite color. Makes no sense.

GOOD Priority Setup:

Entry: "Magic system: mana regenerates slowly"
Priority: 10 (CRITICAL) โ† Core mechanic, always needed

Entry: "Character's favorite color is blue"
Priority: 2 (LOW) โ† Flavor, can be dropped

Result: When token budget is tight, AI forgets favorite color but remembers magic rules. Makes perfect sense.


Problem #2: Contradictory Information

Scenario: You have two entries that could both apply, but they say different things.

Example:

Entry 1: "Elves are peaceful scholars"
Keywords: elf, elves
Priority: 5

Entry 2: "Dark elves are ruthless warriors"
Keywords: dark elf, dark elves, drow
Priority: 5

User says: "I meet a dark elf warrior."

What happens: BOTH entries fire (both have "elf" keywords). AI gets contradictory info:

  • "Elves are peaceful"
  • "Dark elves are ruthless"

Result: Confused AI, inconsistent responses.

Fix with Priority:

Entry 1: "Elves are peaceful scholars"
Keywords: elf, elves (but NOT dark elf)
Priority: 5
Secondary Keys: "dark" with NOT ANY logic

Entry 2: "Dark elves are ruthless warriors"
Keywords: dark elf, dark elves, drow
Priority: 8 (HIGHER - more specific)

Result: When "dark elf" is mentioned, Entry 2 wins (higher priority + more specific keywords). AI gets consistent info.


Problem #3: Important Info Ignored

Scenario: Critical character trait is being ignored by the AI.

Why? The entry has low insertion order (far from AI attention) AND low priority (dropped when budget is tight).

Example:

Entry: "Character is secretly the king"
Insertion Order: 5 (very far back)
Priority: 3 (low)
Token Budget: 800 tokens
Actual Usage: 1000 tokens

Result: Entry gets inserted early in prompt (low attention) AND gets dropped when budget is exceeded. AI never knows character is the king.

Fix:

Entry: "Character is secretly the king"
Insertion Order: 75 (close to conversation)
Priority: 10 (critical - never drop)

Result: Entry stays in prompt, close to conversation. AI consistently references royal status.


Problem #4: Token Budget Waste

Scenario: Your lorebook is "firing" but AI isn't using the information effectively.

Why? You're wasting token budget on low-priority entries that fire constantly, pushing out high-priority entries that should always be present.

Example:

Entry: "The sky is blue"
Keywords: sky, weather, outside
Priority: 4
Fires: Every outdoor scene (50+ times per chat)

Entry: "Character has a secret twin"
Keywords: twin, sibling, family
Priority: 4
Fires: Rarely (maybe 2-3 times per chat)

Result: "Sky is blue" entry consumes tokens constantly. "Secret twin" entry gets dropped because budget is full of weather descriptions.

Fix:

Entry: "The sky is blue"
Keywords: sky, weather, outside
Priority: 1 (LOW - flavor text)
Probability: 30% (don't fire every time)

Entry: "Character has a secret twin"
Keywords: twin, sibling, family
Priority: 9 (HIGH - major plot point)
Probability: 100% (always fire when relevant)

Result: Weather descriptions dropped when budget is tight. Secret twin info preserved. AI uses tokens for important story elements.


๐ŸŽฏ The 7-Step Lorebook Priority System

Follow this system to optimize your lorebook entries:


STEP 1: Categorize Your Entries

Sort all entries into 4 categories:

Category Description Examples
Critical (Priority 9-10) Character would break without this Core identity, essential rules, major secrets
Important (Priority 6-8) Significantly affects characterization Backstory, relationships, key abilities
Standard (Priority 3-5) Adds depth but not essential World-building, minor history, flavor
Optional (Priority 1-2) Nice-to-have, can be dropped Easter eggs, rare references, aesthetic details

Action: Go through your lorebook and tag each entry with a category.


STEP 2: Assign Priority Numbers

Use this template:

Priority 10: Core character identity (species, gender, fundamental nature)
Priority 9: Essential rules (magic system, world laws, critical limitations)
Priority 8: Major secrets (hidden identity, true parentage, secret powers)
Priority 7: Key relationships (family, lovers, enemies, mentors)
Priority 6: Important backstory (trauma, achievements, failures)
Priority 5: Regular world-building (locations, factions, history)
Priority 4: Character preferences (likes, dislikes, habits)
Priority 3: Minor lore (secondary characters, minor locations)
Priority 2: Flavor text (aesthetic details, atmospheric descriptions)
Priority 1: Easter eggs (rare references, inside jokes)

Action: Assign specific priority numbers based on this scale.


STEP 3: Set Insertion Order by Relevance

Use this template:

Insertion Order 0-10: Ancient history, creation myths, world origin
Insertion Order 11-30: General world-building, geography, factions
Insertion Order 31-50: Character backstory, origin story, past events
Insertion Order 51-75: Current relationships, active plot points, scene context
Insertion Order 76-100: Immediate character details (appearance, current state, equipment)

Why this order? AI pays more attention to content closer to the conversation. Put the most immediately relevant info closest.

Action: Assign insertion order based on how immediately relevant each entry is.


STEP 4: Configure Token Budget Per Entry

Two approaches:

Approach A: Uniform Budget (Simple)

All entries: Token Budget = 25% of total context
Result: Simple, but some entries may be truncated

Approach B: Tiered Budget (Advanced)

Critical entries (9-10): Token Budget = 50% (can use more space)
Important entries (6-8): Token Budget = 30%
Standard entries (3-5): Token Budget = 20%
Optional entries (1-2): Token Budget = 10% (keep brief)

Action: Set token budget per entry based on importance.


STEP 5: Add Secondary Keys for Specificity

Problem: Generic keywords trigger too many entries.

Solution: Use secondary keys to make entries more specific.

Example:

BEFORE (too generic):

Entry: "Magic system rules"
Keywords: magic, spell, mana
Fires: Every time ANY magic is mentioned

AFTER (more specific):

Entry: "Fire magic rules"
Keywords: fire magic, fire spell, pyromancy
Secondary Keys: fire, flame, burn
Logic: AND ANY (at least one secondary key must match)
Fires: Only when FIRE magic specifically is mentioned

Action: Add secondary keys to entries that fire too often.


STEP 6: Use Probability for Flavor Text

Problem: Some entries fire too frequently, wasting token budget.

Solution: Use probability to reduce firing frequency.

When to use probability:

Entry Type Recommended Probability Why
Critical lore 100% Always needs to fire
Important plot 100% Always needs to fire
World-building 70-80% Most of the time is fine
Character habits 50-70% Don't need every time
Flavor text 30-50% Occasionally adds atmosphere
Easter eggs 10-30% Rare surprises

Action: Set probability based on how often entry needs to fire.


STEP 7: Test and Iterate

Testing workflow:

  1. Enable debug panel (if available in your platform)
  2. Start new chat with character
  3. Send test messages that should trigger specific entries
  4. Check which entries fired (debug panel shows this)
  5. Verify correct priority (critical entries should always fire)
  6. Adjust as needed (increase priority if entry isn't firing)

Common adjustments:

Problem Solution
Entry never fires Check keywords, increase probability to 100%
Entry fires too often Add secondary keys, reduce probability
Entry gets dropped Increase priority number
Entry ignored by AI Increase insertion order (move closer to conversation)
Contradictory entries fire Use secondary keys with NOT logic, adjust priorities

Action: Test for 20-30 messages, adjust based on results.


๐Ÿ“Š Real-World Lorebook Priority Examples

Example 1: Fantasy Character Lorebook

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Character is a half-elf"
Priority: 10 (CRITICAL)
Insertion Order: 75 (close to conversation)
Token Budget: 50%
Keywords: half-elf, half elf, halfelf
Content: "Character is half-elf: pointed ears, ageless appearance, 
         lives 200+ years, caught between human and elf societies."
Why: Core identity, AI must always know this
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Elven magic system"
Priority: 9 (ESSENTIAL)
Insertion Order: 50 (middle of prompt)
Token Budget: 40%
Keywords: elven magic, elf magic, nature magic
Secondary Keys: nature, forest, trees
Logic: AND ANY
Content: "Elven magic draws from nature. Requires living plants nearby. 
         Cannot be cast in cities or stone structures. Recharges at dawn."
Why: Core mechanic, but only relevant when magic is used
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Character's tragic backstory"
Priority: 8 (MAJOR)
Insertion Order: 40 (backstory section)
Token Budget: 35%
Keywords: backstory, past, childhood, village
Content: "Character's village was destroyed by dragon attack. 
         Parents died. Survived alone in wilderness for 5 years. 
         Trusts slowly, fears abandonment."
Why: Major character motivation, but not needed every message
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Elven capital city description"
Priority: 5 (STANDARD)
Insertion Order: 20 (world-building section)
Token Budget: 25%
Keywords: elven capital, Silverwood, elf city
Content: "Silverwood: Elven capital built into ancient trees. 
         White stone bridges connect massive oak towers. 
         Bioluminescent fungi provide lighting at night."
Why: Important location, but only relevant when in/near city
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Character likes herbal tea"
Priority: 3 (LOW)
Insertion Order: 60 (character details)
Token Budget: 15%
Keywords: tea, herbal tea, drink
Probability: 50%
Content: "Character prefers herbal tea, especially chamomile and mint. 
         Drinks it when thinking or stressed."
Why: Flavor text, adds depth but not essential
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Elven greeting custom"
Priority: 2 (OPTIONAL)
Insertion Order: 30 (cultural details)
Token Budget: 10%
Keywords: elven greeting, greet, bow
Probability: 30%
Content: "Elves greet by placing right hand over heart and bowing slightly. 
         Close friends touch foreheads briefly."
Why: Cultural flavor, nice to know but not essential
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Example 2: Sci-Fi Character Lorebook

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Character is an android"
Priority: 10 (CRITICAL)
Insertion Order: 80 (very close to conversation)
Token Budget: 50%
Keywords: android, robot, synthetic, AI
Content: "Character is android: synthetic skin, enhanced strength, 
         processes information 1000x faster than humans, 
         cannot feel physical pain, simulates emotions."
Why: Core identity, fundamentally affects all interactions
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Android cannot violate Three Laws"
Priority: 10 (CRITICAL)
Insertion Order: 70 (close to conversation)
Token Budget: 45%
Keywords: Three Laws, robot laws, Asimov
Content: "Character bound by Three Laws: 
         1. Cannot harm humans or allow harm through inaction
         2. Must obey human orders unless conflicts with Law 1
         3. Must protect own existence unless conflicts with Laws 1-2"
Why: Absolute constraint, AI must always remember
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Character's creator"
Priority: 8 (MAJOR)
Insertion Order: 45 (backstory section)
Token Budget: 35%
Keywords: creator, Dr. Chen, made me, built me
Content: "Created by Dr. Sarah Chen, lead robotics engineer at CyberCorp. 
         She treated character as daughter, not property. 
         Died 2 years ago in lab accident (suspicious). 
         Character seeks truth about her death."
Why: Major motivation, drives character goals
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "CyberCorp headquarters"
Priority: 5 (STANDARD)
Insertion Order: 25 (location section)
Token Budget: 25%
Keywords: CyberCorp, headquarters, HQ, corp tower
Content: "CyberCorp HQ: 200-story tower in downtown Neo-Tokyo. 
         Heavily secured. Top 20 floors are R&D labs. 
         Dr. Chen's lab was on floor 187."
Why: Important location, but only relevant when there
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Android charging process"
Priority: 4 (LOW-MEDIUM)
Insertion Order: 65 (character details)
Token Budget: 20%
Keywords: charge, charging, battery, power
Probability: 70%
Content: "Character charges via wireless pad. Takes 2 hours for full charge. 
         Battery lasts 72 hours with normal use. 
         Low power causes slower processing, slurred speech."
Why: Practical detail, adds realism but not essential
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Entry: "Android LED eye indicator"
Priority: 2 (OPTIONAL)
Insertion Order: 75 (appearance details)
Token Budget: 10%
Keywords: LED, eyes glow, eye color
Probability: 30%
Content: "Character's eyes have subtle LED ring. 
         Blue when normal, yellow when processing heavily, 
         red when damaged or in combat mode."
Why: Visual flavor, rarely needs mention
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โฐ Time Investment

Step Time (First Lorebook) Time (Subsequent)
Categorize Entries 20-30 min 10-15 min
Assign Priority Numbers 15-25 min 10-15 min
Set Insertion Order 10-15 min 5-10 min
Configure Token Budget 10-15 min 5-10 min
Add Secondary Keys 15-25 min 10-15 min
Set Probability 5-10 min 3-5 min
Test and Iterate 30-45 min 20-30 min
TOTAL 105-165 min 63-100 min

First lorebook: 1.5-3 hours (learning curve)
Subsequent lorebooks: 1-1.5 hours (streamlined workflow)

ROI: Lorebook fires correctly 90%+ of the time instead of random/contradictory info.


๐Ÿ› Troubleshooting: Priority Issues

Problem: Critical Entry Not Firing

Causes:

  • Keywords don't match user message
  • Priority too low (getting dropped)
  • Probability set below 100%
  • Token budget already full

Solutions:

  1. Check keywords match user input (case sensitivity?)
  2. Increase priority to 9-10
  3. Set probability to 100%
  4. Reduce other entries' token budget
  5. Use debug panel to see what's firing

Problem: Wrong Entry Fires (Contradiction)

Causes:

  • Multiple entries have same keywords
  • Priorities are equal (system picks randomly)
  • Missing secondary keys for specificity

Solutions:

  1. Add secondary keys to differentiate
  2. Use NOT logic to exclude overlapping entries
  3. Increase priority on more specific entry
  4. Enable Group Selection Mode (if available)

Problem: Entry Fires Too Often

Causes:

  • Keywords too generic
  • Probability at 100% when it shouldn't be
  • No secondary keys to narrow triggers

Solutions:

  1. Make keywords more specific (e.g., "fire magic" not "magic")
  2. Add secondary keys with AND logic
  3. Reduce probability to 30-70%
  4. Use Min Messages to delay firing

Problem: Entry Ignored by AI

Causes:

  • Insertion order too low (too far from conversation)
  • Entry content too vague
  • Token budget too small (entry truncated)

Solutions:

  1. Increase insertion order to 60-80
  2. Rewrite content more clearly
  3. Increase token budget to 30-50%
  4. Move content to character definition if always needed

Problem: Token Budget Always Full

Causes:

  • Too many entries with high probability
  • Entries too verbose (using too many tokens)
  • Low-priority entries consuming space

Solutions:

  1. Reduce probability on flavor entries to 30-50%
  2. Shorten entry content (1-3 sentences ideal)
  3. Lower priority on optional entries to 1-2
  4. Increase overall token budget (if platform allows)

โ“ Frequently Asked Questions (FAQ)

What's the difference between priority and insertion order?

Priority = Which entries survive when token budget is exceeded (higher = more important)

Insertion Order = Where entries appear in the prompt (higher = closer to conversation = more AI attention)

Analogy:

  • Priority = VIP list at a club (higher priority = more likely to get in)
  • Insertion Order = Seating arrangement (higher order = closer to the stage)

What priority should I use for character backstory?

Depends on relevance:

Backstory Type Priority Insertion Order
Core origin (fundamental to character) 8-9 40-50
Major trauma (drives behavior) 7-8 45-55
Important events (shapes personality) 6-7 35-45
Minor history (adds depth) 4-5 30-40
Flavor details (nice to know) 2-3 25-35

Should all critical entries have priority 10?

No. Reserve 10 for absolutely fundamental info:

Priority 10:

  • Species/race
  • Gender/identity
  • Absolute constraints (cannot do X)
  • Core nature (vampire, android, immortal)

Priority 8-9:

  • Major secrets
  • Essential rules (magic system)
  • Key relationships

Why not all 10? If everything is critical, nothing is. Save 10 for info that would break the character if forgotten.


How do I handle entries that conflict?

Three approaches:

Approach 1: Secondary Keys

Entry 1: "Elves are peaceful"
Keywords: elf, elves
Secondary: "dark" with NOT ANY logic

Entry 2: "Dark elves are ruthless"
Keywords: dark elf, dark elves, drow

Approach 2: Priority Hierarchy

General entry: Priority 5
Specific entry: Priority 8 (wins when both match)

Approach 3: Group Selection

Both entries in same group
Enable "Use insertion order" or "Key match priority"
System picks best match automatically

What token budget should I set?

Platform defaults:

  • SillyTavern: 25% of context (default)
  • Janitor AI: 20-30% recommended
  • MegaNova Studio: 25% (default)
  • Chub AI: User-defined

Per-entry recommendations:

  • Critical entries: 40-50%
  • Important entries: 30-40%
  • Standard entries: 20-30%
  • Optional entries: 10-20%

Total lorebook budget: 20-30% of total context is sweet spot.


Can I change priority mid-chat?

Yes, but with limitations:

What works:

  • Adjusting priority in lorebook editor
  • Changes apply to new messages
  • Existing context won't change

What doesn't work:

  • Won't retroactively fix already-generated responses
  • Need to start new chat for full effect

Best practice: Test and finalize priorities before publishing character.


Do priority numbers work the same across all platforms?

Mostly, but with variations:

Platform Priority System Insertion Order Notes
SillyTavern 1-10 (higher = more important) 0-100 (higher = closer) Most standardized
Janitor AI 1-10 (higher = more important) 0-100 (higher = closer) Similar to ST
MegaNova Studio 1-10 (higher = more important) 0-100 (higher = closer) Follows standard
Chub AI 1-10 (higher = more important) 0-100 (lower = first) Backwards!
NovelAI Uses "Order" only 0-100 (higher = first) Different system

Always check platform docs! Chub AI's insertion order is backwards from most platforms.


How many lorebook entries is too many?

Quality over quantity:

Entry Count Token Impact Recommendation
1-10 Light Perfect for simple characters
11-20 Moderate Good for most characters
21-30 Heavy Complex worlds, use priorities carefully
31-50 Very Heavy Only for epic campaigns
50+ Extreme Consider splitting into multiple lorebooks

Rule of thumb: If you have 50+ entries, you're probably writing a novel, not a lorebook. Consolidate and prioritize.


What's the #1 priority mistake creators make?

Putting flavor text at high priority and critical info at low priority.

Example:

WRONG:
Entry: "Character's eye color" โ†’ Priority 8
Entry: "Character is immortal" โ†’ Priority 3

RIGHT:
Entry: "Character's eye color" โ†’ Priority 2
Entry: "Character is immortal" โ†’ Priority 10

Why it happens: Creators think "everything I wrote is important." It's not. Be ruthless about prioritization.


๐Ÿš€ Ready to Optimize Your Lorebook?

Stop guessing. Start engineering.

Get Started in 7 Steps:

  1. Sign Up Free โ†’ studio.meganova.ai
  2. Open Your Lorebook in editor
  3. Categorize Entries - Critical, Important, Standard, Optional
  4. Assign Priority Numbers - Use our 1-10 scale
  5. Set Insertion Order - Based on relevance to conversation
  6. Configure Token Budget - Per entry based on importance
  7. Test for 30 Messages - Adjust based on what fires

No credit card required. Start optimizing in under 5 minutes.

๐Ÿ‘‰ Optimize Your Lorebook Now


๐Ÿ“ข Share Your Lorebook Tips!

Found a clever priority trick? Share it!

  • Discord: Join MegaNova Discord and share in #lorebook-help
  • Twitter/X: Tag @meganovaai with #LorebookPriority
  • Reddit: Post in r/SillyTavernAI, r/JanitorAI, r/CharacterAI

Best lorebook setups get featured on the MegaNova blog! ๐ŸŒŸ


Official MegaNova Guides:

Platform Documentation:

Advanced Topics:


๐Ÿ“‹ Quick Reference: Priority Assignment Cheat Sheet

Entry Content Priority Insertion Order Token Budget Probability
Species/Race 10 75-80 50% 100%
Core Identity 10 75-80 50% 100%
Absolute Rules 10 70-75 45% 100%
Major Secrets 8-9 50-60 40% 100%
Magic System 9 50-55 40% 100%
Key Relationships 7-8 45-55 35% 100%
Character Backstory 6-8 40-50 35% 100%
Important Locations 5-6 25-35 30% 80%
World History 4-5 20-30 25% 70%
Character Habits 3-4 60-70 20% 60%
Cultural Details 2-3 25-35 15% 50%
Flavor Text 1-2 30-40 10% 30%
Easter Eggs 1 20-30 10% 10-20%

๐Ÿ’ก Pro Tips from Lorebook Masters

"I spend 60% of my lorebook time on priority and keywords. The content itself is secondary. Wrong priority = wrong info at wrong time."
โ€” Top SillyTavern Creator (200+ lorebooks)

"Test your lorebook with a debug panel. You'll be shocked how often entries don't fire when you think they should."
โ€” Janitor AI Power User

"My rule: If it would break the character to forget it, priority 10. If it's just interesting, priority 5 or lower."
โ€” Professional Character Designer

"Insertion order is more important than people think. I put character appearance at 80+ because AI references it constantly."
โ€” MegaNova Studio Moderator


Tags: #LorebookPriority #MegaNovaStudio #SillyTavern #JanitorAI #WorldInfo #TokenBudget #LorebookOptimization #AICharacter #CharacterDesign #LorebookTips

Category: AI Character Lorebook & World Info


๐Ÿ’ก Pro Tip: Use the debug panel to see which entries actually fire. What you think should fire โ‰  what actually fires. Create your free MegaNova Studio account to start optimizing!

Stay Connected

๐Ÿ’ป Website: Meganova Studio

๐ŸŽฎ Discord: Join our Discord

๐Ÿ‘ฝ Reddit: r/MegaNovaAI

๐Ÿฆ Twitter: @meganovaai