AI Lorebook Guide: Build Worlds Your AI Remembers (2026)
Learn how to build an AI lorebook that actually works: semantic retrieval, keyword fallback, and recursive activation. Free entry templates.

Marco Vega
Tech Reviewer
Quick answer: an AI lorebook is a collection of world facts that your AI retrieves automatically when they become relevant: no manual pasting, no character-counting, no "remember this" prompts. The best lorebooks use semantic search (embeddings match conversation topics to entries), keyword fallback (catches what embeddings miss), and recursive activation (entries can reference other entries). Here's how to build one, with templates.
If you've used Kindroid's journal entries or Janitor AI's lorebooks, you know the basic idea: you write facts about your world, and the AI pulls them in when needed. It sounds straightforward. In practice, most lorebooks fail for the same three reasons, and the lorebook system in Kissable was built specifically to fix each one:
- They require manual triggers. You have to explicitly mention the right keyword, or the entry never activates. If your lorebook entry is titled "The Crimson Order" but the player says "that cult we heard about," the AI gets nothing.
- They treat entries as islands. Each entry stands alone. There's no chain of references. Mentioning "The Crimson Order" doesn't pull in "The Order's founder," "The founder's betrayal," or "The weapon they're searching for."
- They're too big or too vague. Bloated entries eat token budget. Vague entries match everything and nothing. The AI either runs out of context or ignores the lorebook entirely.
A proper lorebook system solves all three. Here's how to build one.
How Semantic Lorebook Retrieval Actually Works

