Legal document review · Production

Harvey's Word Add-In enables document-wide edits on 100+ page legal documents via orchestrator-subagent architecture

The problem

Harvey's initial Word Add-In was optimized only for targeted local edits, leaving longer documents requiring complex multi-page coordinated changes unsupported. Direct OOXML manipulation by LLMs produced poor outcomes and degraded reasoning quality, while one-shot edits on long documents missed large portions due to position bias.

First attempt

Direct OOXML generation by LLMs produced invalid or schema-nonconformant XML and caused regression on legal reasoning tasks. One-shot edits on long documents suffered from position bias, missing content in the middle even with explicitly long-context models.

Workflow diagram · grounded in source
1
User submits edit query
trigger
“Users can edit 100+ page documents with a single query”
2
OOXML translated to natural language
ai_action
“We translate the OOXML to a natural language representation of the document, ask the model to propose edits over text, then deterministically translate those edits back into precise OOXML mutations that preserve styles and structure”
3
Orchestrator plans and decomposes
ai_action
“An orchestrator model reads the whole document, plans the work, and decomposes the request into targeted tasks that each operate on a bounded chunk. The orchestrator also issues global constraints to keep edits consistent across chunks, …”
4
Subagents process bounded chunks
ai_action
“Subagents receive precise, localized instructions and achieve thoroughness by only having to consider a small portion of the document”
5
Changes applied via Word API
output
“we apply changes through the Word JavaScript object model to avoid corrupting the markup”
6
Automated offline evaluation
validation
“Automated offline evaluation confirmed that there was no regression on the previous dataset, and demonstrated a clear improvement over baseline performance on queries that referred to redlines in the input document”
Reported outcome

Harvey's Word Add-In now supports editing 100+ page documents with a single query, transforming hours of manual legal editing into a single seamless interaction.

Reported metrics
Document size supported100+
Legal editing time savedtransforming hours of manual effort into a single seamless interaction
Evaluation development timecondensed years of manual work into weeks
Model combinations tested30+
Show all 6 reported metrics
document size supported100+
legal editing time savedtransforming hours of manual effort into a single seamless interaction
evaluation development timecondensed years of manual work into weeks
model combinations tested30+
sample outputs generatedtens of thousands
evaluation generation time per experimentless than five minutes
Reported stack
HarveyOffice JavaScript APIOffice Open XMLVaultMicrosoft Word
Source
https://www.harvey.ai/blog/enabling-document-wide-edits-in-harveys-word-add-in
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Harvey's Word Add-In now supports editing 100+ page documents with a single query, transforming hours of manual legal editing into a single seamless interaction.

What tools did this team use?

Harvey, Office JavaScript API, Office Open XML, Vault, Microsoft Word.

What results were reported?

Document size supported: 100+; Legal editing time saved: transforming hours of manual effort into a single seamless interaction; Evaluation development time: condensed years of manual work into weeks; Model combinations tested: 30+ (source-reported, not independently verified).

What failed first in this deployment?

Direct OOXML generation by LLMs produced invalid or schema-nonconformant XML and caused regression on legal reasoning tasks.

How is this legal document review AI workflow structured?

User submits edit query → OOXML translated to natural language → Orchestrator plans and decomposes → Subagents process bounded chunks → Changes applied via Word API → Automated offline evaluation.