Skip to main content
One of the most common uses for a .docx agent is live editing: working alongside a user in the document they already have open. The user asks for a change, and the agent’s edits appear in their editor while the agent is still writing them. The editor can be Microsoft Word through Office.js, ONLYOFFICE, or any client that can load a DOCX.

How it works

Live-editing integrations share one architecture. The client sends the user’s message and the current document to your API, which runs the agent with the Vespper tools. As the model writes an edit_document call, your API parses its JSON arguments and handles each old/new pair as soon as it’s complete, without waiting for the whole call. What happens to each pair depends on the mode.

Direct mode

The agent changes the document directly. Each pair is applied right away, and the updated document goes to the client. Edits are recorded as tracked changes or applied as plain edits, depending on the trackChanges setting.

Suggestion mode

Each pair is proposed without changing the document and goes to the client as a suggestion. The user reviews it, edits it if needed, then applies or discards it. See Suggestions.

Cookbooks

Word add-in

Stream tracked edits from an AI agent into the document open in Microsoft Word.

ONLYOFFICE add-in

Review an agent’s edits as suggestion cards in ONLYOFFICE Docs, then apply them.