Model or dataset
Mochocyang/QMAI avatar
Mochocyang/QMAI

QMAI (青幕AI写作): a memory-first desktop system for million-character serialized novels

Qingmu AI writing software that solves long-form novel writing problems such as inconsistent character personalities and characters breaking from their established traits. Official site: https://www.qmai.pro

869 stars152 forksTypeScriptNOASSERTION

At a glance

What is it?
A Tauri-based Chinese AI novel writing system built for 2 to 3 million character serials, with chapter ingestion, a hybrid retrieval context engine, character cognition tracking, and a review system that catches persona drift.
Who is it for?
QMAI is the most thorough answer yet to the specific problem of AI-assisted serialized fiction at million-character scale. The ingestion and context engine keep the model honest about what already happened, cognition tracking blocks the errors that readers notice first, the six-dimension review plus character consistency checks turn quality control into a repeatable process, and the draft gate keeps the memory base clean.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Mochocyang/QMAI869 ★ · +90
Star history
Repository2026-09-212026-11-07
Mochocyang/QMAI779869

90 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem it targets: the long-novel cliff

QMAI, full name 青幕AI写作, is an open-source desktop application by Mochocyang, GPL-3.0 licensed, version 3.2.13, built for one specific failure mode of AI-assisted fiction: the long novel cliff. Write with a generic chat AI past a hundred chapters and the symptoms arrive on schedule. The model forgets earlier plot, characters drift out of persona, timelines contradict themselves, and planted payoffs vanish.

The system is explicitly designed for serialized novels in the 2 to 3 million character range, which puts it far beyond what any model context window holds. Its core loop is stated in one line: extract context automatically before writing, deposit chapter memory automatically after writing, track relationship changes in a graph, catch inconsistencies in a review pass, and leave final confirmation to the human. Everything else in the app serves that loop, and the README maps each common failure to the mechanism that addresses it.

Chapter ingestion and the context engine

After each chapter is saved as official, the system runs chapter ingestion, extracting a structured snapshot: chapter summary and ending hook, characters, locations, organizations, and items in play, key events and state changes, relationship shifts, foreshadowing additions, progressions, and payoffs, timeline events, and graph nodes and edges.

Before each generation the context engine assembles a context package in a fixed priority order:

code
用户明确指定 > 当前章节细纲 > 上一章结尾 > Canon 正史规则
> 当前人物状态 > 伏笔状态 > 最近章节摘要 > 最近章节正文片段 > 图谱关系
> 向量搜索结果 > 关键词搜索结果

The package carries a token budget and is trimmed again against the actual input limit of whichever model you use, retrying with a smaller package when a long chapter history exceeds the interface cap. Retrieval underneath is hybrid: a recent chapter window keeping both opening and closing fragments of long chapters, BM25-style keyword matching, semantic vector search, graph expansion along relationship edges, and Canon rules injected as hard constraints. Memory data is stored locally as Markdown chapters plus JSON snapshots, exportable and rebuildable.

Character souls and the cognition system

The character layer works at two levels. A project soul document defines the book-wide voice: narrative temperament, language style, pacing rules, dialogue and psychological description conventions, conflict and romance-line rules, and a forbidden list of things the model must not do, such as empty lyricism or giving every character the same speech pattern. This document is injected into every generation prompt.

On top sits the NvwaSKILL character system. Each character perspective holds a profile, an expression DNA covering speech habits and sentence patterns, decision style, dialogue history, timeline, and representative lines. Dozens of preset perspectives ship as templates, from Feynman to Lu Xun, and the book-breaking library can extract character skills from existing works into your own soul library. The most original piece is cognition tracking: per character, the system maintains what they know, what they do not know, and what the reader knows but the character does not, which directly blocks the most common AI fiction error, a character acting on information they never learned.

The book-breaking library

拆文库, the book-breaking library, is the feature aimed at learning from finished works. The workflow: import a novel, let the system split chapters, and have an LLM identify characters that actually appear rather than harvesting candidate names with regex. One action extracts a six-dimension character skill covering public facts, speech style, expression DNA, outside perception, decision patterns, and timeline. Another extracts the work's style across nine dimensions, including narrative density and pacing, environment description ratio, emotion presentation, sentence length tendencies, metaphor density, scene transitions, narrative voice, dialogue style with subtext handling, and end-of-paragraph summarizing habits.

