AILANG Parse + SuperDoc

AILANG Parse reads the contract. SuperDoc writes the AI's edits back as tracked changes.

The Vision

Legal AI has to both read and write Word documents without losing anything. Many tools do one or the other. They extract text from a contract, or they generate a new document. They cannot take a contract through AI analysis and hand it back with the tracked changes and comments that legal teams rely on.

AILANG Parse is the read side. It extracts the content of a DOCX file (track changes, comments, tables, clauses, headers, footers) as structured blocks an LLM can work with.

SuperDoc is the write side. Its Document Engine applies tracked changes, comments and formatting to DOCX files from code.

Together: read a contract, analyze it with AI, and write the suggested edits back as tracked changes.

This workflow is for legal technology teams building AI contract review and compliance analysis. Both tools work on the Word file format itself (OOXML), with no PDF conversion in between.

What is SuperDoc?

SuperDoc is an open-source DOCX editor. It edits the Word file format (OOXML) itself, so a document does not lose formatting by being converted to another format and back.

What it offers:

  • Document Engine: apply tracked changes, comments and formatting through an API
  • OOXML fidelity: the file stays a Word file, with no format conversion
  • Claude MCP integration: connect AI models to document editing
  • Open source: inspect it, extend it and host it yourself

Learn more at superdoc.dev.

The Workflow

Five steps take a contract from intake to legal review:

  1. Parse the contract with AILANG Parse. You get structured blocks: track changes with author and date, comments with the text they are attached to, tables with merged cells, headings, lists and sections.
  2. Send the blocks to an LLM for analysis. With structured blocks the model can work clause by clause instead of on raw text. It can flag risky terms, find missing protections, spot non-standard language and compare against your playbook.
  3. Generate revision suggestions. The LLM returns edit instructions (insert, delete, modify), each tied to a specific block in the document.
  4. Apply the changes with the SuperDoc Document Engine. SuperDoc writes the suggested revisions into the DOCX as Word tracked changes, and the comments as Word comments.
  5. Return it to the legal team for review. Lawyers see tracked changes in Microsoft Word, the same redlines they use in every negotiation. They accept, reject or modify each change, and the audit trail is intact.

Why This Matters

The audit trail is kept from start to finish:

  • AILANG Parse keeps track changes on the read side: every insertion, deletion and format change comes with its author, timestamp and text
  • SuperDoc keeps track changes on the write side: AI-suggested edits are written as Word revisions that look the same in Word as a person's edits
  • The legal team reviews AI suggestions with the Accept/Reject buttons they already use

Architecture

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 fileBlocks (JSON)
2. AnalyzeLLM (any provider)BlocksRisk 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

The self-hosting guide has the full setup. The quickest way:

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

# Install AILANG Parse — puts `docparse` on your PATH
ailang install sunholo/ailang_parse

# Parse a contract with track changes (output lands next to it)
docparse contract.docx

2. Set Up SuperDoc

Set up the SuperDoc Document Engine from superdoc.dev. SuperDoc provides SDKs and a REST API for editing documents from code.

3. Connect via API

Parse the contract with the AILANG Parse REST API and send the blocks to your LLM for analysis. Then send the LLM's revision instructions to SuperDoc's Document Engine, which applies them.

# Parse a contract via the AILANG Parse API
curl -X POST https://docparse.ailang.sunholo.com/api/v1/parse \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "filepath=@contract.docx"

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

The output includes a Change block for every tracked change (with author, date and type), Text blocks that carry the comments, and the headings and sections around each clause.

Building a legal AI product?
AILANG Parse is also available as part of Sunholo Multivac, our AI platform with managed AILANG Parse, billing and enterprise support. Pair it with SuperDoc for legal AI in production.

Contact Sunholo →

Frequently Asked Questions

What is the AILANG Parse and SuperDoc integration?

AILANG Parse reads a Word document with its tracked changes, comments and structure. SuperDoc writes AI-suggested edits back as Word tracked changes. Together they cover both the reading and the writing in a legal AI workflow.

Can AI tools preserve track changes when editing Word documents?

Yes. In the AILANG Parse and SuperDoc workflow, AI-suggested edits are applied as Word tracked changes and do not overwrite the text. AILANG Parse reads the document with its existing tracked changes, an LLM suggests revisions, and SuperDoc's Document Engine writes them back as tracked changes. Legal reviewers see ordinary redlines in Word.

How does AILANG Parse help with contract review?

AILANG Parse returns the contract as structured blocks, including each tracked change with its author and date and each comment with the text it is attached to. An LLM can then work on specific clauses and still see where each one sits in the document.

Does SuperDoc support programmatic document editing?

Yes. SuperDoc's Document Engine can apply tracked changes, insert comments and change formatting in DOCX files from code. SuperDoc also offers a Claude MCP integration for AI document editing. See superdoc.dev for the open-source DOCX editor and the Document Engine API.