Back to Blog

Writing / AstrBot / WebUI

Worldbook Workbench and Chapter Editing in a Long-Form Writing Plugin

A record of worldbook cards, chapter editing, manuscript import, and cached memory backfill in the writing plugin.

The hardest part of long-form writing assistance is not generating one passage. It is keeping characters, places, timelines, chapter versions, and author intent traceable over a long project. Recent work moved the plugin closer to a small writing workbench: the message entry still exists, while the WebUI now carries more review, editing, and inspection work.

Project Overview

This writing tool is maintained around personal-use writing scenarios. It combines an AstrBot message entry, project storage, chapter versions, fact extraction, RAG retrieval, worldbook cards, and an independent WebUI in a local-first environment. The goal is sustained writing, manuscript cleanup, worldbuilding maintenance, and human review.

Structurally, main.py owns the plugin entry. services organizes project, chapter, WebUI, import, and memory operations. storage keeps SQLite data and project files. rag and extraction modules handle reference material, fact records, and retrieval chunks. The recent worldbook workbench is centered on StoryMemoryCardService and the WebUI project payload builder.

Worldbook Cards

The worldbook is not a single setting document. It is a set of cards that can be activated by chapter, keyword, and writing task. Card types cover long-term author intent, current focus, world rules, resource ledgers, and foreshadowing hooks. Before generation, the service previews the active cards for the chapter and request, then assembles the relevant text into context.

This model fits the slow-moving parts of long-form fiction. Short-term character state can come from chapter facts, while world rules and foreshadowing belong in the card layer. Cards may be generated from memory patches or edited manually; manually locked cards are preserved during automatic refresh.

WebUI and Chapter Editing

The WebUI project page is split into views: overview, manuscript editor, knowledge and memory, chapter timeline, style profile, and import status. The chapter editor supports browser draft cache, diff preview, and manual version saving. Generated text can therefore enter a review step instead of becoming the final manuscript immediately.

The project payload builder also handles partial failures. Each view reads the data it needs, and a failed section can return empty data while the page remains usable. For a writing tool, keeping the editor available matters more than failing the whole page.

Manuscripts and Memory Backfill

Manuscript import and memory backfill were another focus. Imported chapters, facts, and summaries become retrieval material. If the fact store is empty but cached memory patches still exist, the service can replay those cache records into structured facts instead of forcing a fresh extraction pass.

The useful lesson is to treat text generation and story-state maintenance as separate concerns. A chapter is an editable draft; the worldbook, facts, timeline, and style profile are the state layer that guides the next writing task. The clearer that state layer becomes, the easier it is to keep a long project moving.