> For the complete documentation index, see [llms.txt](https://docs.meganova.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meganova.ai/character-studio/chat-features/memory-system.md).

# Memory System

> **Note:** The memory system allows you to pin important facts and context that persist throughout your conversation, even as older messages leave the context window.

## Overview

The memory system provides:

* **Pinned memories** — Facts that stay in context
* **Persistent context** — Information that doesn't get trimmed
* **Manual control** — You decide what's important
* **Per-session** — Different memories per conversation

## How Memory Works

### Context Window Limitation

AI models have limited context:

1. System prompt uses some tokens
2. Character data uses tokens
3. Chat history fills the rest
4. Old messages get trimmed

### Pinned Memories Solve This

Pinned memories:

1. Stay at the start of context
2. Never get trimmed
3. Always available to AI
4. Override normal trimming

## Accessing Memory Manager

### From Chat

1. Click **Memory** icon in chat
2. Or click **Memory Manager** button
3. Panel opens showing current memories

### Memory Panel

Shows:

* Current pinned memories
* Add new memory
* Edit existing
* Delete memories

## Adding Memories

### Step 1: Open Memory Manager

Click memory icon in chat interface.

### Step 2: Add Memory

1. Click **Add Memory** or **Pin**
2. Enter the fact/context
3. Click **Save**

### What to Pin

**Good memories:**

```
"User's name is Alex"
"User mentioned they're a doctor"
"We established the story takes place in 2045"
"User prefers detailed responses"
"Character promised to help find the artifact"
```

**Avoid pinning:**

```
"User said hello" (not important)
"Character greeted user" (not important)
Entire conversation summaries (too long)
```

## Managing Memories

### Editing

1. Click memory to edit
2. Modify text
3. Save changes

### Deleting

1. Click delete icon
2. Confirm removal
3. Memory no longer included

### Viewing All

Memory Manager shows all pinned memories:

* Text content
* When added
* Token count

## Best Practices

### Pin Early

When important info appears:

1. Identify key facts
2. Pin immediately
3. Don't wait for context to fill

### Keep Memories Focused

* One fact per memory
* Clear and concise
* Specific information

### Monitor Token Usage

Memories use tokens:

* Each memory costs tokens
* Too many = less chat history
* Balance pinned vs conversation

### Update as Needed

As conversation evolves:

* Remove outdated memories
* Update changed information
* Add new key facts

## Memory Strategies

### Character Information

Pin established character facts:

```
"Character revealed they're actually a spy"
"Character's sister is named Elena"
"Character is afraid of water"
```

### User Information

Pin what you've shared:

```
"I'm playing as a merchant named Kai"
"I'm interested in the political intrigue"
"I want to focus on romance plot"
```

### Story Progress

Pin narrative developments:

```
"We found the hidden map"
"The villain has been revealed"
"Alliance formed with the rebels"
```

## Troubleshooting

### Memories not affecting responses

**Check:**

* Memory is properly saved
* Memory is clear and specific
* Not contradicted by other context

### Too many memories

**Solution:**

* Remove less important ones
* Combine related facts
* Summarize instead of listing

### Character forgets anyway

**Causes:**

* Memory too vague
* Conflicting information
* Model limitations

**Solutions:**

* Make memory more specific
* Remove conflicts
* Reinforce in conversation

## Memory vs Lorebook

| Aspect   | Memory      | Lorebook      |
| -------- | ----------- | ------------- |
| Scope    | Per-session | Per-character |
| Control  | User        | Creator       |
| Trigger  | Always      | Keywords      |
| Use case | Chat facts  | World info    |

## See Also

* [Chat Sessions](https://docs.meganova.ai/character-studio/chat-features/chat-sessions.md) — Session management
* [Lorebooks](https://docs.meganova.ai/character-studio/character-features/lorebooks.md) — Character knowledge
* [Token Management](https://docs.meganova.ai/character-studio/advanced/token-management.md) — Understanding context
