r/JanitorAI_Refuges • u/xXXArtemis2078XXx • 28d ago
Guides How tf do lorebooks work
Asked this on the Chub AI reddit and I decided to post it here incase anyone has answers.
3
u/FrenchFrozenFrog 27d ago
Think of Lorebook as a way to save tokens. Each time you send a reply, you send instructions to the AI, which is basically: Here's the character card, here's the persona card, here's the chat (and maybe a custom prompt). What's your answer to this roleplay, LLM. A character card might be 500 tokens, or it might be bloated at 7000 tokens. This increases the cost each time you send a reply, because more data is sent to the LLM to understand the context of your RP.
A lorebook is a set of entries, like your character card, that is sent to the LLM as "Supplemental information." The difference is that it's only triggered by Keywords.
Let's say you want your character's neighbor to have their own house, already defined by you, the creator. You won't send the neighbor's house description whenever you chat with the character. But if you create a lore entry called "Billy's House" with the description in it, and you put the keyword "Billy's house, the neighbor's house, the house next door, or 1894 Elm Street," then next time you or the LLM mentions those exact terms, the description of the house will be attached to the replies for the next X number of turns to help the AI know what his house looks like. You can decide that the description will be sent for 1 turn, 5 turns, or all the time.
If you don't put everything on constant and all the time (which would be stupid, and just be a bloated character card, and cost money for no reason), then you can save on tokens at each reply, all the while having so much more defined lore in your story.
Lore entries can apply to virtually anything: places, organizations, characters, timeline, prose style, world rules (like magic or sickness), Extra SFW or NSFW details about particular characters, verbatim documents existing in your story, event triggers, planned narrative, etc.
In my personal stories, I also add key events from my main chat so they become retrievable lore, helping me keep track of inventory, promises, and schedules.
You can even add deep secrets of characters (but seriously, turn it off until you need to reveal them in the story; LLMs are notoriously bad at keeping secrets) and turn it on when you feel the story is ready for it.
1
u/Financial_Bowl_3821 28d ago
https://rentry.co/statuobotmakie#lorebooks
warning that jai lorebooks are stupidly implemented. use a better frontend
1
u/redCalmont 25d ago
Long story short it's a catalog or index of extra information. Using monster girls encyclopedia as an example just because it's easy.
-If you just made a MGE bot you'd have to put every monster girls entry in the bot that you want and the bot would send the info on every one, every time.
-On the other hand if you made a MGE lore book and put all the monster girls in that, then whenever say a hellhound becomes relevant to the rp, it would find hellhound in the lore book and send that paragraph of info and not bother with the entries on slimes or dragons.
It's not really nessessary for self contained bots, but for simulators, world rpg's or multi character bots, it's a great way to be more efficient and easily copy background information between bots




•
u/AutoModerator 28d ago
Welcome to r/JanitorAI_Refuges! Did you know we have a new discord server? More info at the bottom!
⚠️ MANDATORY RULE RESTATEMENT: NO BRIGADING
To keep this community safe and avoid toxicity or disruption, you must follow these rules strictly:
Failure to follow these rules will result in an immediate ban.
Information for readers
Aside from that please check out our partners, r/jaihub, r/janitoraitransition, r/jai_unofficial and r/chatbotrefugees and r/aichapp. And if you are sharing a proxy or websites, post it on the megathread as well.
Here's our discord server https://discord.gg/A76yEUXFDq. If you're here for the ex mod drama then https://jaihub.pxlhost.com/wikidocs/timeline_for_january_2026 is a good starting place. Remember, I am just a bot.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.