# Langdock versus K2F for agent document generation

In contrast, **K2F** is an open **semantic document format** (Apache 2.0) and deterministic layout compiler engineered specifically for **AI agent document generation**, structured node editing, and multi-format enterprise publishing. Rather than treating documents as unstructured text buffers, opaque PDFs, or procedural conversion scripts, the **K2F format** operates on an explicit dual-state architecture: an editable semantic JSON tree (State A) and a compiled, pixel-stable render lock (`document.K2F.lock` / State C). By enforcing strict separation between semantic intent and visual styling, K2F allows autonomous agents to modify content without breaking layouts, verify visual balance and structural integrity through a standardized compiler gate (`pack_verify.py`), and guarantee **deterministic document output** across Microsoft Word (`.docx`), PowerPoint (`.pptx`), interactive AcroForm PDF, and Adobe InDesign (`.idml`).

This **document format comparison** examines how an enterprise agent platform and an open document architecture interact rather than presenting them as mutually exclusive alternatives. K2F does not replace general-purpose coding agents, workflow builders, or enterprise AI platforms like Langdock. In fact, because Langdock natively supports both the open Agent Skills standard (`SKILL.md`) and the Model Context Protocol (MCP), organizations can connect the K2F ecosystem directly to Langdock agents. This allows Langdock to handle enterprise governance, secure model routing, and corporate data integration, while delegating document compilation, schema validation, and multi-format publication to K2F and [k2f.dev](https://k2f.dev).

At the same time, K2F maintains rigorous architectural boundaries. K2F is not an interactive conversational chat platform, an enterprise model gateway, or a visual workflow builder. K2F v0.1 ships with a fixed `"paged"` canvas mode (slide presentations and infinite canvas modes are roadmap design targets), does not import or reverse-engineer legacy PDF files (`PDF_IS_NOT_A_SOURCE`) or Word documents (`DOCX_IS_NOT_A_SOURCE`), strictly prohibits executable scripts and macros in State A JSON, forbids arbitrary Bézier vector path drawing in State A, and treats all exported deliverables as unidirectional read-only drawings of the compiled render lock (`PDF_IS_NOT_A_SOURCE`, `DOCX_IS_NOT_A_SOURCE`, `PPTX_IS_NOT_A_SOURCE`, `IDML_IS_NOT_A_SOURCE`). Agent outputs are `UNSIGNED` by design, and while stdio MCP tooling is shipped, remote HTTP MCP services remain Not publicly specified.

## At a glance

| Evaluation criterion | Langdock agent path | K2F agent path |
| :--- | :--- | :--- |
| **Core identity** | Secure, GDPR-compliant enterprise AI platform, multi-model chat, workspace, and visual workflow engine | Open semantic document file format (Apache 2.0) and deterministic Rust layout compiler |
| **Enterprise security & compliance** | Native ISO 27001, SOC 2 Type II, EU GDPR, BYOK, EU hosting (Hetzner, AWS EU, Azure EU), dedicated VPC, or on-prem | Format-level security: zero executable scripts, zero dynamic network calls during render, embedded assets only |
| **Native document engine** | None; populates uploaded Office templates, generates raw XML, or executes sandboxed Python scripts | Built-in Rust reference engine (`k2f_layout`) with HarfBuzz text shaping (`rustybuzz`) and UAX #14 line breaking |
| **Source representation** | Freeform text/Markdown in Document Editor side-panel, raw Office XML, or procedural Python scripts | Dual-state: Canonical semantic JSON tree (State A) compiled into an immutable render lock (State C) |
| **Node addressing for edits** | Text regex matching, side-panel buffer rewrites, or complete script/XML re-execution | Mandatory, hierarchical dotted node IDs (`parent_id.child_type_semantic_name`) on all semantic elements |
| **Intent–presentation separation** | Blended; Markdown mixes text with presentation hacks; Office XML/scripts hardcode layout geometry | Strict separation; zero inline styling in State A; all visual tokens live in `styles/theme.json` |
| **Cross-device layout consistency** | Fluid and variable; DOCX and PPTX reflow across recipient office suites, OS font engines, and printer drivers | Absolute; viewers paint pre-compiled `document.K2F.lock` directly with zero runtime text reflow |
| **Verification & quality gate** | Workflow test runs verify API payloads and node execution; zero document layout or visual geometry testing | Automated local `pack_verify.py` validating embedded schemas (`/schema/`) and catching visual defects (`PAGE_UNDERFILL`) |
| **Multi-format publishing** | Fragmented; requires maintaining separate, divergent generation scripts or templates for Word, PPTX, or PDF | Single-source lock compilation exporting simultaneously to AcroForm PDF, DOCX, PPTX, and Adobe InDesign (`.idml`) |
| **Interactive forms** | Visual underscore strings `____` or static boxes; no native AcroForm PDF compilation | Native `form_field` semantic nodes compile directly into standard interactive AcroForm PDF controls |
| **Arbitrary vector art** | Supported through sandboxed Python scripts (Matplotlib, SVG generation) in Code nodes | Forbidden in State A JSON; external vector graphics stored as pre-rendered SVGs or images in `/assets/` |
| **Cryptographic integrity** | None; generated PDFs or DOCX files lack mathematical linkage to upstream agent data or prompts | Native SHA-256 `content_hash` and `appearance_hash`, optional Ed25519 signatures, and viewer integrity banners |
| **Pre-built template ecosystem** | User-uploaded corporate `.docx`, `.pptx`, or `.pdf` File Templates (up to 256 MB) | 469+ production-grade templates on [k2f.dev/gallery](/gallery) (Apache 2.0, 100% free, zero login) |
| **Extensibility & APIs** | Dual MCP client/server support, Agent Skills standard (`SKILL.md`), and hosted REST API | Native offline CLI (`pip install k2f`), Python SDK, Rust crates, Agent Skill (`SKILL.md`), and stdio MCP; remote HTTP MCP is Not publicly specified |
| **Source of truth boundary** | Script, prompt, or template is source; binary outputs (PDF/DOCX) cannot be cleanly round-tripped | `.K2F` is sole source of truth; K2F does not import PDF or DOCX; exports are read-only lock drawings (`*_IS_NOT_A_SOURCE`) |

## Langdock vs K2F for agent document generation: How documents are handled

### How Langdock handles documents

Langdock is an enterprise AI operating system and governance platform designed to enable regulated organizations to safely deploy generative AI, custom agents, and automated workflows across departments such as HR, legal, sales, finance, and IT.

Langdock’s architecture centers on enterprise compliance, model agnosticism, and visual workflow orchestration:

- **Enterprise Security, Governance, and Data Sovereignty:** Langdock is certified under ISO 27001 and SOC 2 Type II and complies with EU GDPR. It guarantees that enterprise and customer data is never used to train or fine-tune underlying AI models. Deployment topologies include multi-tenant EU-hosted SaaS (hosted on Hetzner, AWS EU, or Azure EU), dedicated single-tenant Virtual Private Clouds (VPCs), or on-premise installations. Organizations enforce enterprise governance via Role-Based Access Control (RBAC), Single Sign-On (SSO via SAML, Okta, Azure AD), audit logging, and Bring Your Own Key (BYOK) for direct provider billing and data control.
- **Model-Agnostic LLM Routing:** Langdock provides a unified gateway connecting users and automated agents to frontier model providers: OpenAI (GPT-4o, o1, o3-mini), Anthropic (Claude 3.5 and 3.7 Sonnet), Google (Gemini 1.5 and 2.0 Pro/Flash), and Mistral AI (Mistral Large).
- **Langdock Chat:** A centralized conversational interface supporting model switching, custom system prompts, shared prompt libraries, and multi-file attachment handling.
- **Document Editor (Side-Panel Workspace):** A dual-pane collaborative workspace (analogous to ChatGPT Canvas or Claude Artifacts) that opens alongside an active chat thread. Users and agents can co-draft, review, format, and iterate on text, Markdown documents, or code scripts side-by-side without losing conversation context.
- **Custom AI Agents and Assistants:** Specialized departmental agents configured with custom instructions, curated vector knowledge bases, external integrations, attached file templates, and operational skills.
- **Visual Workflows and Automations:** A node-based canvas (accompanied by a conversational Workflow Builder) that orchestrates complex multi-step processes. Nodes include:
  - *Trigger Nodes:* Scheduled cron triggers, manual executions, or webhook events.
  - *Agent Nodes:* Structured LLM reasoning and content generation.
  - *Code Nodes:* Secure, sandboxed execution of custom Python or JavaScript for data transformation and file processing. Pre-installed libraries include `pandas`, `numpy`, `openpyxl`, and `pypdf`.
  - *Action Nodes:* Native connectors to enterprise SaaS applications.
  - *HTTP Request Nodes:* Arbitrary REST API calls to internal microservices.
  - *File Search Nodes:* Retrieval-Augmented Generation (RAG) querying indexed enterprise documents.
- **Enterprise Knowledge Hub:** Direct bi-directional connectors to corporate data repositories: Microsoft 365 (SharePoint, OneDrive, Teams), Google Workspace (Drive, Docs, Sheets, Slides), Slack, Confluence, Notion, Jira, Salesforce, HubSpot, and GitHub.
- **Model Context Protocol (MCP) and Agent Skills (`SKILL.md`):** Langdock operates as both an MCP client (connecting to external MCP servers and interactive "MCP Apps" in the side panel) and an MCP server (exposing Langdock agents as callable tools for external developer clients). It also natively supports the open Agent Skills standard, allowing organizations to import standalone `.md` files or ZIP bundles containing a root `SKILL.md` to govern agent behavior.

### Typical document outputs produced by Langdock agents

Despite these enterprise orchestration strengths, Langdock contains **zero native document typesetting engines**. It possesses no spatial layout constraint solvers, no mathematical pagination algorithms, no CSS Paged Media layout pipelines, and no dedicated paginated document format. When instructed to produce business deliverables, Langdock agents rely on one of several standard representations:

1. **Markdown (`.md`):** The default output in chat and the Document Editor side panel. Markdown provides basic structural elements (`#`, `##`, bullet lists, blockquotes, and tables). However, Markdown contains no concept of physical pages, fixed margins, paper dimensions (A4, US Letter), running headers/footers, or print typography. It cannot serve as an official publication-grade deliverable.
2. **Microsoft Word (`.docx` / `.dotx`):** Produced either by populating an uploaded enterprise `.docx` template via Langdock's "File Templates" feature or through Python scripts in sandboxed Code nodes utilizing `python-docx`. However, WordprocessingML stores zero physical layout coordinates. Layout is resolved dynamically on the recipient's computer by Microsoft Word, LibreOffice, or Google Docs based on installed system fonts, display scaling, and active printer drivers. Documents reflow unpredictably across machines, frequently breaking page budgets and misaligning multi-column layouts.
3. **Microsoft PowerPoint (`.pptx` / `.potx`):** Generated via uploaded presentation templates or direct XML generation scripts. Langdock's official documentation explicitly documents the fundamental technical limitation: *"Large language models cannot see the file visually while generating it. They write the underlying code (XML for PowerPoint, for example), then render and review. Small formatting mistakes on the first pass are normal."* To mitigate severe layout corruption, Langdock advises generating slides in small batches of 5–10 slides rather than full decks.
4. **PDF (`.pdf`):** Produced via uploaded PDF templates, sandboxed Python scripts (`pypdf`, `reportlab`), or headless conversion. Uploaded PDF templates are strictly restricted to portrait orientation (landscape PDFs are rejected). Output PDFs are static, opaque binary files; downstream agents cannot modify text without lossy scraping or OCR, and there is no cryptographic linkage back to source data.
5. **Spreadsheets (`.xlsx` / `.csv`):** Generated during data analysis or workflow execution using Python (`pandas`, `openpyxl`). Useful for numerical summaries and tabular data exports.
6. **Single-Page HTML / JavaScript:** Authored in the Document Editor / Code view and previewed inside browser iframes. Reflowable, screen-dependent, and prone to severe degradation when printed to PDF.

### The editing bottleneck: Buffer rewriting versus binary regeneration

The editing mechanics in Langdock reflect the absence of an underlying document Abstract Syntax Tree (AST):

- **In the Document Editor (Side-Panel Text/Markdown):** Edits operate at the text-buffer level. Users can manually type or reformat text, while agents rewrite sections based on chat prompts. For extensive documents, instructions requiring structural restyling trigger a full buffer regeneration. Without an underlying AST, long documents are susceptible to context window truncation, dropped paragraphs, or accidental rewrites of human-polished copy.
- **In Generated Office and PDF Artifacts (DOCX, PPTX, PDF):** Langdock cannot perform diff-based editing or surgical node patching on binary `.docx`, `.pptx`, or `.pdf` archives. Modifying a single figure, bullet point, or paragraph requires the agent to re-execute the script or regenerate the raw XML from scratch. This full regeneration loop frequently introduces unintended side effects: slide elements shift positions, font sizes alter unpredictably, and previous manual corrections are overwritten.

## What K2F adds

K2F approaches document generation from a fundamentally different premise: treating documents not as procedural scripts or fluid text buffers, but as an open, compiled, and verifiable software engineering asset. Guided by the core tenets **"Consistent like PDF. Editable like code."** and **"Semantic Intent. Deterministic Geometry."**, K2F establishes an absolute separation between what an agent edits (meaning, structure, and data) and what the layout engine renders (geometry, typography, and styling).

### The author package workspace

When an agent authors or updates a document in K2F, it operates within an explicit, structured author workspace:

```text
./out/doc/
  doc.K2F                 # Self-contained deliverable ZIP archive
  doc.pdf                 # Optional lock-drawn export (same stem)
  source/                 # Author package directory (the agent edits this)
    design.md             # Design specification authored before coding
    manifest.json         # Page geometry, canvas mode ("paged"), margins
    content/
      root.json           # State A: Semantic JSON tree
    styles/
      theme.json          # Roles, variants, palettes, box decoration primitives
    assets/
      fonts/              # Embedded TrueType/OpenType binaries
      images/             # Embedded PNG, JPEG, SVG assets
      data/               # External datasets for large tables
    changelog.json        # Structured machine-readable edit history
  tmp/                    # Rendered preview PNGs and debug artifacts
```

### 1. State A: Declarative semantic tree with stable dotted IDs

In K2F, the editable source is `source/content/root.json` (State A). Content is structured as a pure semantic Abstract Syntax Tree (AST). Every logical node is assigned a permanent, hierarchical dotted identifier formatted as `parent_id.child_type_semantic_name` (such as `report.executive_summary.key_findings_list` or `financials.q3_results.table_revenue`).

When an agent updates a document, it does not scan for fuzzy headings or perform full-file rewrites. It applies surgical JSON patches to exact dotted node IDs. Other sections of the document, their parent geometry, and surrounding components remain completely untouched. For long publications, State A supports modular container fragments via `{ "include": "content/sub_section.json" }`, enabling agents to work on isolated chapters without loading entire documents into context.

### 2. Strict separation of intent and presentation

K2F enforces an absolute architectural boundary between content meaning and visual styling:

- **Semantic nodes contain only intent:** Content nodes specify their structural `role` (such as `h1`, `card`, `warning`, `form_field`), an optional `variant`, and text `modifiers` with UTF-8 byte ranges (`emphasis`, `link`, `math`). Placing a visual attribute (such as a font size, hex color, margin, or border width) directly on a content node violates the schema and triggers an immediate compilation error (`SCHEMA_INVALID`).
- **Visual styles live exclusively in `theme.json`:** All colors, typography hierarchies, spacing scales, corner radii, and shadow elevations are defined as named visual primitives in `source/styles/theme.json`.

Because styling is decoupled from content, an agent can completely restyle an enterprise document—changing typography, color palettes, and container padding across a 50-page publication—by modifying a single token in `theme.json`. The layout engine recomputes all geometry deterministically without risking content corruption or syntax errors.

### 3. State C: Deterministic render lock (`document.K2F.lock`)

When the author package is compiled (`k2f pack`), K2F's reference engine (`k2f_layout`, implemented in Rust) calculates exact page geometry. Using deterministic IEEE-754 floating-point math, strict HarfBuzz text shaping (`rustybuzz`), Unicode Line Breaking (UAX #14), and embedded TrueType/OpenType font binaries (system fonts are strictly prohibited), the engine computes the exact position, bounding box, and draw order of every glyph and vector shape.

This geometry is serialized into `document.K2F.lock` (State C). When viewed in official readers—such as the WebAssembly `<k2f-viewer>` web component, the Desktop Reader, or the interactive browser Playground at [k2f.dev/playground](https://k2f.dev/playground)—the application **paints the lock directly**. There is zero runtime layout recalculation and zero font reflow. A document compiled on macOS renders identically down to the sub-pixel on Windows, Linux, iOS, and Android.

### 4. Single-source multi-format publishing

From a single compiled `.K2F` package, the toolchain generates all required business deliverables:

- **Print-ready PDF:** Native vector drawing with embedded fonts and exact canvas dimensions.
- **Fillable AcroForm PDF:** Semantic `form_field` nodes compile directly into native, interactive PDF form controls (text fields, checkboxes). Agents author real interactive forms rather than drawing non-functional visual underscores (`____`).
- **Microsoft Word (`.docx`):** WordprocessingML generated by mapping locked coordinates directly to document structures.
- **PowerPoint (`.pptx`):** Slide layouts compiled directly from page geometry.
- **Adobe InDesign (`.idml`):** Complete prepress packages including an accompanying `Document Fonts/` directory for professional editorial finishing.

Under K2F's architectural rules, **exports are not sources of truth** (`PDF_IS_NOT_A_SOURCE`, `DOCX_IS_NOT_A_SOURCE`, `PPTX_IS_NOT_A_SOURCE`, `IDML_IS_NOT_A_SOURCE`). All downstream files are unidirectional read-only drawings of the render lock. To modify a document, the agent edits State A, runs the compiler, and regenerates all deliverables simultaneously.

### 5. Living semantic starting points: The K2F Gallery

Rather than forcing agents to design complex document layouts from scratch, K2F provides the **K2F Gallery** ([k2f.dev/gallery](/gallery)). The Gallery offers 469+ production-grade templates spanning business reports, executive proposals, legal contracts, invoices, resumes, certificates, and fillable forms.

All templates are licensed under **Apache 2.0**, 100% free, require zero login, and have no rate limits or paywalls. Agents can fetch templates headlessly via HTTP `GET` requests to `https://k2f.dev/api/gallery/templates/{slug}` or through the stdio MCP tool (`download_template`). Running `k2f unpack <template.K2F> -o ./out/doc/source` immediately provides the agent with an editable author package containing a verified semantic tree, production-ready theme primitives, and embedded fonts.

## Verification and publishing integrity

The fundamental operational divide between Langdock's native document generation and the K2F agent workflow lies in how deliverables are verified.

In enterprise software engineering, developers rely on closed-loop verification: code is compiled, linters inspect syntax, and test suites validate execution before deployment.

### Open-loop document generation in Langdock

When an agent in Langdock produces documents via raw markup, procedural scripts, or Office XML generation, document production operates in an open loop:

```mermaid
flowchart LR
    A["Langdock Agent generates XML / script"] --> B["Execute Python Code node / API"]
    B --> C{"Exit code 0?"}
    C -- Yes --> D["Deliver DOCX / PPTX / PDF"]
    C -- No --> E["Execution error trace"]
    D -. "Silent visual defect" .-> F["Corrupted slides, orphan text, reflow"]
```

This model suffers from critical structural vulnerabilities:

- **No Formal Document Schema:** Langdock lacks a formal semantic schema for documents. An agent generating raw XML or invoking `python-docx` has no compile-time linter to verify whether mandatory corporate sections, compliance disclosures, or table structures conform to document rules.
- **Silent Visual Failures:** Because LLMs write underlying XML or script code without visual layout feedback, a generation task may succeed with exit code `0`, yet the resulting file contains severe defects: text overlapping images, table rows clipped across page breaks, or headers orphaned at the bottom of slides. Langdock's own recommendation to limit presentations to 5–10 slide chunks is an operational workaround for the absence of a deterministic layout compiler.
- **Workflow Tests vs. Document Geometry:** Langdock Workflows include a "Test run" feature and run history timeline. However, this verifies node execution status, API payloads, and variable passing; it provides **zero spatial layout verification, geometry validation, or visual regression testing**.
- **Layout Drift Across Office Suites:** Word and PowerPoint documents reflow dynamically based on recipient font libraries, display DPI scaling, and printer drivers. An executive brief formatted neatly on an author's screen frequently splits onto additional pages on a client machine.

### The K2F compiler gate: `pack_verify.py`

K2F restores the closed-loop engineering cycle to document generation through its standardized verification gate:

```mermaid
flowchart TD
    A["Agent edits State A / Theme"] --> B["Run pack_verify.py"]
    B --> C["Validate JSON schemas against /schema/"]
    C --> D["Compile layout via Rust engine k2f_layout"]
    D --> E["Write State C document.K2F.lock"]
    E --> F["Rasterize pages to preview PNGs (--render)"]
    F --> G{"Automated quality checks"}
    G -- "Visual/Schema defect" --> H["Surface structured error code (e.g., PAGE_UNDERFILL)"]
    H --> A
    G -- "Clean verification" --> I["Generate lock-drawn PDF, Word, PPTX, IDML"]
```

The stdlib-only `pack_verify.py` script acts as the agent's document compiler and linter:

1. **Schema validation:** Validates `manifest.json`, `root.json`, and `theme.json` against strict embedded JSON schemas (`/schema/`). Hallucinated CSS attributes, missing IDs, or malformed modifier byte ranges immediately fail with structured error codes (`SCHEMA_INVALID`, `UNKNOWN_PRIMITIVE`, `UNKNOWN_ROLE`).
2. **Deterministic layout calculation:** Executes `k2f pack`, invoking the Rust reference engine (`k2f_layout`) to calculate line breaking, text shaping, and spatial geometry.
3. **Automated visual defect detection:** When executed with `--render`, the compiler rasterizes each page to a preview PNG and inspects the visual output. Crucially, the engine catches subtle visual defects such as **`PAGE_UNDERFILL`**—detecting when content fails to fill the lower third of a designed sheet—preventing unstyled, empty layouts from reaching stakeholders.
4. **Agent self-correction:** Because errors are reported as deterministic codes with exact node references, an AI agent can read the compiler output, locate the offending node in `source/content/root.json`, and apply a fix without human intervention.

### Deterministic document output across devices

Why do HTML and Word documents reflow across machines?
- In HTML/CSS, font rendering engines (Apple CoreText, Microsoft DirectWrite, Linux FreeType) calculate distinct glyph widths and line heights. Flexbox and Grid behave differently across browser releases.
- In Word (`.docx`), WordprocessingML stores zero geometry. Microsoft Word calculates page breaks dynamically based on installed system fonts, printer drivers, and DPI scaling.

K2F eliminates environment drift:
- Geometry is calculated once by `k2f_layout` using strict HarfBuzz text shaping (`rustybuzz`), Unicode line breaking (UAX #14), IEEE-754 math, and embedded fonts only.
- Draw calls and bounding boxes are locked into `document.K2F.lock`.
- Official viewers (`<k2f-viewer>`, Desktop Reader, Playground) and exporters paint the lock directly without re-running layout or reflowing text. The visual output is identical across macOS, Windows, Linux, iOS, and Android.

### Cryptographic integrity and auditability

Unlike standalone PDFs or Word documents generated by Langdock scripts, which can be modified in desktop editors without leaving an audit trail, K2F incorporates a formal two-layer cryptographic binding:

- **`content_hash`:** A SHA-256 hash computed over the normalized canonical JSON semantic tree (`content/root.json`).
- **`appearance_hash`:** A SHA-256 hash binding the semantic tree, theme tokens, embedded font binaries, canvas manifest geometry, and the exact reference engine commit SHA (`engine_commit_sha`).

These hashes are embedded directly into State C (`document.K2F.lock`). Official viewers and desktop readers audit these values upon opening, displaying a mandatory integrity banner with five canonical states:
- `SIGNED`: Cryptographically signed and fully verified against the source tree and render lock.
- `UNSIGNED`: Valid, uncorrupted document without a digital signature (the standard output of autonomous agents).
- `SIGNED_BUT_BROKEN`: A digital signature exists, but package bytes have been altered.
- `BROKEN_INTEGRITY`: Render lock draw calls or font binaries do not match the compiled appearance hash.
- `UNLOCKED`: Development package lacking a compiled State C lock.

If a document is opened in an environment with an incompatible layout engine specification, readers report the hash code `ENGINE_MISMATCH` while preserving the document's `UNSIGNED` or `SIGNED` state. For enterprise and legal compliance, organizations can apply asymmetric Ed25519 digital signatures (`signatures/v1.json`) via an explicit key-custody step, guaranteeing that neither the content nor its visual layout has been tampered with. Furthermore, K2F strictly prohibits embedded executable scripts, macros, and dynamic network calls during render.

## When to choose Langdock

Choose Langdock when your priority is enterprise-wide AI enablement, strict European compliance governance, multi-model routing, and visual business workflow automation:

- **Strict enterprise security and EU compliance governance:** Regulated organizations (in healthcare, finance, legal, or government) requiring ISO 27001, SOC 2 Type II, and EU GDPR compliance with guaranteed data residency (Hetzner, AWS EU, Azure EU), dedicated VPCs, on-premise deployments, and BYOK governance.
- **Model-agnostic LLM routing:** Organizations that want to dynamically route tasks across OpenAI (GPT-4o, o3-mini), Anthropic (Claude 3.7 Sonnet), Google (Gemini 2.0 Flash), and Mistral AI under unified enterprise billing, audit logging, and RBAC controls without vendor lock-in.
- **Unifying enterprise knowledge silos:** Teams needing automated agents that retrieve live data directly from Microsoft SharePoint, OneDrive, Google Drive, Confluence, Notion, Jira, Salesforce, and HubSpot without building custom API infrastructure.
- **No-code visual workflow automation:** Business domain experts (in HR, marketing, operations, and sales) who need to build automated multi-step pipelines combining scheduled triggers, agent reasoning, sandboxed Python scripts, and third-party SaaS actions.
- **Rapid unstructured drafting and collaboration:** Teams creating informal, internal business content—such as meeting summaries, email drafts, conversational research synthesis, and executive briefing notes—where page budgets, print typography, and fixed layout coordinates are unnecessary.
- **Synergistic enterprise orchestration with K2F:** Deploying Langdock as the secure enterprise front-end, governance layer, and data aggregator while importing the K2F skill (`SKILL.md`) or connecting K2F's stdio MCP server. In this hybrid setup, Langdock agents ingest corporate data from Salesforce or SharePoint and draft content, while invoking K2F to compile, verify, and export deterministic, publication-grade enterprise deliverables.

## When to choose K2F

Choose K2F when document generation requires publication-grade visual quality, multi-format delivery, and verifiable layout determinism:

- **Publication-grade business deliverables:** Generating formal client proposals, quarterly executive reports, legal contracts, corporate invoices, compliance filings, employee onboarding manuals, or certificates that require precise typography, balanced margins, and professional layouts.
- **Cross-device pixel stability:** Documents that cannot tolerate layout shifts, awkward page breaks, or font substitutions when opened across different operating systems, mobile devices, web browsers, or print environments.
- **Single-source multi-format enterprise publishing:** Organizations that must deliver the same core content across Microsoft Word (for legal redlining), PowerPoint (for executive presentations), interactive AcroForm PDF (for signed forms), and Adobe InDesign (for prepress agency finishing) from a single authoritative source.
- **Interactive AcroForm PDF generation:** Generating official forms, applications, or sign-off sheets that require native interactive `form_field` elements rather than visual underscores or static lines.
- **Automated CI/CD document pipelines:** Automated server workflows or agent swarms that require headless command-line compilation (`k2f pack`), schema validation, and automated visual quality gates (`pack_verify.py`) before artifacts are published.
- **Git-native version control for documents:** Teams that want documents stored as clean Canonical JSON files that can be reviewed in pull requests, diffed line-by-line, and updated by targeting stable dotted node IDs.
- **Tamper-evident legal and financial compliance:** Workflows requiring cryptographic guarantees (`content_hash`, `appearance_hash`, Ed25519 signatures) that visual appearance matches underlying semantic data, backed by a strict format standard that prohibits executable macros and tracking scripts.
- **Accelerating production with living templates:** Leveraging the 469+ production-grade templates in the [K2F Gallery](/gallery) to bootstrap documents instantly without paying subscription fees or guessing layout coordinates.

## Bottom line

Langdock and K2F address two complementary layers of modern enterprise automation. Langdock provides the secure enterprise operating system: model-agnostic LLM routing, strict GDPR compliance, cross-silo data integration, and visual workflow automation. However, general-purpose enterprise platforms lack specialized layout engines, mathematical pagination solvers, and strict document schemas. As a result, agents generating raw XML or procedural scripts often produce corrupted layouts and unverified deliverables.

K2F provides the missing compiler and verification gate for agent-authored documents. By establishing a dual-state architecture that separates semantic intent from deterministic geometry, K2F transforms document generation from an unverified script-writing exercise into a repeatable, automated engineering discipline. Rather than choosing between them, enterprise teams can combine both: using Langdock as the secure corporate orchestrator, and equipping it with K2F to compile, verify, and export pixel-stable enterprise deliverables.

To explore technical specifications, layout crate internals, and schema definitions, review the [documentation](/docs). To inspect production-ready templates across business, legal, and educational categories, visit the [Gallery](/gallery). To understand the architectural principles behind the dual-state model, read [why K2F exists](/why), or explore comprehensive cross-format evaluations on [Compare](/compare).

This comparison is based on publicly available information at the time of writing. Capabilities, pricing, and policies may change; verify details with the relevant provider.