The style output binds as a constraint on the current project so every generated chapter inherits it, and character skills feed the soul library for reuse. Alias matching supports pinyin fuzziness and simplified-traditional conversion, so nicknames still hit the right character. Extraction jobs run in the background with progress shown per skill tab.

A review system with six dimensions

Quality control runs through three layers. The review center scores chapters across six dimensions: density of satisfying beats, setting consistency, pacing tension, persona consistency, narrative continuity, and the pull of the chapter-end hook. An AI review pass loads the outline, character states, foreshadowing status, timeline, and cognition data, checks each dimension, and outputs graded findings, blocking, high, medium, or low, with concrete revision suggestions and quoted evidence.

The character consistency check deserves its own mention: the system first extracts every character appearing in the draft, then checks each against the memory base, marking hit status per character, re-matching auras against the draft to cover supporting and newly introduced characters, splitting chapters over 8000 characters into up to three parallel segments, and running a post-revision recheck to confirm fixes did not introduce new blockers. Below that, a lint pass detects structural problems such as timeline conflicts, persona breaks, foreshadowing tangles, and cognition violations, and a fact-check pass verifies new chapters against Canon snapshots. A foreshadowing debt tracker scores long-unresolved setups and reminds you which ones need progress or payoff.

Drafts, graphs, and the surrounding tooling

Generated chapters land as drafts. Drafts can be previewed, edited, regenerated, and reviewed, but only human confirmation promotes them to official status and triggers memory ingestion, so bad generations never contaminate the memory base. A de-AI rewrite pass converts standardized AI prose into more natural writing, and the project soul plus bound work styles constrain tone book-wide.

The graph view renders every entity and relation extracted during ingestion: people, places, organizations, items, events, chapters, outlines, foreshadowing, secrets, and conflicts, with edge types covering presence, possession, hostility, cooperation, suspicion, concealment, knowledge, and foreshadowing moves. Built on Sigma.js with ForceAtlas2 layout, it supports community detection and filtering, and its stated uses include finding isolated settings that never connected to anything. Around all this sit three-level outline management, multiple generation modes, mixed search, model management with per-provider presets and batch testing, full data export and import, font scaling with a Chinese-English bilingual interface, and a Tauri-based auto-updater checking GitHub Releases.

Editorial conclusion

QMAI is the most thorough answer yet to the specific problem of AI-assisted serialized fiction at million-character scale. The ingestion and context engine keep the model honest about what already happened, cognition tracking blocks the errors that readers notice first, the six-dimension review plus character consistency checks turn quality control into a repeatable process, and the draft gate keeps the memory base clean. For serial authors who want AI assistance without handing their continuity to chance, the local-first, GPL-3.0 package is worth a serious look.

Frequently asked questions

How does QMAI prevent AI novels from losing the plot over hundreds of chapters?

Every official chapter is ingested into structured memory: summaries, events, state changes, relationship shifts, foreshadowing, and graph edges. Before each generation a context package is assembled in a fixed priority order with token budgeting, combining recent chapter fragments, BM25 keyword search, vector search, graph expansion, and Canon rules, so the model writes against the record rather than its own fading memory.

What is the character cognition system in QMAI?

Each character carries three knowledge lists: what they know, what they do not know, and what the reader knows but the character does not. The review system checks drafts against these lists so characters never act on information they never learned, which is one of the most common AI fiction failures.

Can QMAI learn the writing style of an existing novel?

Yes. The book-breaking library imports a finished work, identifies real characters with an LLM, and extracts both six-dimension character skills for the soul library and a nine-dimension style profile that can bind to your project as a constraint, so subsequent chapters inherit the borrowed style.

Official sources

  1. Issues
  2. Mochocyang/QMAI on GitHub
  3. README
  4. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mochocyang-qmai.svg)](https://hysenlabs.com/projects/mochocyang-qmai)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/mochocyang-qmai.svg)](https://hysenlabs.com/projects/mochocyang-qmai)

Was this useful?