Silly Tavern character card fields (4/5): Lorebook — character_book and entries
Series: Silly Tavern character card fields (5 parts). Structure follows the
CharacterBooktype in the V2 explainer; how Silly Tavern imports this into World Info / character lore depends on your ST version.
What character_book is
Terminology from the spec:
- Lorebook: keyword-triggered entries stitched into the prompt.
- World book: lore not tied to a single card.
- Character book: lore embedded in the card so users don’t fetch a separate world file.
The spec recommends stacking character and world lore (not replacing), and suggests character book first, then world book when budget is tight—implementation varies.
Outer fields (concept)
Besides entries, a book may include:
name/description: human-readable labels.scan_depth,token_budget,recursive_scanning: how much history to scan, total budget, recursive triggers (mapped differently per app).extensions: must be an object; default{}; do not delete unknown keys.
Each entry (concept)
| Field | Plain language |
|---|---|
keys | Keywords that can fire this entry |
content | Text inserted when fired |
secondary_keys | Used with selective for two-key triggers |
selective | Whether dual-key logic is enabled |
enabled | On/off |
insertion_order | Lower numbers insert higher in the stack when multiple entries fire |
case_sensitive | Keyword case sensitivity |
constant | If true, always insert within budget |
position | 'before_char' or 'after_char' |
priority | When budget is tight, lower numbers may drop first |
extensions | Per-entry bag; preserve unknown keys |
Some fields are noted as not mapped in every frontend—verify in ST when migrating cards.
Tiny sample (illustrative only)
"character_book": {
"name": "Shop lore",
"scan_depth": 50,
"token_budget": 300,
"recursive_scanning": false,
"extensions": {},
"entries": [
{
"keys": ["register", "loose leaf"],
"content": "This register was insect-damaged; the client glued the spine last year—avoid stressing that repair.",
"enabled": true,
"insertion_order": 100,
"case_sensitive": false,
"selective": false,
"secondary_keys": [],
"constant": false,
"position": "before_char",
"extensions": {}
},
{
"keys": ["paste"],
"content": "The studio uses wheat-starch paste—low odor; ink-sensitive people may find it sharp.",
"enabled": true,
"insertion_order": 200,
"selective": true,
"secondary_keys": ["allergy"],
"extensions": {}
}
]
}Workflow in three verbs: pick keywords → write short entries → chat a few turns to check false triggers.
Previous: (3/5) Openings & context
Next: (5/5) Extensions & debugging
Series index: Blog · Silly Tavern character card fields
Edit character_book and write back to PNG on Mac with Sillycard. Details: App Store and in-app copy.