Today, Paper Office was released, a suite of Python packages that enables AI agents to manipulate Word, PowerPoint, and Excel files with greater reliability, accuracy, and a wider range of functionality. These packages are built upon the proven open-source libraries python-docx, python-pptx, and OpenPyxl.
In tests across five models and 61 tasks, the Paper packages (including instructions) achieved a success rate of 92.5%. In comparison, standard packages without specialized capabilities sat at 80.7%, and Anthropic models with comparable Office capabilities were at 69.5%. A decisive advantage is seen in code generation: agents only needed to write code in 1.6% of cases to edit the internal structures of the Office files directly, whereas without the Paper packages, this was the case in 78.7% (and 50.5% with Anthropic capabilities). This underscores that fundamental software, alongside prompts and tools, is a critical lever for optimizing results.
The development targets the field of “Brownfield Knowledge Work.” Thus far, agents have only made slow progress into the daily work of consultants, lawyers, bankers, and operators, as they often cannot work on existing documents with the same precision as humans. The resulting files often end up in an “Uncanny Valley” – they look correct, but are not suitable for professional use with clients.
Since Office files (DOCX, PPTX, XLSX) are based on the Office Open XML (OOXML) standard, they are ZIP archives containing linked XML files, images, and resources, rather than simple text files. Every small change requires consistency across multiple parts. While existing Python libraries are mature, they have seen little update in years and lack the necessary breadth of functionality and accuracy for many important workflows. Models often resort to using JavaScript packages or HTML conversions, which can lead to information loss and can damage existing documents.
Paper Office uses the familiar imports of the original libraries (such as import docx or from pptx import Presentation), but extends them under the hood. These extensions make hidden structures accessible as typed, machine-readable data, validate targets before editing, provide package-preserving save paths, and reject actions that cannot be performed safely.
One specialized package is Paper DOCX, which extends python-docx. It enables agents to, among other things:
- Perform document-wide text searches across “run” fragmentation, providing a span for replacements or comments.
- Restart numbering.
- Native Word changes (redlines), outputting text and table changes as actual Word revisions.
- Manage comments and their resolution.
- Use content controls with typed values.
- Create bookmarks and fields (such as page numbers or tables of contents).
- Merge documents while considering formatting, styles, and media.
- Package diffs and safe saving to ensure that semantically unchanged parts of the file (bytes) are preserved.
- Check document protection modes.
Today, a new Python package was released that allows for better manipulation of Word, Excel, and PowerPoint files using AI agents. The benchmarks are certainly promising, but if you ask me, you should still test it locally to see if it actually passes a real-world test.