docs: update all documentation and screenshots for v2.1.6 release

- Injection viewer docs: add Context/Prompt Breakdown section, rename
  CharMemory → Data Bank, document token hints and Tips popup
- Managing memories docs: rewrite View/Edit for unified block editor
  with inline editing, undo, Save/Cancel, character picker
- Group chats docs: update Memory Manager from dual-pane to character picker
- Architecture docs: update line counts, editor factory note, section map
- Getting started docs: update memory viewing section for new editor
- Troubleshooting docs: update health checks from 7 to 9, add retrieve
  chunks and score threshold rows
- README: add Prompt Breakdown feature highlight, update upgrade notice,
  clean up tablet/phone bullet
- Screenshots: new injection viewer (with Prompt Breakdown and memories),
  new Memory Manager (unified editor), new editing mode screenshot
- CLAUDE.md: update index.js line count

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
bal-spec 2026-03-07 15:19:12 -08:00
parent c372ee660e
commit e97cc7c7fe
12 changed files with 64 additions and 44 deletions

View file

@ -11,7 +11,7 @@ A SillyTavern extension that automatically extracts structured character memorie
## File Structure
```
index.js — All extension logic: extraction, consolidation, provider API calls, UI controllers, event handlers, modals (~7800 lines)
index.js — All extension logic: extraction, consolidation, provider API calls, UI controllers, event handlers, modals (~8660 lines)
lib.js — Pure utility functions imported by index.js at runtime and used by tests (parsing, serialization, formatting, stripping)
editor.js — Shared memory block editor factory (createMemoryEditor) with state management and undo
settings.html — Sidebar dashboard HTML (stats bar, extraction controls, tool launchers, activity, diagnostics)

View file

@ -2,7 +2,8 @@
CharMemory automatically extracts structured memories from your chats and stores them in the character's Data Bank. SillyTavern's built-in Vector Storage retrieves the most relevant ones at generation time — your character remembers what happened.
>**This is a beta release. It contains extensive under the hood code changes, alters the extraction prompts and the structure of the extracted memories. If you used previous versions, you should plan to back up your current files.**
>**Upgrading from 1.x?**
This release contains extensive under the hood code changes, alters the extraction prompts and the structure of the extracted memories. If you used previous versions, you should back up your current files before updating and you'll want to compare your edited prompts with the new ones.
![CharMemory panel open in the SillyTavern sidebar](images/panel-full.png)
@ -28,12 +29,13 @@ CharMemory does not touch your lorebooks so if those contain information about t
- **Automatic extraction** — automatically extracts memories from your current chat. No manual steps after setup.
- **Group chat support** — each group member gets their own memory file, extracted in a single pass. View and edit all members' memories from one place, including a full Data Bank browser per character.
- **Injection Viewer** — a real-time sidebar showing exactly which memories were injected for any message, with scores and lorebook context.
- **Injection Viewer** — a real-time sidebar showing exactly which memories were injected for any message, with lorebook entries, extension prompts, and per-source token estimates.
- **Prompt Breakdown** — see exactly where your context window is going. The injection viewer shows a per-category token breakdown (System, Char card, Lorebook, Data Bank, Examples, Chat history) with a stacked bar and actionable tips for reducing usage.
- **Vector Storage health checks** — a traffic-light indicator flags misconfigured settings and tells you what to fix, so you're not guessing why memories aren't showing up.
- **Full memory control** — browse, edit, or delete individual memories. Consolidate duplicates with preview and undo. Batch-extract from all chats at once.
- **Full memory control** — browse, edit, or delete individual memories with a unified block editor (inline editing, undo, find/replace). Consolidate duplicates with preview and undo. Batch-extract from all chats at once.
- **Highly configurable extraction prompts** — separate prompts for 1:1 and group chats and memory file consolidation and conversion.
- **Guided setup** — the Setup Wizard tests your LLM connection, checks Vector Storage, and handles existing memory file conversion in about 2 minutes.
- **Tablet & phone support** *(new in 2.1.0 — testing appreciated!)* — on touch devices, the dashboard opens as a floating panel with touch-friendly controls. Phone layout widens drawers for small screens. If auto-detection doesn't match your device, override it in Settings > Advanced > Display Mode. Please [report issues](https://github.com/bal-spec/sillytavern-character-memory/issues) with how it behaves on your device.
- **Tablet & phone support** — on touch devices, the dashboard opens as a floating panel with touch-friendly controls. Phone layout widens drawers for small screens. If auto-detection doesn't match your device, override it in Settings > Advanced > Display Mode. Please [report issues on GitHub](https://github.com/bal-spec/sillytavern-character-memory/issues) with how it behaves on your device.
- **Plain files** — memories are stored as readable, editable markdown in the character's Data Bank. No database, no lock-in.
## What you need
@ -80,8 +82,8 @@ The documentation uses **Flux** (an orange tabby cat) and **Alex** as fictional
## What it looks like
![Memory Manager showing memory cards with topic tags and bullet points](images/memory-manager.png)
![Memory Manager showing memory cards with find/replace and edit controls](images/memory-manager.png)
![Injection Viewer showing memories injected for the latest message](images/injection-viewer.png)
![Injection Viewer showing context breakdown, memories, and lorebook entries](images/injection-viewer.png)
![Data Bank browser showing memory files for multiple group members](images/databank-group.png)

View file

@ -20,11 +20,11 @@ The extension writes memories as plain markdown files to the Data Bank. Vector S
| File | Lines | Role |
|------|------:|------|
| `index.js` | ~8200 | Main runtime: extraction pipeline, LLM dispatch, all UI (modals, drawers, sidebar), event handlers, provider API calls |
| `index.js` | ~8660 | Main runtime: extraction pipeline, LLM dispatch, all UI (modals, drawers, sidebar), event handlers, provider API calls |
| `lib.js` | ~520 | Pure utility functions: parsing, serialization, text processing, format detection. Canonical source — `index.js` imports these at runtime |
| `editor.js` | ~110 | Memory block editor factory. Pure state management with undo stack — no DOM. Used by preview dialogs |
| `settings.html` | ~100 | Sidebar dashboard HTML: stats bar, tool buttons, activity log, diagnostics summary |
| `style.css` | ~1940 | All styling: dashboard, modals, drawers, wizard, troubleshooter, memory cards |
| `style.css` | ~2160 | All styling: dashboard, modals, drawers, wizard, troubleshooter, memory cards, token budget |
| `manifest.json` | 12 | Extension metadata: version, load order, entry points |
### Module relationships
@ -64,14 +64,14 @@ The file is large. This section-by-section map helps you navigate it. Line numbe
| 40164520 | **Prompts modal** | `showPromptsModal()` — 4-tab prompt editor with version tracking |
| 45235300 | **Setup wizard** | `showSetupWizard()` — 3-step first-run flow |
| 53065935 | **Troubleshooter** | `showTroubleshooter()` — health checks, Data Bank browser, diagnostic report |
| 59386250 | **Memory Manager** | `showMemoryManager()`browse/edit/delete individual memories |
| 62546340 | **Find & Replace** | `buildFindReplaceBar()`, `wireFindReplaceEvents()`, `highlightText()` |
| 59386500 | **Memory Manager** | `showMemoryManager()`unified block editor with character picker for groups, inline editing, undo, find/replace |
| 65006590 | **Find & Replace** | `buildFindReplaceBar()`, `wireFindReplaceEvents()`, `highlightText()` |
| 63446820 | **Consolidation** | Strategy presets (conservative/balanced/aggressive), LLM consolidation, preview dialog, undo |
| 68217138 | **Reformat** | Format migration preview dialog, LLM-powered reformat, undo |
| 71397355 | **Slash commands & wiring** | `registerSlashCommands()`, `setupToolControls()`, `setupLogControls()`, `setupListeners()` |
| 73607740 | **Per-message UI** | Extract Here / Pin Memory / View Injected buttons, injection drawer, log drawer |
| 77537960 | **Batch extraction** | `showBatchPopup()`, `runBatchExtraction()` — multi-chat extraction |
| 79638164 | **Initialization** | Extension entry point: loads HTML, calls `loadSettings()`, wires events, auto-triggers wizard on first run |
| 73608000 | **Per-message UI & Injection Viewer** | Extract Here / Pin Memory / View Injected buttons, injection drawer with Context/Prompt Breakdown/token budget panel, log drawer |
| 80008210 | **Batch extraction** | `showBatchPopup()`, `runBatchExtraction()` — multi-chat extraction |
| 82108660 | **Initialization** | Extension entry point: loads HTML, calls `loadSettings()`, wires events, auto-triggers wizard on first run |
---
@ -150,7 +150,7 @@ countMatches(), findAndReplaceAll()
Every mutation calls `saveVersion()` first, pushing a deep clone onto the undo stack. This makes any operation (including Replace All) undoable as a single step.
Used by the Consolidation, Conversion, Reformat, and Data Bank editor dialogs. The Memory Manager uses its own standalone editing logic since it writes directly to disk per-bullet.
Used by the Consolidation, Conversion, Reformat, Data Bank editor, and Memory Manager dialogs. All five editing surfaces share this unified editor — inline editing, undo, add/delete, and find/replace work identically everywhere.
---

View file

@ -114,15 +114,11 @@ Extraction speed will vary based on the number of messages being sent to the LLM
There are a few ways to view your memories — you can open the Data Bank directly and read the raw file, or use the Memory Manager for a more structured view. Click **View / Edit** in the CharMemory panel to open the Memory Manager.
![Memory Manager showing memory cards with topic tags and edit controls](../images/memory-manager.png)
![Memory Manager showing memory cards with find/replace bar and Save/Cancel buttons](../images/memory-manager.png)
Memories appear as cards grouped by extraction, newest first. Each card shows the chat it came from, the extraction timestamp, and the individual memory bullets. You can:
Memories appear as cards grouped by extraction, newest first. Each card shows the extraction timestamp and the individual memory bullets. Click the **pencil icon** on any card to enter edit mode — bullets become editable text fields where you can modify, delete, or add new memories. The editor includes **find/replace**, **undo**, and explicit **Save/Cancel** buttons so nothing is written to disk until you confirm. In group chats, a **character picker** lets you switch between members.
- **Edit** any bullet to refine its wording
- **Delete** individual bullets (empty cards are removed automatically)
- Browse by scrolling — in group chats, each character has their own section
Memories are stored as a plain markdown file in the character's Data Bank. You can also edit that file directly from the **Data Bank** button in the panel.
Memories are stored as a plain markdown file in the character's Data Bank. You can also edit that file directly from the **Data Bank** button in the panel. See [Managing Memories](managing-memories.md) for the full editing reference.
---

View file

@ -23,11 +23,9 @@ The group chat uses a **separate extraction prompt** from 1:1 chats. It follows
## Viewing and editing group memories
Click **View / Edit** to open the Memory Manager. In a group chat it shows a section per character, each with their own memory cards. Edit and delete controls work the same as in 1:1 — they target the correct character's file based on which section the control is in.
Click **View / Edit** to open the Memory Manager. In a group chat, a **character picker** appears first — select which member's memories to view and edit. Memory cards for the selected character are displayed with the same editing interface as in 1:1 chats (inline editing, undo, find/replace, Save/Cancel).
![Memory Manager in a group chat showing two character sections](../images/memory-manager-group-both.png)
Newest memory blocks appear first (reverse chronological) within each character's section.
Newest memory blocks appear first (reverse chronological). Switch between characters using the picker at the top to review or edit each member's memories.
---

View file

@ -18,25 +18,40 @@ Once open, click the **pen icon** on any character message to load that message'
## What the viewer shows
The viewer has three collapsible sections:
The viewer has four collapsible sections:
### CharMemory
### Context
The memory bullets that Vector Storage retrieved and injected for this generation. The header shows a count (e.g., "CharMemory (6)"). Each bullet is listed individually — this is the direct answer to "what did the character remember when writing this message?"
The **Context** section appears at the top and loads automatically when you open a message's injection data. It shows a **Prompt Breakdown** — a per-category token breakdown of the full prompt that was sent to the LLM:
- **System** — system prompt tokens
- **Char card** — character description and personality
- **Lorebook** — World Info / lorebook entries that fired
- **Data Bank** — CharMemory's injected memories
- **Examples** — example dialogue
- **Chat history** — the actual conversation messages
When SillyTavern's Prompt Itemization data is available (current session), the numbers are exact token counts. For snapshots from previous sessions, the section shows estimated counts based on character length (~4 chars/token) with a note that the numbers are approximate.
A compact **stacked bar** visualizes the proportions at a glance, and a **"Tips"** link opens actionable guidance for reducing token usage across each category.
If tracked injections exceed the model's context window, a **red health note** flags the overflow. If they exceed 40% of context (leaving little room for char card and chat history), a **yellow advisory** appears.
### Data Bank
The memory bullets that Vector Storage retrieved and injected for this generation. The header shows a count and estimated token cost (e.g., "Data Bank (6) ~120 tk"). Each bullet is listed individually — this is the direct answer to "what did the character remember when writing this message?"
If this section is empty but memories exist in the file, Vector Storage either filtered them out (score threshold too high) or didn't find a close enough semantic match. See [Retrieval & Prompts](retrieval-and-prompts.md) for how to tune retrieval.
![CharMemory section expanded showing memory bullets with topic tags](../images/injection-viewer.png)
### Lorebook Entries
Which World Info / lorebook entries fired for this generation, based on their trigger keywords matching the recent conversation. Each entry shows its name, trigger keys, and a content preview.
Which World Info / lorebook entries fired for this generation, based on their trigger keywords matching the recent conversation. Each entry shows its name, trigger keys, estimated token cost (~N tk), and a content preview.
If an entry you expected to see isn't listed, its keywords didn't match the recent context window. This section is useful for understanding the full picture — memories and lorebook entries both contribute to what the character "knows," and they can complement or conflict with each other.
### Extension Prompts
The raw content injected by all active extensions, keyed by injection position (e.g., `4_vectors_data_bank` for Vector Storage, `2_floating_prompt` for Author's Note). This is the unprocessed view — useful for seeing the exact `<memory>` block markup and chunk boundaries that the LLM received.
Content injected by all active extensions, keyed by injection position (e.g., `4_vectors_data_bank` for Vector Storage, `2_floating_prompt` for Author's Note). Each extension's entry shows its estimated token cost and injection position/depth (e.g., `~340 tk · in-chat @ depth 2`). This is the unprocessed view — useful for seeing the exact `<memory>` block markup and chunk boundaries that the LLM received.
---

View file

@ -8,23 +8,30 @@ This doc covers the tools for working with memories after they've been extracted
Click **View / Edit** in the CharMemory panel to open the Memory Manager.
![Memory Manager showing memory cards with topic tags and edit controls](../images/memory-manager.png)
![Memory Manager showing memory cards with find/replace bar and Save/Cancel buttons](../images/memory-manager.png)
Memories appear as cards grouped by extraction, newest first. Each card shows the chat it came from, the extraction timestamp, and the individual memory bullets. You can:
Memories appear as cards grouped by extraction, newest first. Each card shows the extraction timestamp and the individual memory bullets. The Memory Manager uses the same unified block editor as Consolidation, Conversion, Reformat, and the Data Bank browser — so editing works identically everywhere. You can:
- **Edit** any bullet — click the pencil icon, modify the text, save
- **Delete** any bullet — click the trash icon. Empty cards are removed automatically.
- **Add a bullet** — click the + button at the bottom of a card
- **Edit a block** — click the pencil icon on any card header to enter edit mode. Bullets become editable text fields.
- **Delete a bullet** — click the trash icon next to any bullet in edit mode
- **Delete a block** — click the trash icon in the block header in edit mode. Removes the entire block.
- **Add a bullet** — click **+ Add memory** at the bottom of a block in edit mode
- **Add a block** — click **+ Add Block** at the bottom of the editor
- **Undo** — click **Undo** to revert the last edit operation (delete, add, or Replace All)
Changes write directly to the memory file in the character's Data Bank. After editing, Vector Storage's index is stale — [purge and re-vectorize](retrieval-and-prompts.md#purge-and-re-vectorize) to update it, or send a new chat message.
![Memory Manager in edit mode showing editable bullets with delete and add controls](../images/memory-manager-editing.png)
Nothing is written to disk until you click **Save**. Click **Cancel** to discard all changes. After saving, Vector Storage's index is stale — [purge and re-vectorize](retrieval-and-prompts.md#purge-and-re-vectorize) to update it, or send a new chat message.
In group chats, a **character picker** appears at the top — select which member's memories to view and edit.
### Find & Replace
A find/replace bar appears at the top of the Memory Manager (and in the Consolidation, Conversion, Reformat, and Data Bank editor dialogs). Type in the **Find** field to see matches highlighted across all cards with a live count. Enter replacement text and click **Replace All** to update every occurrence at once.
- **Case sensitive** — click the **Aa** button to toggle case-sensitive matching
- In the Memory Manager, Replace All writes changes to disk immediately — **back up your memory file first** if replacing across many memories
- In the Consolidation, Reformat, Conversion, and Data Bank editors, Replace All is undoable (click Undo to revert)
- Replace All is undoable (click **Undo** to revert) — but once you click **Save**, changes are written to disk and cannot be undone
- In the Consolidation, Reformat, Conversion, and Data Bank editors, Replace All works the same way with Undo support
---

View file

@ -6,15 +6,17 @@ Start with the **health dot** in the CharMemory stats bar — it runs automated
## Health checks
The health dot runs up to 7 checks depending on what data is available. Checks 15 run immediately when you open a chat. Checks 67 run after at least one generation has been captured.
The health dot runs up to 9 checks depending on what data is available. Checks 17 run immediately when you open a chat. Checks 89 run after at least one generation has been captured.
| Check | What it looks for | States |
|-------|-------------------|--------|
| **Files enabled** | "Enable for files" is on in Vector Storage | RED if off |
| **Memory file exists** | A memory file is in the character's Data Bank | RED if missing |
| **Memory file exists** | A memory file is in the character's Data Bank | YELLOW if missing |
| **File vectorized** | Memory file has been indexed (chunk count > 0) | YELLOW if 0 chunks (resolves on next generation) |
| **Chunk overlap** | Data Bank overlap setting in Vector Storage | YELLOW if 0% |
| **Chunk size** | Data Bank chunk size in Vector Storage | YELLOW if outside recommended range |
| **Chunk size** | Data Bank chunk size vs. average memory block size | YELLOW if outside recommended range |
| **Retrieve chunks** | Number of chunks Vector Storage retrieves per query | YELLOW if > 5 (recommended: 23) |
| **Score threshold** | Minimum similarity score for retrieval | YELLOW if not set or too low |
| **Memories injected** | Memory bullets appeared in the last generation | YELLOW if 0 injected (may be normal — score threshold filtering) |
| **Duplicate detection** | Same bullet appears more than once in injected content | YELLOW if duplicates found |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 708 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Before After
Before After