kReative Labs
Back to kReative Labs

Building 2026

Book writing agents

A single-file Streamlit tool that rewrites long-form text into a target style and length, one section at a time, until an automated checker and a deterministic policy gate both agree it is done.

One rewrite pass is never enough, and nobody wants to babysit it

Rewriting a manuscript into a consistent voice at a specific length is not a single generation call. Long input has to be split into sections that each fit a generation budget, each section needs to stay stylistically continuous with the one before it, and "good enough" is a judgment call that a single pass rarely gets right on the first try.

The tool automates the part that benefits from automation, the drafting and re-drafting loop, while keeping a hard, non-negotiable line in front of it: a small set of mechanical tells (a banned em-dash, a banned sentence pattern) get blocked before the section is even scored, rather than left to an LLM checker that misses them some of the time.

Rewrite, gate, score, loop

Book writing agents loop Input text is split into sections. Each section goes to a RewriteAgent that drafts using the target style, the previous iteration's feedback, and a continuity snippet from the prior section. The draft passes through a Noesis policy gate that deterministically blocks banned mechanical patterns. A CheckerAgent then scores the draft for human-likeness, rule adherence, and AI risk. If the score clears the threshold the section is done and stitched into the output; otherwise the feedback loops back to the RewriteAgent, up to a maximum number of iterations. Section .txt / .pdf chunk RewriteAgent style + prior feedback + continuity snippet (Tinker) Noesis gate deterministic block on banned patterns runs before the checker CheckerAgent human-like score 1-10 rules, length, AI risk Score >= threshold? or max iterations hit Stitched output next section, or download yes no: feedback loops back to RewriteAgent blocked: skip checker, loop with violation as feedback
The gate sits before the checker on purpose. A model-based checker catches a banned pattern most of the time; the gate catches it every time, and does it without another model call.

The Noesis integration was evaluated honestly rather than assumed worth keeping: for this single tool, a few lines of local regex would deliver most of the same value with no network call and no manuscript text leaving the machine. Noesis earns its place if this becomes one of several agents governed centrally over time; for a single local tool the case is closer.

At a glance

InterfaceSingle-file Streamlit app (streamlit run rewriter_loop.py).
InputUploaded or pasted .txt / .pdf, split into sections for long inputs or large expansion targets.
Rewrite stepRewriteAgent (Tinker) drafts each section from the target style, the previous iteration's feedback, and a continuity snippet carried from the prior section.
Policy gateA Noesis ingest() check runs as a hard backstop before the checker, blocking mechanical violations deterministically and logging the event.
Check stepCheckerAgent scores human-likeness (1-10), rule adherence including length, and AI risk; loops per section until the score clears the threshold or the iteration cap is hit.
OutputAll sections stitched into the final text, downloadable from the app.
StageBuilding. Runs locally; not deployed publicly.