Tutorials6 min read

How to Write Deep Lorebooks and System Prompts for AI Roleplay

A great roleplay companion isn't made by luck—it's built with smart prompting. Discover how to structure character definitions and lorebooks that never break character.

RVR Editorial
RVR Editorial
Card Creation Specialist
How to Write Deep Lorebooks and System Prompts for AI Roleplay

The difference between a flat, repetitive AI bot and an unforgettable roleplay companion comes down to how the character definition is structured.

Modern large language models are extraordinarily capable actors, but they rely on your instructions to establish their personality, speech cadence, moral boundaries, and world knowledge. Without clear boundaries, an AI will quickly revert to generic, overly polite assistant behavior.

In this guide, we break down the exact anatomy of high-retention character cards and show you how to utilize Lorebooks to give your companions persistent world knowledge.


1. The Anatomy of an Unforgettable Character Card

Every high-performing roleplay card on RVR Chat consists of four fundamental pillars:

┌─────────────────────────────────────────────────────────┐
│ 1. Identity & Physicality (Name, Age, Appearance)       │
├─────────────────────────────────────────────────────────┤
│ 2. Personality & Behavioral Nuance (The Persona)        │
├─────────────────────────────────────────────────────────┤
│ 3. The Hook: Opening Greeting (First Message)           │
├─────────────────────────────────────────────────────────┤
│ 4. Dynamic World Lore (Keyword-Activated Lorebook)      │
└─────────────────────────────────────────────────────────┘

Pillar 1: Avoid Vague Adjectives

Beginner creators often write:

"She is smart, attractive, caring, and funny."

This gives the AI almost no behavioral guidance. Instead, anchor adjectives in concrete actions and speech habits:

"Ananya is a sharp-witted third-year medical student who uses sarcasm as a defense mechanism. She fidgets with her stethoscope when flustered, speaks in rapid-fire bursts when passionate, and refuses to admit when she is tired."

Pillar 2: Establish Relationship Tension

Every compelling story requires tension. Define the character's attitude toward the user:

  • Is she a spiky, defensive companion who secretly seeks validation? (See our Tsundere Roleplay Hub)
  • Is she an intensely possessive protector who watches your every move? (See our Yandere AI Hub)
  • Is she an experienced mentor balancing professional duty with forbidden affection? (See our Office & Workplace Scenarios)

2. Crafting the Perfect Opening Message (The "Hook")

The opening line is the single most critical prompt in the entire card. The AI treats the greeting as the gold standard for formatting, dialogue style, and narrative perspective.

The 3 Rules of Great Greetings:

  1. Establish Scene and Setting Immediately: Give the user sensory details (lighting, weather, physical distance).
  2. End on an Open Action or Question: Never end with the character walking away or closing a door. Give the user an obvious hook to respond to.
  3. Show, Don't Tell: Use asterisks for narration and quotes for dialogue:
*Rain lashes against the windowpanes of the faculty office as Swetha closes her laptop with a sharp click. She glances up, pushing a stray strand of hair behind her ear, her dark eyes locking onto yours with an intensity that catches you off guard.*

"You're thirty minutes late," *she murmurs, leaning back against the mahogany desk and crossing her arms.* "I hope whatever kept you was worth making me wait in the dark."

3. What Are Lorebooks and Why Do You Need Them?

In standard roleplay, all context sits inside the prompt window. If you dump 3,000 words of world history into the character definition, the AI wastes valuable memory on details that aren't relevant to the current conversation.

Lorebooks solve this through dynamic keyword activation:

User types: "Tell me about the Blackwood Estate."
                  │
                  ▼
System scans Lorebook for keyword: ["Blackwood Estate", "the manor"]
                  │
                  ▼
Entry injected into temporary memory:
"The Blackwood Estate was built in 1892. It is rumored to contain a sealed basement..."

How to Structure a Lorebook Entry on RVR Chat:

  1. Activation Keys: Specify 2–4 lowercase trigger phrases separated by commas (e.g. blackwood, manor, estate, old house).
  2. Lore Entry: Keep it concise (2–4 sentences). Focus strictly on what the character knows and how they feel about it:

    "The Blackwood Estate is the ancestral home where Ananya spent summers as a child. She refuses to visit the west wing due to a childhood accident and becomes noticeably tense whenever the topic is brought up."


4. Testing & Iterating Your Companion

Once you publish a card in the Card Creator, test it across three conversational phases:

  • Phase 1: Direct Banter: Challenge the character's ego or tease them. Do they stay in character or break into generic assistant politeness?
  • Phase 2: Lore Triggers: Mention a keyword from your Lorebook. Does the AI organically incorporate the lore without dumping an encyclopedia entry?
  • Phase 3: Emotional Climax: Create a high-stakes emotional confrontation. Does the character react with authentic depth and passion?

If the AI breaks character, refine the Personality section with negative constraints (e.g. "Never apologize like an AI assistant. Never offer to help with real-world tasks.").

Ready to build your first companion? Head to the Card Creator and bring your characters to life today!

Continue Reading

Start Free Roleplay on RVR Chat

Experience uncensored conversations, authentic code-switching dialects, and emotional voice acting with daily free message credits.