Rakenne 0.5.0 — Template Engine, Variable Extraction, and DOCX Tools
0.5.0 introduces a schema-driven template engine for rendering structured documents, a traceability-rich extraction pipeline for pulling variables from source documents, and a full suite of tools for creating and editing Word files.
We’re pleased to announce Rakenne 0.5.0. This release adds three major capabilities: a template engine for rendering structured documents from validated variables, an extraction pipeline for pulling variable data out of source documents with full traceability, and a DOCX tools skill for creating, editing, and converting Word files.
Template engine
Skills can now define a variable schema and document templates for their output. The agent uses four new tools to validate, lint, render, and audit the result:
- Validate variables — Checks variable values against the schema. Supports rich types (currency, dates, CNPJ, CPF, percentages, formatted tables) and reports fill rate so you know how complete the data is before rendering.
- Lint template — Catches errors before rendering: missing helpers, undefined variables, optional values without fallback text. Reports issues with file and line references so the agent can fix them in place.
- Render template — Substitutes validated variables into the template with locale-aware formatting (e.g.
R$ 1.500.000,00for Brazilian Portuguese,$1,500,000.00for English). Derived variables are computed automatically from their sources. - Audit render — Compares the rendered output against the original template. Validates that immutable zones (regulatory disclaimers, boilerplate clauses) are unchanged, runs anti-contamination checks, and enforces change budgets so the agent stays within expected bounds.
Templates support partials, conditional sections, and over 40 locale-aware formatting helpers. The engine is deterministic — same inputs always produce the same output.
Variable extraction
A new eight-tool pipeline lets the agent extract structured variables from source documents (PDF, DOCX, or other formats) and produce a variables.json file ready for the template engine:
- Ingest — Converts the source document into a line-addressable page corpus (one text file per page) so every extracted value can be traced back to its exact location.
- Segment — Detects section boundaries using a taxonomy definition, splitting the corpus into manageable pieces the agent reads one at a time.
- Record — As the agent reads each section, it records extracted values. The tool normalizes them automatically — currencies, dates, and identifiers are converted to their standard storage format — and tags each value with its page and line span.
- Consolidate — Merges all section extractions into a single
variables.json. When the same variable appears in multiple sections, conflict resolution picks the best candidate based on validity, specificity, and section priority. - Double-check — Scans the corpus for any variables still null after consolidation, using format-aware patterns to surface candidates the agent may have missed.
Every value in the final output carries full provenance: which page, which lines, which section, and how conflicts were resolved. The result plugs directly into the template engine’s validate_variables tool for a seamless extract-then-render workflow.
DOCX tools
A new docx-tools skill gives the agent nine tools for working with Word documents:
- Build — Create
.docxfiles programmatically with full control over paragraphs, tables, headers, footers, lists, and styles. - Unpack / Pack — Extract a
.docxinto editable XML files (with automatic pretty-printing) and re-zip them into a valid.docx. Useful for precise formatting changes that go beyond what the high-level build tool offers. - Extract text — Pull document content as plain text, with control over tracked changes: show all markup, accept final, or reject to original.
- Accept changes — Accept all tracked changes, producing a clean document without revision marks.
- Add comment — Anchor review comments to specific text, with support for threaded replies.
- Validate — Check document structure for missing files, malformed content, duplicate IDs, and broken relationships, with optional auto-repair.
- Convert — Convert between
.doc,.docx, PDF, HTML, and ODT.
The skill installs from the library like any other and ships with reference guides so the agent can build complex documents without external help.
Thank you for using Rakenne. These three features work together as a pipeline — extract variables from a source document, render them into a template, and export the result as a polished Word file. We’d love to hear how you put them to use.
— The Rakenne team