When you write a lorebook entry, it gets converted into an embedding, a mathematical representation of what the entry is about, not just the words it contains. When someone sends a message in your adventure, that message also gets converted into an embedding. The system compares them. If the similarity score is high enough (≥ 0.30), the entry gets pulled into the AI's context.
This is fundamentally different from keyword matching. A player who says "that cult we heard about in the mountains" will trigger an entry titled "The Crimson Order" because the meaning is similar, even though the words are different. "Ancient magical barrier protecting the kingdom" and "the wizard's shield spell from the old war" will match the same entry about "The Veil."
What gets pulled when:
- Cosine similarity ≥ 0.30 → entry is activated
- Up to 8 entries per message (prevents context flooding)
- Entries are hybrid-scored: 70% semantic similarity + 30% importance weight
- Keyword fallback scans recent messages for entry titles (zero API cost, catches what embeddings miss)
Entry Templates: How to Write Lore That Actually Fires
The single biggest mistake is writing entries that are too vague or too bloated. An entry titled "Magic" will match everything and provide nothing. An entry that's 500 words of worldbuilding lore will eat your entire token budget in one go.
Each entry should be atomic: one specific fact, one specific entity, one specific rule. Think of them as Lego blocks the AI can combine, not encyclopedia articles.
Template 1: Entity Entry (People, Places, Objects)
TITLE: [Specific name, like "The Crimson Order," not "Cults"]
CONTENT:
- WHAT IT IS: [One sentence, such as "A secret society of blood mages founded 300 years ago."]
- CURRENT STATUS: [Active, dormant, destroyed, legendary]
- KEY MEMBERS: [1-2 named individuals, if relevant]
- GOAL: [What they want, such as "To find the Heart of Ash and use it to tear down the Veil."]
- NOTABLE DETAIL: [One distinctive thing the AI can reference, such as "Members identify each other by a red thread woven into their left sleeve."]
Template 2: Rule Entry (How the World Works)
TITLE: [The rule, like "Magic Exhaustion" or "The Veil"]
CONTENT:
- THE RULE: [One sentence, such as "All magic drains the caster's life force. Minor spells cause fatigue. Major spells age the caster visibly. The most powerful spells can kill."]
- WHO KNOWS THIS: [Common knowledge / arcane secret / forbidden knowledge]
- EXCEPTION: [If any, such as "Blood mages can draw power from others instead of themselves, which is why the Order is so dangerous."]
Template 3: History Entry (Events, Backstory)
TITLE: [The event, like "The Betrayal at Ashgate"]
CONTENT:
- WHAT HAPPENED: [One sentence, such as "The Crimson Order's founder, Aldric Vane, was betrayed by his apprentice and sealed inside the Heart of Ash."]
- WHEN: [300 years ago]
- WHO WAS THERE: [Aldric Vane, his apprentice Selene, the Council of Seven]
- CONSEQUENCES: [The Order fractured. Selene disappeared. The Heart was hidden. Three centuries of searching followed.]
Template 4: Character Entry (Important Figures)
TITLE: [Full name, like "Aldric Vane"]
CONTENT:
- WHO: [Founder of the Crimson Order, blood mage, currently sealed in the Heart of Ash]
- PERSONALITY: [Brilliant, paranoid, vengeful. He trusted one person and was betrayed. Now he trusts no one.]
- CURRENT WHEREABOUTS: [Trapped in a pocket dimension inside the Heart, conscious, aware of the outside world, waiting]
- WHAT HE WANTS: [Freedom. And revenge on Selene's bloodline, which, coincidentally, includes one of your NPCs.]
Template 5: Always-Active Entry (Core World Rules)
Always-active entries are injected into every message. Use them sparingly: the cap is 600 tokens total. These should be the fundamental truths of your world that the AI needs to know at all times.
TITLE: World Rules
CONTENT:
- Setting is a gaslamp fantasy world, roughly equivalent to 1890s technology with magic.
- Magic is real but rare. Most people have never seen it. Those who practice it hide it.
- The Veil is a magical barrier surrounding the kingdom, created 500 years ago. It keeps something out. Nobody remembers what.
- The Crimson Order is hunting for the Heart of Ash, an artifact that can destroy the Veil.
Keep always-active entries minimal. Four bullet points. If you're writing paragraphs, you're doing it wrong.
Recursive Activation: How Entries Chain Together

Here's where a real lorebook system pulls ahead of basic journal entries.
When an entry is activated, the system checks if that entry references any other entries. If it does, those get pulled in too, one level deep. This means a single player message can cascade through multiple connected facts.
Example chain:
Player says: "I found a red thread on the dead man's sleeve."
- "The Crimson Order" entry activates (semantic match on "red thread, sleeve, secret society patterns")
- This entry mentions the Heart of Ash → "The Heart of Ash" entry activates
- The Heart entry mentions Aldric Vane → "Aldric Vane" entry activates
- The Aldric entry mentions Selene → "The Betrayal at Ashgate" entry activates
The player said one line about a red thread. The AI now knows: this dead man was Crimson Order, they're hunting the Heart, Aldric Vane is still in there, and the whole mess traces back to Selene's betrayal 300 years ago. All from a single red thread.
This is what makes a lorebook feel like a living world instead of a reference document. The connections between entries are as important as the entries themselves.
Common Lorebook Mistakes

Entries that are too long. The token budget per message is 400 tokens. If a single entry eats half of that, the AI runs out of room for actual conversation. Keep entries to 3-5 bullet points. Be ruthless about cutting adjectives.
Titles that are too generic. "Magic," "The War," "History": these match everything and nothing. Use specific names: "Veil Magic," "The Siege of Ashgate (Year 212)," "The Betrayal."
No connections between entries. If your entries don't reference each other, the recursive activation chain never fires. Every entry should mention at least one other entry by name. "The Order was founded by Aldric Vane" → now the Aldric Vane entry chains in.
Too many always-active entries. The 600-token cap is shared across all always-active entries. If you mark 10 entries as always-active, each one gets ~60 tokens and none of them fire properly. Reserve always-active for 3-5 foundational world rules.
No keyword-friendly titles. Even with semantic search, keywords still matter. Include the most common search terms in or near your entry title. "The Crimson Order (also known as the Red Thread, the Blood Cult)" helps the keyword fallback catch variations. This is the kind of detail the Kissable lorebook rewards: semantic retrieval and keyword fallback work together, so well-named entries fire from both directions.
How This Compares to What You're Using
| Lorebook feature | Kindroid Journal Entries | Janitor AI Lorebooks | Kissable Lorebook |
|---|---|---|---|
| Semantic retrieval | No (keyword only) | Yes (basic embedding) | Yes (hybrid scoring: 70% semantic + 30% importance) |
| Keyword fallback | Yes (manual triggers) | No | Yes (zero-cost backup for missed matches) |
| Recursive activation | No | No (isolated entries) | Yes (one-level chain, entries reference other entries) |
| Always-active entries | No (manual only) | No | Yes (reserved for core world rules, 600-token cap) |
| Token budget control | Manual | Manual | Automatic (400 tokens/message, capped at 8 entries) |
| Shared across NPCs | No (per-character) | No (per-character) | Yes (all NPCs share the same lorebook) |
| Zero additional API cost | N/A | N/A | Yes (reuses the main memory embedding pipeline) |
How to Build Your First Lorebook
- List your entities. Write down every person, place, object, and concept that matters in your world. Don't write entries yet: just names. "The Crimson Order. Aldric Vane. The Heart of Ash. The Veil. Selene. The Council of Seven."
- Map the connections. Draw lines between them. Aldric → founded → The Order. Aldric → betrayed by → Selene. The Order → hunting → The Heart. The Heart → can destroy → The Veil. Every entity should connect to at least one other.
- Write the always-active entries first. What does the AI need to know in every single message? The setting. The core rules. The central conflict. Four bullet points, max.
- Write one entity entry at a time. Use the templates above. Keep each entry to 3-5 bullet points. Link to at least one other entry by name.
- Test. Play through your adventure and watch what fires. Did a player mention something that should have triggered an entry but didn't? Check the title: is it too vague? Is the content too far from what people actually say? Add keyword-friendly aliases.
- Iterate. After 2-3 playthroughs, you'll know which entries fire often (good), which never fire (cut or rename), and which fire too often (too vague, split into smaller entries).
FAQ
What is an AI lorebook?
An AI lorebook is a structured collection of world facts (people, places, objects, rules, and history) that an AI retrieves automatically when they become relevant to the conversation. Instead of pasting background lore into every message, you write each fact once and the system pulls in the right entries based on what's being discussed.
How is a lorebook different from a character backstory?
A character backstory describes one character. A lorebook describes the whole world around them: the factions, the history, the rules of magic, the places, the secrets. Backstories are always "on"; lorebook entries fire selectively, only when the conversation touches them, which keeps your token budget free for actual roleplay.
How long should a lorebook entry be?
Keep each entry atomic: 3-5 bullet points covering one specific entity, rule, or event. The per-message token budget is limited, so a single bloated 500-word entry can crowd out the conversation itself. Be ruthless about cutting adjectives and split anything that covers more than one idea into separate entries.
Why isn't my lorebook entry firing?
Usually the title is too vague or too far from how players actually phrase things. Semantic search matches meaning, but you still want keyword-friendly titles with common aliases: "The Crimson Order (also known as the Red Thread, the Blood Cult)." If an entry never activates, rename it to include the terms people really use.
Can I use a lorebook on Janitor AI or Character.ai?
Janitor AI offers basic lorebooks and Character.ai has limited world-info support, but most platforms rely on manual keyword triggers and treat every entry as an isolated island. A full system (semantic retrieval, keyword fallback, and recursive activation that chains connected entries together) is what separates a living world from a static reference document.
Related Articles
- How to Create AI Adventures: The Complete Guide
- How to Create NPCs for AI Roleplay
- How to Share and Publish AI Scenarios: Community Adventures
- Build AI Adventures on Your Phone: Mobile Scenario Creator Guide
- How to Make Your AI Girlfriend Remember Things
- Best AI Girlfriend Prompts and How to Write Them
Build worlds your AI actually remembers: start free, no credit card.

Tech Reviewer
Marco tests AI companion apps hands-on, comparing features, pricing, and real day-to-day experience across every major platform.