Commit graph

17 commits

Author SHA1 Message Date
bal-spec
571e5e42c3 fix: Reset Extraction State now clears batch state for all character chats
Previously only reset the active chat's metadata, so batch extraction
still saw other chats as fully processed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:04:14 -08:00
bal-spec
b9f7d3f9f4 feat: add verbose logging toggle for LLM prompts and responses
Adds phase logging (Sending/Waiting/Response received with timing)
always visible in activity log. When "Verbose" checkbox is enabled,
also logs the full prompt and raw LLM response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:34:33 -08:00
bal-spec
ec75f55304 refactor: reorganize settings UX with clearer labels and grouping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:37:03 -08:00
bal-spec
5361169002 Improve extraction quality, fix per-message buttons, add tooltips and docs
Extraction prompt:
- Replace broad "sexual mechanics" AVOID with targeted "repetitive minutiae"
- Add NOTE: capture vivid memorable details, skip sequential play-by-play
- Add clear boundary markers (===== sections) between existing memories and
  chat content to prevent weaker models from contaminating extractions
- Add CRITICAL instruction: only extract from RECENT CHAT MESSAGES section

Per-message buttons:
- Add addButtonsToExistingMessages() to inject brain/bookmark buttons on
  already-rendered messages when a chat loads (called from onChatChanged)

UX polish:
- Add descriptive tooltips to all UI elements (stats bar, buttons, sliders,
  settings, tabs)
- Rename "Extract every N messages" to "Auto-extract every N new messages"
- Improve "no new messages" toast on manual Extract Now to suggest Reset
  Extraction State
- Update Extract Now tooltip to explain the reset workflow

Docs:
- Add "Choosing an LLM for Memory Extraction" section to README with
  recommended models (DeepSeek V3.1, Qwen3-235B, Mistral Large 3, Hermes 4),
  models to avoid, and troubleshooting guide
- Update README for cooldown, tabbed panel, stats bar, per-message buttons
- Update PLAN.md with completed items and new extraction quality ideas

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:58:36 -08:00
bal-spec
3d541afaf2 Improve extraction prompt, add cooldown, tabbed panel, richer stats bar
- Replace default extraction prompt with higher-quality version: AVOID list
  (sexual mechanics, temporary states, dialogue), FOCUS categories, past
  tense rule, consolidation/fact-checking rules, better examples
- Bump default responseLength from 500 to 800
- Add minCooldownMinutes setting (default 10, range 0-30) to prevent
  rapid-fire extractions; manual extractions bypass cooldown
- Combine Activity Log + Diagnostics into single tabbed drawer
- Expand stats bar from 2 to 4 items: file, memory count, extraction
  progress (msgs/interval), cooldown timer with auto-refresh
- Fix stats bar showing stale count after Clear All Memories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:25:27 -08:00
bal-spec
f3ab5ccfb8 Add activity log and fix extraction not running on chat switch
- Add collapsible Activity Log panel that shows timestamped events:
  chat switches, extraction state, message collection, LLM responses
- Fix bug where lastExtractedIndex advanced even when LLM returned
  NO_NEW_MEMORIES, preventing subsequent manual extraction from
  processing messages on a switched-to chat
- Now only advance lastExtractedIndex when memories are actually saved;
  always reset messagesSinceExtraction to prevent re-trigger loops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:29:55 -08:00
bal-spec
36b59a5e17 Add NanoGPT connection test, model filters, and fix chat-switch extraction bug
- Add Test button next to API key to verify connection with a minimal request
- Add model filter checkboxes (Subscription, Open Source, Roleplay, Reasoning)
  that narrow the dropdown with intersection logic
- Store additional model fields (isOpenSource, category, capabilities, costEstimate)
- Fix bug where switching chats didn't seed messagesSinceExtraction with
  unextracted message count, preventing automatic extraction from triggering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:19:24 -08:00
bal-spec
bf22c2019a Add NanoGPT as direct API extraction source
Allows using NanoGPT's OpenAI-compatible API for memory extraction
and consolidation, independent of the main chat LLM. Fetches model
list with subscription status, supports custom system prompts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:05:15 -08:00
bal-spec
6b77a5d209 Add Reset Extraction State button
Allows resetting extraction tracking without deleting memories,
so the next extraction re-reads all messages from the beginning.
Useful after manually editing or deleting memories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:39:02 -08:00
bal-spec
f1e6789dfa Add consolidation preview and undo
Show a side-by-side Before/After preview popup before applying
consolidation results, and add an Undo Consolidation button that
restores the pre-consolidation memories from an in-memory backup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:34:27 -08:00
bal-spec
93c6f7e94d Redesign memory format to <memory> tags, add per-bullet manager UX and vectorization diagnostics
Switch from ## Memory N headers to <memory chat="..." date="..."> tag blocks
with individual bullet parsing. Memory manager now shows grouped extraction
cards with per-bullet edit/delete controls. Stats bar simplified to file name
and total bullet count. Diagnostics panel shows vectorization status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:03:55 -08:00
bal-spec
2e4ba2c936 Improve UX: rename to Character Memory, add stats bar, flatten layout
- Rename extension header from CharMemory to Character Memory
- Add always-visible stats bar showing active file, memory count, and
  extraction progress
- Flatten Memory Status sub-drawer so controls are immediately visible
- Merge Advanced section into Settings with separator dividers
- Rename buttons: Manage Memories → View / Edit, Reset → Clear All
  Memories (moved to Settings with danger styling)
- Add tooltips, helper text styling, and separator/danger-button CSS
- Call updateStatusDisplay after consolidation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:50:34 -08:00
bal-spec
ef21f694d3 Add per-character file naming, per-chat toggle, and memory diagnostics
Auto-generate memory file names from character name (CharName-memories.md),
with optional per-chat isolation (CharName-chat{id}-memories.md). Add memory
info to diagnostics panel showing active file, memory count, and last
extraction result. Migrate old hardcoded 'char-memories.md' default to
auto-naming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:27:23 -08:00
bal-spec
648d4a648d Add reset extraction, custom file name, and prompt migration
- Add Reset button to clear extraction state and re-extract from beginning
- Add Advanced section with configurable Data Bank file name (replaces hardcoded char-memories.md)
- Auto-migrate saved prompts with old blank-line separator instruction to --- separator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:58:36 -08:00
bal-spec
dcda5c593c Add structured memory format, per-memory editing, and consolidation
- Memories now stored as numbered `## Memory N` entries with timestamps
- Auto-migrates existing flat-text memories to structured format
- "Manage Memories" popup with edit/delete per entry (replaces "View Memories")
- "Consolidate" button and `/consolidate-memories` slash command to merge duplicates via LLM
- Extraction now splits LLM output on `---` separators into individual entries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:49:31 -08:00
bal-spec
ddec838b39 Fix View Memories popup and add WebLLM extraction source
- Use ST's callGenericPopup (properly imported) instead of broken fallback modal
- Add extraction source dropdown: Main LLM or WebLLM (browser-local)
- Remove unused fallback modal CSS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:33:57 -08:00
bal-spec
072e744471 Initial commit: CharMemory extension for SillyTavern
Automatically extracts structured character memories from chat and stores
them in character-scoped Data Bank files for vector retrieval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:08:27 -08:00