# Gamma 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 fluid CSS containers, opaque PDFs, or transient cloud database records, the **K2F format** operates on an explicit dual-state architecture: an editable, machine-readable 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 business content without breaking layouts, verify structural integrity and visual balance through an automated compiler gate (`pack_verify`), and guarantee **deterministic document output** across Microsoft Word (`.docx`), PowerPoint (`.pptx`), interactive AcroForm PDF, and Adobe InDesign (`.idml`).

This [document format comparison](/compare) examines how a web-first generative presentation platform and an open document architecture address distinct layers of the publishing stack. K2F does not replace general-purpose coding agents or generative visual design tools like Gamma. In fact, developer agents can leverage both tools across different operational stages: utilizing Gamma for rapid visual ideation, pitch deck prototyping, and hosted interactive web pages, while deploying K2F and [k2f.dev](https://k2f.dev) for publication-grade contracts, verifiable financial reports, fillable forms, and multi-format enterprise document distribution.

At the same time, K2F enforces rigorous format boundaries. K2F is not an interactive generative web canvas, a cloud-hosted presentation portal, or an AI image generation model. K2F v0.1 ships with an explicit `"paged"` canvas mode (slide presentation mode and infinite canvas mode are roadmap design targets), does not import pre-existing PDF files (`PDF_IS_NOT_A_SOURCE`) or Microsoft Word documents (`DOCX_IS_NOT_A_SOURCE`), strictly prohibits executable scripts and macros in State A JSON, forbids arbitrary Bézier vector drawing paths 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 local CLI tooling and stdio MCP are shipped, remote HTTP MCP services remain Not publicly specified.

## At a glance

| Evaluation criterion | Gamma agent path | K2F agent path |
| :--- | :--- | :--- |
| **Core identity** | Web-first generative AI presentation, document, and webpage creation platform | Open semantic document file format (Apache 2.0) and deterministic Rust layout compiler |
| **Primary surface** | Responsive card canvas on cloud infrastructure; browser WYSIWYG editor | Author package workspace: Declarative JSON tree (`source/`) and local CLI/SDK |
| **Native typesetting engine** | None; browser DOM layout using dynamic CSS Flexbox and Grid | Built-in Rust reference engine (`k2f_layout`) with HarfBuzz text shaping (`rustybuzz`) and UAX #14 line breaking |
| **Generative visual synthesis** | Built-in multimodal AI image and illustration generator inside cards | None; graphic assets must be supplied as pre-rendered images/SVGs in `assets/images/` |
| **Source representation** | Proprietary cloud database records, transient blocks, and web card DOM trees | Dual-state: Canonical semantic JSON tree (State A) compiled into an immutable render lock (State C) |
| **Node addressing for edits** | Ephemeral, internal cloud keys; regenerated from scratch upon new prompt passes | Mandatory, hierarchical dotted node IDs (`parent_id.child_type_semantic_name`) on all semantic elements |
| **Intent–presentation separation** | Blended; visual styling, column counts, and card themes are generated together | Strict separation; zero inline styling in State A; visual design tokens isolated in `styles/theme.json` |
| **Cross-device layout consistency** | Fluid on web; static exports (PDF/PPTX) suffer from clipping, font substitution, and bitmap flattening | Absolute; official viewers paint pre-compiled `document.K2F.lock` directly with zero runtime text reflow |
| **Verification & quality gate** | Human visual review of hosted web URL or PDF; zero semantic schema linters or visual test gates | Automated local `pack_verify.py` validating embedded schemas (`/schema/`) and catching visual defects (`PAGE_UNDERFILL`) |
| **Multi-format publishing** | Hosted web destination, Chromium print PDF, flattened PPTX slides, and card PNG zip | Single-source lock compilation exporting to AcroForm PDF, Word (`.docx`), PowerPoint (`.pptx`), and InDesign (`.idml`) |
| **Interactive forms** | Web embed forms (Typeform); static visual exports lack fillable form controls | Native `form_field` semantic nodes compile directly into standard interactive AcroForm PDF controls |
| **Arbitrary vector art** | Supported via web card embeds and standard web graphics | Forbidden in State A JSON; external vector graphics stored as pre-rendered SVGs in `assets/images/` |
| **Cryptographic integrity** | None; hosted web pages and export files contain no cryptographic hashes or tamper-evidence | Native SHA-256 `content_hash` and `appearance_hash`, optional Ed25519 signatures, and viewer integrity banners |
| **Pre-built template ecosystem** | Proprietary cloud visual templates and community presentation styles | 469+ production-grade templates on [k2f.dev/gallery](/gallery) (Apache 2.0, 100% free, zero login) |
| **Developer & API automation** | Cloud REST API (`v1.0`), Zapier, Make, n8n, and MCP gateways (Composio); metered paid credits | 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** | Cloud-hosted Gamma project is source; exported PDF and PPTX files cannot be 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`) |

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

### The card-based visual medium

Gamma departs from legacy document and presentation formats by organizing content into modern, web-first visual primitives. Rather than constraining layout to rigid 16:9 presentation slides or traditional paginated 8.5×11-inch letter sheets, Gamma structures information into modular, responsive, fluidly expandable visual units called **Cards**.

Gamma supports four primary output modes:
1. **Presentations:** Sequences of visual cards presented sequentially with smooth horizontal or vertical transitions.
2. **Documents:** Scrollable, long-form executive briefs, proposals, or project memos composed of vertically stacked cards.
3. **Webpages:** Single-page responsive web destinations with floating navigation headers, interactive sections, and mobile viewport reflow.
4. **Social Posts:** Compact, standalone visual card graphics optimized for sharing across digital platforms.

Content creation in Gamma is driven by its **Generative AI Creation Engine**. Users or connected automated agents provide a natural language prompt, an outline, an uploaded document (PDF, DOCX, TXT), or a public web URL. Gamma's engine parses the input and synthesizes a styled deck, document, or webpage in seconds. Within the browser interface, users can interact with an in-app conversational assistant ("Edit with AI" / "Ask AI") to rewrite copy, adjust visual tones, or convert plain bulleted lists into visual multi-column callouts, metric highlights, or timeline sequences.

Gamma's web application features a modular block editor supporting rich layouts: nested columns, accent callouts, accordions, galleries, toggle lists, tables, charts, and interactive embeds (Figma prototypes, Loom videos, YouTube, Typeform forms, and Airtable bases). One-click global themes allow users to swap typography hierarchies, color palettes, and container background treatments across all cards simultaneously.

### Developer REST API (v1.0) and agent connectors

For programmatic document generation, Gamma provides a cloud-hosted developer REST API (`v1.0`):
- **Base URL:** `https://public-api.gamma.app/v1.0/`
- **Authentication:** Authenticated via the `X-API-KEY` HTTP header.
- **Asynchronous Generation (`POST /v1.0/generations`):** Creates a new Gamma project from scratch using an `inputText` string or a structured `pages` array (up to 50 pages). Agents configure parameters such as `format` (`presentation`, `document`, `webpage`, `social`), `numCards`, and `cardSplit` (`auto` or explicit delimiters via `\n---\n`).
- **Template Adaptation (`POST /v1.0/generations/from-template`):** Adapts or remixes an existing Gamma template using a natural language prompt to restructure cards, replace copy, or update metrics.
- **Polling Status (`GET /v1.0/generations/{generationId}`):** Returns the generation lifecycle status (`queued`, `processing`, `completed`, `failed`), along with the public `gammaUrl`, an `exportUrl` for downloading the requested file export, and metered `credits` consumption.
- **Project Management:** Endpoints including `POST /v1.0/gammas/{gammaId}/archive` and `DELETE /v1.0/gammas/{gammaId}` allow agents to manage cloud-hosted projects.

Beyond the raw REST API, Gamma connects to automated workflows through native integrations with **Zapier**, **Make.com**, and **n8n**, as well as a ChatGPT Custom GPT connector. For autonomous developer agents operating in environments like Claude Desktop, Claude Code, and Cursor, Gamma connects via Model Context Protocol (MCP) servers and middleware gateways (such as Composio, Activepieces, and community MCP packages). Through these connectors, coding agents can trigger document generations, adapt existing templates, and retrieve export download links directly from their development environments.

### Typical document outputs produced by Gamma

When invoked by autonomous agents, Gamma generates several distinct output representations:

1. **Live Hosted Web Destination (`gamma.app/docs/...`):** Gamma’s primary native output. Hosted on Gamma’s cloud infrastructure, this URL provides a responsive, interactive viewing experience featuring mobile/tablet reflow, expandable cards, interactive video/app embeds, and built-in viewer engagement analytics (tracking viewer counts and drop-off per card).
2. **Static PDF (`.pdf`):** Produced via a server-side headless browser pipeline (Chromium print-to-PDF / web-to-pdf). This pipeline converts fluid web cards into static PDF pages. However, because cards are designed for responsive web displays, PDF exports frequently suffer from layout translation issues: content clipping, awkward page splits cutting directly through text or cards, missing background elements, and a complete absence of tagged PDF accessibility trees or fillable AcroForm fields.
3. **Microsoft PowerPoint (`.pptx`):** Translates web cards into PowerPoint slides. To preserve complex visual styling, gradients, shadows, and interactive components, Gamma frequently flattens complex card layouts into static raster bitmap images. As a result, text boxes often do not behave as reflowable PowerPoint shapes, and custom web fonts undergo font substitution on recipient machines that lack Gamma's cloud fonts.
4. **Raster Images (`.png` in `.zip`):** When requested via `exportAs: "png"`, the API returns a `.zip` archive containing one high-resolution raster image per card.
5. **Document Markup:** Gamma accepts Markdown as an input format (`inputText` with markdown formatting and `\n---\n` card splits). However, Gamma does not export clean, structured Markdown Abstract Syntax Trees (AST) back to downstream agent pipelines. Standalone HTML download bundles remain Not publicly specified, native Word (`.docx`) compilation and export endpoints remain Not publicly specified, and Adobe InDesign (`.idml`) is completely unsupported.

### The absence of a native paginated document engine

Gamma’s architectural focus on responsive web cards highlights a critical limitation for formal publishing: **Gamma contains zero native paginated document typesetting engines**.

It contains no mathematical pagination algorithms, no Unicode line-breaking solvers (such as Unicode UAX #14), no font shaping engines (such as HarfBuzz), and no spatial constraint solvers for formal multi-page document pagination. Gamma's documents are rendered strictly via the client's web browser DOM utilizing dynamic CSS Flexbox and Grid. When printed or converted to static PDF, the output relies on headless browser print emulation rather than a multi-pass document layout compiler. As a result, Gamma cannot enforce precise page budgets, manage formal running headers and footers, balance multi-column text flows across page boundaries, or prevent orphan headings from separating from their body paragraphs.

### Editing mechanics: Full regeneration versus surgical mutations

The editing mechanics in Gamma reveal a structural bottleneck for autonomous agents:
- **Absence of fine-grained mutation endpoints:** The Gamma developer REST API contains no fine-grained mutation endpoints (`PATCH` or `PUT` to edit specific text blocks, tables, or cards). Programmatic interaction is strictly an asynchronous generation pipeline.
- **Stochastic layout drift:** Because Gamma relies on generative LLMs and heuristic design generators, modifying an existing document programmatically requires triggering a full re-generation job (`POST /generations` or `POST /generations/from-template`) with revised prompts. Because generative models are non-deterministic, calling the API with updated text for a single paragraph or pricing figure can unpredictably alter the visual theme, column count, card boundaries, and accompanying imagery across the entire presentation.
- **GUI editing inaccessible to headless agents:** While human users can click into specific cards in the browser WYSIWYG editor or invoke "Edit with AI" on isolated blocks, this surgical loop is unavailable to headless autonomous agents operating via API.
- **Ephemeral node identifiers:** Internal card and block identifiers exist only as transient database keys within Gamma's proprietary cloud backend. They are not exposed to external agents as a permanent, semantic schema contract. Re-running generation synthesizes cards anew, breaking external references and preventing agents from targeting specific elements (such as `contract.section_2.clause_b`) across revisions.

## What K2F adds

K2F approaches agent document production from an entirely different engineering foundation: treating documents not as fluid, stochastic web canvases or transient cloud records, but as open, compiled, and verifiable software assets. 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 autonomous agent authors or modifies a document in K2F, it operates within an explicit, self-contained author package directory:

```text
./out/doc/
  doc.K2F                 # Self-contained deliverable ZIP archive
  doc.pdf                 # Optional lock-drawn export (same stem)
  doc.docx                # Optional lock-drawn export (same stem)
  doc.pptx                # Optional lock-drawn export (same stem)
  doc.idml                # 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 (mandatory)
      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
```

### State A: Semantic JSON tree with permanent dotted node IDs

In K2F, the authoritative source of truth is `source/content/root.json` (State A). Content is structured as a pure semantic Abstract Syntax Tree (AST). Physical coordinates, pixel dimensions, font sizes, and inline color values are strictly forbidden.

Every logical node carries a mandatory, permanent, hierarchical dotted identifier formatted as `parent_id.child_type_semantic_name` (for example, `financials.q3_results.table_revenue` or `invoice.line_items.row_4`). When an agent updates a document, it does not re-prompt a generative engine or risk stochastic drift. It applies surgical JSON patches directly to exact dotted node IDs:

```json
{
  "id": "financials.q3_results.table_revenue",
  "role": "table",
  "variant": "financial_summary",
  "data": {
    "columns": ["Quarter", "Revenue", "Margin"],
    "rows": [
      ["Q1", "$12.4M", "24.2%"],
      ["Q2", "$14.1M", "25.8%"],
      ["Q3", "$15.8M", "26.5%"]
    ]
  }
}
```

Because State A is stored as Canonical JSON (with alphabetically sorted keys and 2-space indentation), all edits are fully trackable in standard Git version control. Code reviews, pull requests, and automated agent diffs focus exclusively on semantic changes rather than layout noise or binary metadata shifts. Long documents can also partition content across chapters using explicit `{ "include": "content/chapter_two.json" }` stubs resolved at compile time.

### Strict intent–presentation decoupling via theme.json

K2F strictly decouples content structure from visual styling. Content nodes in State A declare only semantic meaning (`role`, optional `variant`, and closed-enum text `modifiers` with UTF-8 byte ranges: `emphasis`, `link`, `underline`, `strikethrough`, `subscript`, `superscript`, `math`, `syntax_highlight`). Visual styles live exclusively in `source/styles/theme.json`.

If an agent attempts to inject inline styling attributes (such as `"color": "#FF0000"` or `"font-size": "16px"`) directly onto a content node in State A, the compiler immediately rejects the package with a `SCHEMA_INVALID` compilation error. Visual styling is defined entirely through named design primitives:

```json
{
  "roles": {
    "heading_1": {
      "font_family": "InstrumentSans",
      "font_weight": "bold",
      "font_size": 28,
      "line_height": 1.2,
      "color": "primary_text"
    }
  },
  "palettes": {
    "default": {
      "primary_text": "#1A1A1A",
      "brand_accent": "#0052CC",
      "surface_subtle": "#F4F5F7"
    }
  }
}
```

This decoupling enables global restyling without layout breakage. An agent updating corporate branding across a 50-page annual report modifies only theme tokens in `theme.json`. Recompiling recomputes typography and spatial geometry deterministically in milliseconds, with zero risk of hallucinating text or breaking structural hierarchy.

### Single-source multi-format enterprise publishing

While Gamma produces fluid web cards that degrade when converted to static PDF or PowerPoint, K2F compiles deliverables from a single authoritative render lock (`document.K2F.lock` / State C). From this single source, K2F produces:
- **Print-ready PDF:** Pixel-stable, high-resolution paginated documents with embedded fonts and precise margin alignment.
- **Interactive AcroForm PDF:** Native `form_field` semantic nodes compile directly into standard fillable PDF form controls (text inputs, checkboxes, signatures), eliminating manual field positioning.
- **Microsoft Word (`.docx`):** Fully structured Word documents matching compiled lock geometry.
- **Microsoft PowerPoint (`.pptx`):** Presentations compiled directly from the render lock.
- **Adobe InDesign (`.idml`):** Complete prepress packages including structured geometry and an accompanying `Document Fonts/` directory, ready for professional prepress finishing.

Crucially, K2F enforces an unyielding architectural principle: **Exports Are Not Sources (`*_IS_NOT_A_SOURCE`)**. The rules `PDF_IS_NOT_A_SOURCE`, `DOCX_IS_NOT_A_SOURCE`, `PPTX_IS_NOT_A_SOURCE`, and `IDML_IS_NOT_A_SOURCE` mean that all exports are unidirectional read-only drawings of the compiled render lock. Any subsequent revisions must occur in `source/content/root.json` or `source/styles/theme.json`, followed by recompilation.

### Template bootstrapping via the K2F Gallery

Rather than requiring agents to design complex layouts from scratch, the K2F ecosystem provides an open repository of **469+ production-grade templates** at [k2f.dev/gallery](/gallery).
- **Completely open:** 100% free under Apache 2.0, requiring zero login, no API keys, no subscriptions, no watermark, and no download rate limits.
- **Multi-format downloads:** Each template provides simultaneous downloads for `.K2F`, Word, PowerPoint, and InDesign.
- **Programmatic agent workflow:** Agents fetch templates headlessly via HTTP `GET` requests to `https://k2f.dev/api/gallery/templates/{slug}` or K2F's stdio MCP server (`download_template`), unpack the archive using `k2f unpack <template.K2F> -o ./out/doc/source`, patch the semantic JSON, and recompile.

## Verification and repeatability

The most critical operational contrast between Gamma and K2F lies in **verification and repeatability**. In automated enterprise pipelines, an agent must verify that generated documents satisfy schema rules, respect page budgets, and remain visually uncorrupted before delivering them to clients or regulatory bodies.

```mermaid
flowchart TD
    subgraph Gamma ["Gamma Agent Path (Cloud Stochastic Generation)"]
        G_Prompt["Natural Language Prompt / Outline"] --> G_API["Cloud REST API (v1.0)"]
        G_API --> G_LLM["Generative LLM & CSS Generator"]
        G_LLM --> G_Web["Hosted Web Cards (gamma.app/docs/...)"]
        G_Web --> G_Export["Headless Chromium Print-to-PDF / PPTX"]
        G_Export --> G_Review["Manual Human Visual Review (No automated CI/CD gates)"]
    end

    subgraph K2F ["K2F Agent Path (Deterministic Compiler Pipeline)"]
        K_Source["State A: Semantic JSON Tree (root.json)"] --> K_Verify["pack_verify Quality Gate"]
        K_Theme["Theme Tokens (theme.json)"] --> K_Verify
        K_Fonts["Embedded Fonts (assets/fonts/)"] --> K_Verify
        K_Verify --> K_Schema{"JSON Schema & Primitive Validation"}
        K_Schema -- "Invalid / Inline Styles" --> K_Fix["Agent Auto-Repair by Dotted ID"]
        K_Fix --> K_Verify
        K_Schema -- "Valid" --> K_Rust["Rust Layout Engine (k2f_layout)"]
        K_Rust --> K_Lock["State C: Immutable Render Lock (.lock)"]
        K_Lock --> K_Render{"Visual Check (--render)"}
        K_Render -- "PAGE_UNDERFILL detected" --> K_Adjust["Agent Refines Layout Spacing"]
        K_Adjust --> K_Verify
        K_Render -- "Pass" --> K_Exports["Simultaneous Multi-Format Compilation\n(PDF, AcroForm, DOCX, PPTX, IDML)"]
    end
```

### Compiler validation and the pack_verify.py quality gate

In Gamma, verification is strictly manual. Agents poll `GET /v1.0/generations/{generationId}` until the status is `completed`, after which a human must visually review the generated web URL or downloaded PDF. There are no automated linters, no schema validators, and no CI/CD assertion gates to catch visual defects or missing content.

In K2F, verification is an automated, local-first engineering discipline powered by `scripts/pack_verify.py`:
1. **Schema validation:** Validates `manifest.json`, `root.json`, and `theme.json` against strict embedded JSON Schemas (`/schema/`). The compiler enforces hard rules: inline styles trigger `SCHEMA_INVALID`, undeclared visual atoms trigger `UNKNOWN_PRIMITIVE`, and invalid UTF-8 byte ranges on text modifiers fail immediately.
2. **Deterministic layout calculation:** Invokes the Rust reference engine (`k2f_layout`) to compute line breaking, glyph shaping, and spatial bounding boxes.
3. **Automated visual defect detection (`PAGE_UNDERFILL`):** When executed with `--render`, the compiler rasterizes each page to a preview PNG and inspects layout density. 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. **Autonomous agent self-correction:** Because compiler errors are returned as structured error codes with exact dotted node references, an AI agent can read the output, locate the offending element in `source/content/root.json`, and apply a fix without human intervention.

### Layout determinism and the immutable render lock

Why do documents generated by web engines like Gamma reflow unpredictably across platforms?
- Dynamic CSS rendering relies on the client's browser engine (Blink, WebKit, Gecko), display scaling, and local operating system font engines (Apple CoreText, Microsoft DirectWrite, Linux FreeType). Minor differences in glyph rasterization cause text to wrap across different line breaks.
- In PowerPoint exports, complex web cards are flattened into static raster bitmaps to prevent font reflow, while text boxes that remain editable undergo font substitution if recipient machines lack Gamma's cloud fonts.

K2F eliminates environment drift through its **deterministic render lock** (`document.K2F.lock` / State C):
- Layout geometry is computed once by `k2f_layout` using HarfBuzz text shaping (`rustybuzz`), Unicode line breaking (UAX #14), IEEE-754 math, and strictly embedded TrueType/OpenType fonts (`assets/fonts/`). System font fallbacks are prohibited.
- Spatial bounding boxes, glyph positions, and draw calls are locked into State C.
- Official viewers (`<k2f-viewer>`, Desktop Reader, Playground) and format exporters paint the lock plan directly with zero runtime text reflow. The visual output is identical across macOS, Windows, Linux, iOS, Android, and web browsers.

### Cryptographic integrity and archival trust

Gamma provides no cryptographic linkage between input prompts, layout parameters, and delivered files. Cloud-hosted web links can be modified or deleted at any time, and exported PDFs or PPTX files contain no mathematical tamper-evidence mechanisms.

K2F incorporates a formal two-layer cryptographic binding:
- **`content_hash`:** A SHA-256 hash computed over the canonical semantic JSON tree (`content/root.json`).
- **`appearance_hash`:** A SHA-256 hash binding the semantic tree, theme tokens, embedded font binaries, page manifest setup, 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 reporting 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 status code `ENGINE_MISMATCH` while preserving the document's `UNSIGNED` or `SIGNED` state. For legal and corporate compliance, organizations can apply asymmetric Ed25519 digital signatures (`signatures/v1.json`) via an explicit key-custody process. Furthermore, K2F strictly prohibits embedded executable scripts, macros, and dynamic network calls during render.

## When to choose Gamma

Choose Gamma when your priority is rapid visual storytelling, fluid web-first presentation, and interactive digital sharing:

- **Rapid first-draft visual decks and presentations:** Generating complete 10-card pitch decks, sales overviews, or meeting summaries from a prompt or pasted outline in under 30 seconds without manually defining layout structures.
- **Native web-first interactive destinations:** Creating responsive, scrollable mini-sites or project briefs hosted on `gamma.app/docs/...` that feature interactive Loom videos, Figma embeds, YouTube clips, and live Typeform forms.
- **Built-in multimodal AI asset synthesis:** Projects requiring context-aware AI-generated illustrations, concept art, and thematic backgrounds created directly inside cards without external graphic design pipelines.
- **Collaborative no-code business workflows:** Teams that rely on native SaaS automations through Zapier, Make, or n8n, combined with live in-browser multi-user editing, inline comments, card reactions, and viewer drop-off analytics.
- **Frictionless non-technical accessibility:** Business users and non-developer teams who need professional presentation collateral without installing Python runtimes, executing command-line compilers, or managing JSON schemas.
- **Hybrid generation pipelines:** Using Gamma at the conceptual stage to brainstorm visual structure and copy with stakeholders, before codifying approved corporate deliverables into verifiable K2F author packages.

## When to choose K2F

Choose K2F when your workflow demands publication-grade typography, verifiable layout determinism, and multi-format enterprise delivery:

- **Publication-grade enterprise documents:** Generating formal client proposals, quarterly financial reports, legal contracts, regulatory filings, corporate invoices, employee onboarding handbooks, or certificates that require strict typographic hierarchy and balanced page budgets.
- **Cross-device pixel stability:** Publishing documents that cannot tolerate layout reflow, awkward page breaks, or font substitutions when opened across different operating systems, mobile devices, or desktop office suites.
- **Single-source multi-format enterprise publishing:** Organizations required to deliver the same authoritative content simultaneously across Microsoft Word (for legal review), PowerPoint (for executive presentations), interactive AcroForm PDF (for signed approvals), and Adobe InDesign (for prepress agency production) from a single source of truth.
- **Interactive AcroForm PDF generation:** Generating official applications, compliance checklists, or registration forms with genuine interactive `form_field` controls rather than static underscore strings `____`.
- **Headless CI/CD automation & agent workflows:** Enterprise pipelines and agent swarms that require local-first execution via `pip install k2f` or Cargo, operating completely offline or in air-gapped environments without cloud API subscriptions, metered credits, or rate limits.
- **Git-native document engineering:** Teams that manage documents as code, maintaining Canonical JSON files in Git repositories, reviewing pull request diffs, and applying surgical node updates by targeting permanent dotted IDs.
- **Tamper-evident legal and financial compliance:** Workflows requiring mathematical proof (`content_hash`, `appearance_hash`, optional Ed25519 signatures) that visual pages strictly match underlying semantic data, backed by a format that bans executable scripts and tracking macros.
- **Accelerating production with production-grade templates:** Leveraging the 469+ free, production-grade templates in the [K2F Gallery](/gallery) to bootstrap enterprise publishing without recurring subscription costs.

## Bottom line

Gamma and K2F address two entirely different paradigms in modern AI document production. Gamma is a web-first presentation and visual canvas platform optimized for rapid ideation, responsive web mini-sites, and collaborative team presentations. Its generative AI engine excels at turning prompts into engaging visual cards in seconds. However, because Gamma relies on browser DOM rendering and lacks a native paginated typesetting engine, its static PDF and PowerPoint exports suffer from layout drift, flattened raster graphics, and a lack of programmatic verification gates.

K2F is an open semantic document format and deterministic layout compiler built for verifiable, publication-grade enterprise publishing. By establishing a dual-state architecture that separates semantic intent from physical geometry, K2F provides the compiler infrastructure that autonomous agents require: permanent dotted node IDs for surgical patching, automated visual quality gates via `pack_verify`, and an immutable render lock that paints identical pixels across PDF, Word, PowerPoint, and InDesign.

Rather than viewing them as mutually exclusive, forward-looking engineering teams can deploy both: utilizing Gamma as a visual front-end for rapid brainstorming and hosted interactive decks, while using K2F as the deterministic compiler for formal, verifiable, and archival enterprise documents.

To review architectural specifications, compiler internals, and schema contracts, visit the [documentation](/docs). To inspect and download production-grade templates across business, financial, and legal categories, browse the [Gallery](/gallery). To explore the technical philosophy behind the dual-state model, read [why K2F exists](/why), or examine detailed format evaluations on the [Compare](/compare) index.

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.
