> For the complete documentation index, see [llms.txt](https://docs.moescape.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moescape.ai/tavern-chatbot-guide/scan-depth-support-and-lorebooks.md).

# Scan Depth Support & Lorebooks

Shape your character's behavior and world with custom rules and lore for a one-of-a-kind, immersive adventure!

### Step 1

Create Lorebook

<figure><img src="/files/WxEr67ykyC7FzccBITew" alt=""><figcaption></figcaption></figure>

Enter Title & Scan Depth as well as:

* Select applicable categories (up to 7 max)
* Visibility - set the lorebook private or public
  * Public - everyone can use it
  * Private - only you can use it

Optional (but highly recommended!):

* Attach a cover image (recommended)
* Lorebook description (recommended)

{% hint style="info" %}
**What is Scan Depth?**&#x20;

Scan Depth is a setting for the knowledge base that determines how many previous messages the search should analyze for lorebook keywords. This helps the bot retain lorebook content in its memory for a longer period.

**Example:**

* If set to 1, it will only check the last user message for the lorebook keyword.
* If set to 4, it will check the last 4 messages (including bot messages).
  {% endhint %}

<figure><img src="/files/mjb9hkVlO2gKfYnuYBrD" alt=""><figcaption></figcaption></figure>

### Step 2

Create Entries To Explain The Rules And Lore

<figure><img src="/files/oBZW26HqabVquICx1fDK" alt=""><figcaption></figcaption></figure>

### Step 3

Set Activation Keys

<figure><img src="/files/kX9KSEpMtF33QIog2QuY" alt=""><figcaption></figcaption></figure>

### Step 4

Use the activation key to trigger the entry during the conversation.

<figure><img src="/files/AndZsfU2dPI5xO7BgJlI" alt=""><figcaption></figcaption></figure>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moescape.ai/tavern-chatbot-guide/scan-depth-support-and-lorebooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
