Document Authoring AI
Document Authoring AI is a package for adding AI editing to the live editor. You bring your own model, your own server, and your own UI. The package gives you the document tools the model can call, the prompt guidance and validation that keep generated output safe, and one-shot workflows for tasks like proofreading and translation.
Use it when you want to:
- Add an assistant that reads a document and edits it on request.
- Run focused document tasks like proofreading or translation.
- Let users review and approve AI-generated edits inside the editor.
It plugs into the AI stack you’re already using, with adapters for Vercel AI SDK(opens in a new tab) and LangChain(opens in a new tab).
Choose the path that matches your use case.
Agentic tools or workflows
Use agentic tools when your product needs to support open-ended editing conversations. Prompts like “find the launch summary and shorten it,” “make the risk level bold,” or “add a table with the next three milestones” all live here. The model picks a tool, the editor runs it, the result goes back into the loop, and the conversation continues.
Use workflows when your app already knows what the task is. Proofreading, translation, or running the document against your house style guide are all jobs that don’t need a conversation, just one structured request and one batch of edits to apply.
The two paths share the same browser-side execution model and the same review policy, so it’s fine to ship both in the same app. If you’re picking one to start with, a workflow has fewer moving parts and ships faster than the agentic path.
How execution works
Whichever path you pick, the split is the same. Your server talks to the model, and your browser talks to the document.
You call the model on the server, where the package gives you tool definitions for agentic tools and a structured-output schema for workflows — both framework-neutral, with thin adapters for the SDKs you’re likely using.
In the browser, the package validates what the model produced and then applies it according to the current editor mode and your app’s policy. In Edit mode, the writes go straight into the document. In Review mode, they land as tracked changes for the user to accept or reject. In View mode, they’re blocked. The model produces operations; the browser decides what to do with them.
Pick the right guide
Pick the guide that matches your use case.
| Use case | Guide |
|---|---|
| Chat assistant that reads and edits on request | Agentic tools |
| Fixed task like proofreading or translation | Workflows |
| Connect to an AI framework | Vercel AI SDK or LangChain |
| Control Document Authoring editor modes (Edit, Review, View) | Review and approval |
Next steps
- Quick start — Build the minimal working integration by installing the package, exposing tools on the server, and running the first tool call against the live editor.
- Agentic tools — Assistants that read and edit on request.
- Workflows — Proofreading, translation, and other one-shot tasks.
- Vercel AI SDK integration or LangChain integration — Connect Document Authoring AI to your AI framework.
- Review and approval — How Document Authoring’s Edit, Review, and View modes affect AI-generated writes.