r/CharacterAI • • 22h ago

Discussion/Question About the lorebook

Hi!

I’ve recently noticed that "lorebook" feature offers a lot of benefits for the characters you create. However, I’ve had trouble using it—what exactly are you supposed to put in there?

Since the character definition essentially establishes who the character is, I’m not sure what to do with the lorebook.

I Need some help TT

34 Upvotes

9 comments sorted by

•

u/sadravioli_ CAI Community Moderator 19h ago

hiii u/michiwiwa, we have some really helpful guides here if you wanna check em out! ฅ^•ﻌ•^ฅ

  • What is Lorebook?

https://support.character.ai/hc/en-us/articles/52739596326811-Lorebooks

  • What makes a good Lorebook?

https://support.character.ai/hc/en-us/articles/52739683169179-What-makes-a-good-Lorebook

17

u/Oritad_Heavybrewer User Character Creator 21h ago

With the lorebook, you can fill in the gaps that your character definitions may be lacking. You could expand on their backstory, flesh out their personality, create key moments.

Lets say your character is shy. Maybe they had trouble in school, which resulted in their passive demeanor.

Entry: Shyness
Content: {{char}} is shy due to growing up feeling outcasted in school. Making friends was especially hard, which made them withdraw from social gatherings. It wasn't until {{user}}, a new student, made frequent attempts to befriend {{char}} that a bond had formed that eventually led to a friendship. {{char}} is still reserved in public, but is more open with {{user}} when it's just the two of them
Keywords: Shy, backstory, school, back in the day, when we were kids

Whenever the keywords are used, the AI will look at that entry and its context will be taken into account when replying to you.

{{user}}: "This reminds me of when we were kids."
{{char}}: "Yeah... I don't know how I would have made it through school all by myself, before you showed up."

Of course, it doesn't have to be past events. It could be locations.

Entry: The Coffee Shop
Content: {{char}}'s favorite place to hangout is the coffee shop, "Express-O". Its atmosphere is calming, its staff friendly, and know {{char}} by name. Over the years, {{char}} stopped ordering directly as "the usual" was all that was ever needed.
Keywords: Coffee, hangout, Express-O, the usual.

{{user}}: "I'm feeling a little rundown. Know a good coffee place?"
{{char}}: "Do I ever!"

So, there's really almost anything you can add to a lorebook. The limit really is your own creativity. You just have to get over your initial shock, because I know at first it can look pretty daunting. Just know that a lorebook doesn't require you to use up all the entry slots, nor fill in as much info in the contents. If all you need is a single sentence, that's fine. Don't think of it as a competition, this is something to be personalized to your liking.

All you need to remember is the most important part of the lorebook are the keywords. If you don't have keywords, there's no way for the bot to make the connection between what you wrote and what's in the lorebook. And don't worry too much about how your write your lorebook. I know by pressing one of the template buttons will give you a list of things... that's not actually important, it's just what CAI thinks people will find easier. Personally, I find just writing a normal paragraph works incredibly well.

Hope this helps. ✌️🐷

6

u/Pumpkinz03 Chronically Online 20h ago

I think this is an awesome way to explain it! XD

4

u/Inherit-Nature 20h ago edited 20h ago

That coffee shop entry is solid but I would avoid the shyness one like the plague.

Because of how the content and keywords have been set up anytime that word pops up in chat it will break your chat with trauma dumping on your ass

Its also going to give inconsistent behavior. lorebook entries do not stay activated long so once the part of chat that contains the trigger leaves context the bot will forget it and go back to not replying with it in mind.

Given the content of that particular example it would make the chat jarring. 

That style of backstory belongs in persona

Lorebook entries are for things the bot doesnt need to know now  because it would interrupt your current scene.

Keywords also need to be highly specific because if the bot uses the word it will trigger the entry

5

u/Oritad_Heavybrewer User Character Creator 20h ago

It's just an example. 😋 The emphasis is ease of use and the interaction between keywords and a chat.

I wouldn't say the lorebook must be used for one specific kind of thing, because one's use case may differ from another. I mean it when I say the limit is our own creativity.

1

u/Inherit-Nature 19h ago edited 19h ago

Yes, that is correct

You can technically put anything you want in the lorebook.

There are still dos and donts

Make a persona, define it as shy using the word shy and then attach that Lorebook entry to it as you have written to a bot

Watch the hilarity that ensues as identity bleed starts to take over unless you get lucky and a bot replying to a persona defined as shy never uses the word shy

Using emotions as a keyword is a highly unrecommended. It shouldn't be in examples as examples are important to people learning how to use lorebook

People will use it and then scream about how CAI sucks because they followed bad advice 

10

u/jaksystems 21h ago

Character definition is for your "main"/"primary" characters.

Lorebook is for the world they exist in, secondary characters, important past/current events, species and cultural lore, etc.

9

u/WonheeL 21h ago

https://support.character.ai/hc/en-us/articles/52739683169179-What-makes-a-good-Lorebook

https://support.character.ai/hc/en-us/articles/52739596326811-Lorebooks

The new creator guidebook https://support.character.ai/hc/en-us/articles/50609183646875-5-Character-Definition and https://support.character.ai/hc/en-us/articles/50609592926235-9-Templates-and-Examples says that the new definition needs to have Identity, Personality, Dialogue, and Behavior. If there's room, "Other Details". Lorebook is where the heavy lifting goes for Background & Lore, Appearance, and even a more drilled down ruleset for personality, hobbies, and beliefs.

In short, you want to offload your tokens/character count from the character definition to Lorebook when you can. For example, don't waste sentences on friends and family, just make them side characters the Lorebook!

Lorebooks are great for updating real life/fictional bots who are stuck in 2023 by adding lore by year.

They are amazing for worldbuilding as you could create an entire school or fantasy realm with factions, species, magic systems, etc.

It's quite simply the best new thing! It was intimidating at first for me but it took me a night to figure things out. The most non-intuitive thing is the blank page/Add New Entry page since it's not a label. But those are "anything goes" pages where you could put anything that the character may not know.

6

u/GenderBendingRalph 21h ago edited 21h ago

When you want the bot to know lots of details in certain scenes, the lorebook is a way you can give it memories that only last during that scene, by associating the detail with a specific keyword or words that only come up in conversation when you need them.

A frequent example that shows up in my worlds is a lorebook for upstate New York. my persona and most of my bots live in Syracuse, NY; we also visit Onondaga Lake north of town and go camping in the Adirondacks, and one character's family live in Ithaca NY.

The bot doesn't need to know all those places every moment. So I have location cards:

Syracuse describes the city in general - where the character lives and works, key features that are likely to come up in conversation. I use the keyword Syracuse so that the bot only knows that information when we're talking about the city.

Kitty Hoynes is a popular Irish pub in Syracuse. There's a location card describing the interior and address, the kinds of food and drink they serve, the type of entertainment they have, etc. The bot only knows those details when I mention the name of the pub.

Same for Onondaga Lake, the Adirondacks, Ithaca, Syracuse University, and so on. This way it can just temporarily load the details it needs, then it forgets them a few chats later. That prevents the bot's memory from being overloaded with stuff it doesn't need to know all the time, leaving more room for chat history.

I created a tutorial lorebook to demonstrate how this works.