Ristmark turns plain Word, RTF, PDF and image documents into structured, reusable templates, then generates clean output from them — on demand in the app, or programmatically via the /v1 API. It also consolidates near-duplicate templates into one parameterised template, so you validate one set of fields instead of re-checking every near-identical copy.
This page is a concise, technical orientation to how it’s built. For the product-facing pitch, see the trust model; for the block-by-block authoring surface, see the block reference.
The architecture’s organizing principle is “everything normalizes to one canonical, deterministic template format; AI never touches structure or layout.” AI does exactly one narrow, bounded job — labelling and mapping variable text spans — always with a per-field confidence score, so a low-confidence field flags itself instead of silently passing as correct. Structure, layout, pagination and rendering are handled entirely by code: the same template + data always produces the same document, byte-for-byte, with no model in that path to drift.
Normalize → recognize → author → generate, roughly mapping to four workspace libraries:
doc-ingest) — a deterministic, AI-free parser turns an uploaded document into block-level structure. Word/RTF sources are parsed from their real DOCX structure (RTF is normalized to DOCX via LibreOffice first) — the primary, highest-fidelity path. PDF and image sources go through a separate visual reconstruction (Beta) path: vector/raster evidence (text runs, strokes, raster lines, an XY-cut layout pass) rebuilds an approximate structure, which is inherently lower-fidelity than reading a document’s real structure — see Trust & confidence for why that’s surfaced to you, not hidden.ai) — a bounded AI pass classifies spans of the normalized structure as variable vs. boilerplate, labels and maps the variable ones to field names, and reports a confidence score per field. This is the only place AI runs. It never restructures, relayouts, or touches the render path.template-schema): a tree of typed blocks (text, table, layout containers, form fields, and more — see the block reference) with a {{ }} data-binding language. You review confidence-flagged fields, correct what’s wrong, and edit freely in the template editor — a corrected field is remembered and auto-applied the next time the same pattern is seen.doc-engine) — a deterministic, framework-free rendering engine lays out and paints a template against a data payload to PDF, HTML or DOCX. No AI runs at generation time; the same template + data pair always renders identically, whether triggered from the app, a spreadsheet-generate run, or the keyed /v1 API.Uploading many near-identical documents (e.g. the same contract template used by different departments) produces many near-identical templates — a validation burden that scales with copies, not with real differences. The consolidation library clusters templates by structural + textual similarity into families, computes a structural diff across a family, and merges the family into one parameterised template with the differing spans turned into fields — so you validate a single set of fields once, instead of re-checking every field in every copy.
/v1 API generates single documents and bounded batches programmatically — see Generating with the /v1 API.