autoverse-beautifier

Deterministic post-processing n8n node that re-formats raw LLM/AI agent responses into clean, consistent Markdown — 100% content preservation, zero rewriting.

Package Information

Released: 1 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.1
Author: AutoVerse

Documentation

n8n-nodes-autoverse-beautifier

AutoVerse Response Beautifier — a deterministic post-processing node for n8n that takes the final text response of any LLM / AI Agent and re-formats it into clean, consistent, professional Markdown.

Content preservation = 100%. Presentation quality = high.
No rewriting, no summarizing, no paraphrasing, no translating, no LLM call — ever.

Cheap and open-weight models often emit messy Markdown: unclosed code fences, missing language tags, mixed list bullets, repeated 1. 1. 1. numbering, broken ** bold **, malformed tables, excessive blank lines, CRLF noise. This node fixes the presentation while a built-in fidelity gate proves on every run that the content is untouched — and falls back to the original text if it isn't.

How it works

raw LLM response
  → pre-normalize   (CRLF→LF, zero-width chars, close unclosed fences, conservative table/link repair)
  → parse           (remark-parse + remark-gfm → mdast)
  → normalize       (custom plugins: heading levels, fence languages, broken emphasis)
  → format          (remark-stringify with strict consistency options)
  → validate        (visible-content fidelity gate — strict mode falls back to the original)

Built on the unified / remark / mdast ecosystem. No regex-heavy logic: regular expressions are only used in the pre-parse stage for cases a parser cannot cover.

What it fixes

Problem Fix
Unclosed ``` code fences Closing fence appended
Model resumes prose without closing a block Fences re-paired so tables/links/headings are never swallowed into code
Fence with no language Configurable default (text)
Excessive blank lines (3+) Collapsed to one blank line (never inside code)
CRLF / CR line endings Normalized to LF
Multiple inner spaces in prose Collapsed (never inside code)
##Heading / first-line #Title missing space Space inserted (#include, #define, #tag never touched)
Mixed list bullets (* + -) Merged and unified to one style
Repeated 1. 1. 1. numbering Renumbered 1. 2. 3.
Heading level jumps (H2 → H4) Demoted one level at a time
Headings deeper than H4 Clamped (configurable)
** text ** (spaces inside markers) Repaired into real bold
****text**** nested strong Flattened to **text**
__bold__ / mixed emphasis markers Unified
Table rows longer than the header Header padded so no cell content is dropped by parsers
Reversed links (text)[url] Fixed to [text](url)
Trailing whitespace Trimmed; 2+ trailing spaces normalize to a proper two-space hard break
Mixed *** / ___ / --- rules Unified

Never touched: whitespace inside code blocks, text content, block order, or anything semantic. Plain text with no Markdown structure passes through unchanged.

Installation

This is an n8n community node:

  • Self-hosted GUI: Settings → Community Nodes → Install → n8n-nodes-autoverse-beautifier
  • Manual: npm install n8n-nodes-autoverse-beautifier in your n8n extensions directory
  • Community nodes require a self-hosted instance (not available on n8n Cloud unless verified).

Usage

Drop the node after any AI Agent / LLM / chain node. By default it reads the output field and writes the beautified text back into it, adding:

  • beautifierChanged — whether the text changed
  • beautifierReport — every rule that fired, the fidelity check result, and fallback/error flags

Presets

  • Balanced (recommended) — all safe repairs enabled
  • Conservative — whitespace, line endings, code fences and serialization consistency only
  • Aggressive — every repair, including confident-but-ambiguous fixes

Every individual rule is a separate option under Advanced.

Fidelity modes

  • Strict (default): if the content-preservation check detects any difference in visible content, the original text is returned untouched (report.fallback = true)
  • Report: always return the formatted text and inspect report.fidelity yourself

Development

npm install
npm run typecheck
npm test
npm run build   # bundles to dist/ (ESM deps compiled to CJS for n8n)

License

MIT

Discussion