Lorebooks
How keyword-triggered lore entries inject setting, rules, and background into context.
The Lorebook System
A filing cabinet next to the AI's desk.
A lorebook is a collection of facts, lore, or instructions that get added to the context automatically — but only when they're relevant. Most of the time the drawers stay closed. When something in the conversation matches a keyword on a folder, that folder gets pulled out and placed on the desk.
Keyword Matching
Inkstone scans the last 2 messages (by default) for keywords. Matched entries get injected before or after the character card.
Budget Management
Default budget: 2500 tokens. Entries sorted by priority. When the budget's full, lower-priority entries sit this round out.
Constant
Always included. No keyword needed.
Selective
Needs primary + secondary keyword match.
Recursive
Matched entries trigger more matches. Use carefully.
You can see what lore is currently active in any chat via the Active Lore Entries panel in the chat options menu. It shows each entry and its remaining TTL turns.
Want to write better lorebooks? Read the Companion Playbook
That's the whole machine. Each system is designed to stay out of your way when you don't need it and be there when you do.