> For the complete documentation index, see [llms.txt](https://fictionlab.gitbook.io/fictionlab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fictionlab.gitbook.io/fictionlab/getting-started/memory-matrix.md).

# Memory Matrix

Memory Matrix is used to keep all the important information about the chat

## Lore database

<figure><img src="https://1609737647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVIRfsD09dmbHLyvXfut%2Fuploads%2FQjvfSfgeiQlv45l9qWPN%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media&amp;token=82eb333a-9b9c-4848-8b5b-0a95fb88c2b7" alt=""><figcaption></figcaption></figure>

Lore database is a place inside the Memory Matrix where you can access your lore pieces and their current status.\
\
If you scroll to the bottom of it, you can find **"AI MEMORIES"** section.

## Memories

Memories help the AI remember important events that have already occurred during the roleplay. Think of them as sticky notes—small reminders that are presented to the AI throughout the session.

**Memories significantly extend the AI's memory and, in the best-case scenario, allow it to recall events from thousands of messages ago!**\
\
**Memories are more detailed with FL+.**

**Important Guidelines:**

* Use memories only to summarize past events.
* Do *not* use them to introduce new lore, plan future events, or give the AI instructions. Lore Pieces and Custom LLM instructions are made for that purpose.
* Misusing memories can negatively affect the quality of the roleplay.

Memories are automatically generated *every 30 chat messages*— a total of the User reply and AI reply.

For manual memory generation, use the slash command /memory-cards N where N is a number from 10 to 50.

Free users are limited to 100 memories, while FictionLab+ users have access to 500 memories.

<figure><img src="https://1609737647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVIRfsD09dmbHLyvXfut%2Fuploads%2FHpsyaXOx1pbhzA7Vj39i%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media&amp;token=a15d283a-6280-4562-b7c2-ff305e98332d" alt=""><figcaption></figcaption></figure>

### Pinning Memories

You can **pin** important memories to ensure they don't get deleted when the limit for memory cards is reached. Unpinned memories are deleted in order of creation to make space for new ones.

Make sure to click Pin then click Save to pin a memory.

**Things to Note:**

* You'll receive a soft warning at 10 pins so you're aware of your budget. Free users have a max 25 pins and Plus/Ultra users have 50.
* Pinning too many memories will hurt the memory because there will be no space for new ones. Always leave some space for new memories.
* Memories are generated by a different AI model with a separate provider. They are *not* generated by the FictionLab chat models (LLMs) such as Ophelia or Oracle. Therefore, memories generation may sometimes experience heavy traffic or errors separately from what the LLMs are exhibiting. Please report bugs on the official Discord server!&#x20;

## How Memory Limits Work

When your memory storage reaches its limit, FictionLab automatically removes older memories to make room for new ones.

**Manually created memories receive extra protection.** Each subscription tier has a number of protected manual memory cards. As long as you're within that allowance, the system removes automatically generated memories first.

| Subscription | Total Memory Limit | Protected Manual Memories |
| ------------ | ------------------ | ------------------------- |
| Free         | 100                | 25                        |
| Plus         | 500                | 125                       |
| Ultra        | 1,000              | 250                       |

**What does this mean for you?**

For example, if you're a Free user with 20 manually created memories, those 20 cards are protected when your storage fills up. The system will remove older automatically generated memories instead.

If you have more than 25 manually created memories, the additional cards may also be removed when space is needed.

**What about Dynamic Lore?**

Dynamic Lore has a separate limit of 50 cards. Unlike manually created memories, dynamically generated characters and locations do not receive additional protection. When the limit is reached, the oldest Dynamic Lore cards are removed first to make room for new ones.

{% hint style="info" %}
**Tip:** Manually created memories are useful for preserving important events or details you'd like your characters to remember. Keep an eye on your memory limits to avoid losing information you want to retain.
{% endhint %}
