Back to Blog

AstrBot / LLM / Writing Tools

Building a Local-First Long-Form Writing Assistant for AstrBot

A project, chapter, fact, and review model for long-form writing inside AstrBot.

Long-form writing assistance is mostly a context management problem. Generating one passage is easy; keeping chapters, facts, versions, review comments, and reference notes traceable is the hard part.

Project Overview

main.py integrates with AstrBot, novel_writer/entry/commands dispatches commands, services handles project operations, rewriting, review, and import/export, storage saves drafts and versions, and rag plus extraction handle references and facts.

The plugin turns a novel into projects, volumes, chapters, facts, and versions. It fits serial writing, setting maintenance, chapter review, draft versioning, and preparation for collaborative editing.

Local-First Design

Project materials stay in local storage. The model participates in generation, extraction, and suggestions, but the plugin owns the state. Each generated or revised chapter becomes a version node, and fact extraction records people, places, events, and constraints.

Before generation, the service assembles setting notes, summaries, fact records, and retrieved evidence. After generation, the text is versioned, reviewed, and may produce conflict reports or memory patches.