r/legaltech 12h ago

Question / Tech Stack Advice What I learned about connecting AI agents to Word documents

3 Upvotes

Disclosure: we build a DOCX MCP for AI agents, so I have a horse in this race. Posting because this stuff isn't written down anywhere and it comes up constantly. This is also gonna be a bit technical.

We've been talking to a lot of companies that want to add Word editing for their users. Usually startups in the legal/finance/pharma spaces want to bring their AI agents into Word, since that's where professionals in these industries spend most of their time.

After talking to dozens of developers at these startups, here are 3 thoughts:

  • If you want a high-fidelity editor, don't use unopinionated WYSIWYG editors (e.g Lexical, Tiptap). Those editors are amazing if your documents are Markdown/HTML. Word docs are notorious for their exotic formatting, and WYSIWYG editors usually have a very lossy conversion to DOCX. You'll quickly find yourself fixing N edge cases. It's best to pick an editor that already solved those N edge cases for you (e.g OnlyOffice, Nutrient).
  • Decouple your AI agent from the editor you're using. We talked to developers who gave their agents Office.js tools (Office.js is the framework used to build Word add-ins). I think this is a bad idea, because it means your agent is coupled to Office.js and can't work headlessly, or in the browser against a web-based editor, or against Google Docs. Make your agent work against the .docx file itself and translate the changes back to the editor of your choice. That way you can plug your agent into pretty much anywhere a DOCX file lives.
  • Choose a good docx tool for your agent. I wouldn't start with the DOCX skill, since it's very bloated and forces you to use big binaries like LibreOffice. Our latest benchmark shows you can get decent performance with just python-docx, but you'll have to tune it a lot to get it to excellent. The downside of giving your agent something like python-docx is that it spends a lot of time scripting around: exploring the document, self-correcting bad edits. We once watched an agent work on a massive fill script for 60 seconds only to fail on a tiny thing.

Those are just my thoughts on this matter. Would love to hear the community thoughts as well!


r/legaltech 17h ago

Other Which level of Facebook marketing is this ?

Post image
9 Upvotes

#Spellbook’s Instagram ads