diff --git a/README.md b/README.md index 4b18417..a8feb7d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,88 @@ -# DynamicLore Extension for SillyTavern +# DynamicLore — Auto World Info for SillyTavern -**This extension is not affiliated with or endorsed by the SillyTavern team. Use at your own risk.** +Automatically scans your roleplay conversation and proposes new or updated **World Info (lorebook) entries** using your connected LLM. Review and accept/reject each suggestion with one click. -*Human Note: Completely created by AI (Claude 3.7 Sonnett with Reasoning). I don't know if or how this works. Try at your own risk.* -*Human Note: Completely fixed by AI (Claude 3.5 Sonnett with Reasoning). I don't know if or how this works. Try at your own risk.* +## Quick Install -**This extension is designed to enhance your SillyTavern experience by automatically updating your World Info and Lorebook entries based on ongoing conversations. It uses a connected Large Language Model (LLM) to analyze chat content and suggest new or updated entries, ensuring your lore remains rich and relevant without manual effort.** +In SillyTavern, go to **Extensions → Download Extensions and Assets** and paste: +``` +https://github.com/LiweiDonVee/Extension-DynamicLore +``` + +Or manually: clone into `data/default-user/extensions/DynamicLore/`. + +**Requires:** SillyTavern ≥ 1.12.0 with a configured chat API (works with any provider — OpenAI, DeepSeek, Claude, Gemini, local models). ## Features -- **Automated Analysis**: Scans conversations for new information to add to your World Info -- **Smart Updates**: Suggests improvements to existing entries when new related information appears -- **Keyword Optimization**: Recommends optimal keywords for entry activation -- **Full User Control**: Review all suggestions before they're applied +- 🔍 **Chat Analysis** — Scans the last N messages for new characters, locations, objects, and events +- 🧠 **LLM-Powered** — Uses your currently connected model (no separate API key needed) +- 🔄 **Smart Matching** — Finds existing WI entries by multi-keyword scoring before proposing updates +- ✅ **Review & Accept** — All suggestions shown as cards with confidence scores; accept or reject each +- 🤖 **Auto Mode** — Runs every N messages automatically +- ⌨️ **Slash Commands** — `/dynamiclore analyze` | `/dynamiclore interval 10` | `/dynamiclore book MyWorld` + +## Usage + +| Action | How | +|--------|-----| +| Manual scan | Click "Analyze Chat Now" or `/dynamiclore analyze` | +| Change interval | Set the number in the panel, or `/dynamiclore interval 5` | +| Target a specific WI book | `/dynamiclore book MyWorld` | +| Toggle auto mode | Check/uncheck "Auto" in the panel | + +After analysis, cards appear showing proposed entries. Each card shows: +- Entry name, type (character/location/object/event), confidence % +- Content preview, suggested keywords +- For updates: old content vs new merged content +- **Accept** / **Reject** buttons + +## What Was Fixed + +The original extension (by AugieIsHere, generated by Claude 3.7 Sonnet) and its fork (by X00LA) both contained a critical bug: + +```js +// BROKEN — both versions returned empty results +async function generateRaw(prompt, headers) { + return JSON.stringify({ entries: [] }); +} +``` + +The `generateRaw` function was **hardcoded to return empty results** — it never called any LLM. Combined with a broken webpack build (invalid externals map), the extension was non-functional from day one. + +### This version: + +| Issue | Fix | +|-------|-----| +| `generateRaw()` mock | Uses `SillyTavern.getContext().generateRaw()` — the real ST API | +| Broken webpack externals | Bypassed entirely; plain IIFE script loaded via `