AILANG Parse + SuperDoc

Read side + write side. Complete OOXML-native document intelligence.

The Vision

Legal AI needs to both read and write documents with full fidelity. Most tools do one or the other — they can extract text from a contract, or they can generate a new document, but they cannot round-trip through AI analysis while preserving the structural integrity that legal teams depend on.

AILANG Parse is the read side. It extracts structured content from DOCX files — track changes, comments, tables, clauses, headers, footers — as a typed Block ADT that LLMs can reason about.

SuperDoc is the write side. Its Document Engine applies tracked changes, comments, and formatting programmatically back into native DOCX files with full OOXML fidelity.

Together: read a contract, reason about it with AI, write changes back with native tracked changes. The complete legal AI document workflow.

This integration is designed for legal technology teams building AI-powered contract review, compliance analysis, and document intelligence workflows. Both tools operate on native OOXML — no PDF conversion, no data loss.

What is SuperDoc?

SuperDoc is an open-source DOCX editor with full OOXML fidelity. Unlike browser-based editors that convert documents to an internal representation and lose formatting, SuperDoc operates directly on the OOXML structure.

Key capabilities:

  • Document Engine — apply tracked changes, comments, and formatting programmatically via API
  • OOXML fidelity — no format conversion, no data loss, round-trip safe
  • Claude MCP integration — connect AI models directly to document editing
  • Open source — inspect, extend, and self-host the full stack

Learn more at superdoc.dev.

The Workflow

The integration follows a five-step pipeline from contract intake to legal review:

  1. Parse the contract with AILANG Parse. The DOCX parser extracts a Block ADT with full structural fidelity — track changes with author and date, comments anchored to text ranges, table structures with merged cells, headings, lists, and section boundaries.
  2. Send blocks to an LLM for analysis. The structured output lets the model reason about specific clauses rather than raw text. Flag risky terms, identify missing protections, detect non-standard language, compare against playbook templates.
  3. Generate revision suggestions as tracked changes. The LLM produces structured edit instructions — insertions, deletions, and modifications — each tied to specific block locations in the document.
  4. Apply changes via SuperDoc Document Engine. SuperDoc writes the AI-suggested revisions back into the DOCX as native OOXML tracked changes with proper redlining. Comments are inserted as native Word comments, not annotations.
  5. Return to the legal team for review. Lawyers see clean tracked changes in Microsoft Word — the same redlines they use in every negotiation. They accept, reject, or modify each change. The audit trail is intact.

Why This Matters

This integration preserves the audit trail end-to-end:

  • AILANG Parse preserves track changes on the read side — every insertion, deletion, and format change is extracted with its author, timestamp, and original text
  • SuperDoc preserves track changes on the write side — AI-suggested edits are written as native OOXML revisions, indistinguishable from human edits in Word
  • The legal team reviews AI suggestions using the same Accept/Reject workflow they already know

Architecture

Pipeline Overview

                        AILANG Parse + SuperDoc Pipeline

  DOCX Input              Read Side                AI Analysis
 +-----------+     +------------------+     +-------------------+
 | Contract  | --> | AILANG Parse     | --> | LLM               |
 | with      |     |                  |     |                   |
 | existing  |     | - Track changes  |     | - Flag risks      |
 | tracked   |     | - Comments       |     | - Missing clauses |
 | changes   |     | - Tables         |     | - Non-standard    |
 |           |     | - Clause bounds  |     |   terms           |
 +-----------+     +------------------+     +-------------------+
                          |                         |
                          v                         v
                   Block ADT              Revision Instructions
                   (9 variants)           (insert/delete/modify)
                                                    |
                                                    v
                        Write Side              DOCX Output
                   +------------------+     +--------------+
                   | SuperDoc         | --> | Contract     |
                   | Document Engine  |     | with native  |
                   |                  |     | tracked      |
                   | - Apply changes  |     | changes from |
                   | - Insert comments|     | AI review    |
                   | - OOXML fidelity |     |              |
                   +------------------+     +--------------+
                                                    |
                                                    v
                                            Legal Team Review
                                            (Accept / Reject)

Data Flow

StageToolInputOutput
1. ParseAILANG ParseDOCX fileBlock ADT (JSON)
2. AnalyzeLLM (any provider)Block ADTRisk assessment + suggestions
3. GenerateLLM (any provider)AssessmentRevision instructions
4. ApplySuperDoc EngineRevision instructionsDOCX with tracked changes
5. ReviewMicrosoft WordModified DOCXAccepted/rejected changes

Getting Started

1. Install AILANG Parse

Follow the self-hosting guide to set up AILANG Parse. The quickest path:

# Install AILANG
curl -fsSL https://ailang.sunholo.com/install.sh | bash

# Clone AILANG Parse
git clone https://github.com/sunholo-data/docparse.git
cd docparse

# Parse a contract with track changes
./bin/docparse contract.docx

2. Set Up SuperDoc

Visit superdoc.dev to set up the SuperDoc Document Engine. SuperDoc provides SDKs and a REST API for programmatic document editing.

3. Connect via API

Use the AILANG Parse REST API to parse contracts, then pipe the Block ADT output to your LLM for analysis. Send the resulting revision instructions to SuperDoc's Document Engine to apply changes.

# Parse a contract via the AILANG Parse API
curl -X POST http://localhost:8080/api/v1/parse \
  -H "X-API-Key: your-key" \
  -F "file=@contract.docx"

# The response contains structured blocks with track changes,
# comments, tables, and clause boundaries — ready for LLM analysis

The Block ADT output includes Change blocks for every tracked change (with author, date, and type), Text blocks with comment annotations, and full structural context for clause-level reasoning.

Building a legal AI product?
Deploy AILANG Parse as part of Sunholo Multivac — our AI platform with managed AILANG Parse, billing, and enterprise support. Pair it with SuperDoc for a production-grade legal AI stack.

Contact Sunholo →

Frequently Asked Questions

What is the AILANG Parse and SuperDoc integration?

AILANG Parse reads documents with full structural fidelity. SuperDoc writes AI-suggested changes back as native OOXML tracked changes. Together: a complete read-write legal AI workflow.

Can AI tools preserve track changes when editing Word documents?

Yes. With the AILANG Parse and SuperDoc workflow, AI-suggested edits are applied as native OOXML tracked changes — not as clean overwrites. AILANG Parse reads the original document with full track change history intact, an LLM analyzes the content and generates revision suggestions, and SuperDoc's Document Engine writes those suggestions back as proper tracked changes. Legal reviewers see familiar redlines in Word, not AI-generated blobs.

How does AILANG Parse help with contract review?

AILANG Parse extracts structured blocks including Change blocks with author/date and comments with anchored ranges, letting LLMs reason about specific clauses while maintaining structural context.

Does SuperDoc support programmatic document editing?

Yes. SuperDoc provides a Document Engine that can apply tracked changes, insert comments, and modify formatting programmatically in DOCX files with full OOXML fidelity. SuperDoc also offers a Claude MCP integration for AI-powered document editing. Visit superdoc.dev to learn more about their open-source DOCX editor and Document Engine API.