Embed spreadsheets and documents in your product and let AI agents edit them
Imagine a browser screen where a user changes a number in a table and the total recalculates automatically. This repository provides the tools to embed such editing capabilities into your product and allows AI agents to read and modify content in the same way. Based on an open-source core, it bundles spreadsheet and document editing, calculation, and file processing into a single structure.
Three components for web, server, and AI
Univer consists of a Web SDK, a Server SDK, and an AI SDK. The Web SDK is the foundation, including the content model, editing, rendering, formula calculation, and the Facade API used by applications. The AI SDK is a tool for connecting office features to existing agents or workflows. This repository includes the core architecture and engine implementation of the Web SDK under the Apache-2.0 license.
Composing editing features with plugins
Features are composed using plugins and presets. The quick start example creates a spreadsheet editor using only @univerjs/preset-sheets-core. It includes basic editing features such as cell styles, merging, rich text within cells, frozen panes, floating images, and undo/redo. The data and calculation area supports formulas, defined names, filters, sorting, data validation, conditional formatting, hyperlinks, comments, and find/replace. The Docs area provides rich text editing, paragraph formatting, lists, hyperlinks, comments, and shape integration.
A shared editing flow for applications and agents
The Facade API is an interface for applications to access workbooks, sheets, and ranges. In the example, a quote is created, and when application code or an agent modifies the quantity, formulas automatically recalculate to update the total. workbook.save() returns a JSON snapshot including workbook and plugin data, allowing the application to decide how to store it. You can restore this snapshot later using browser storage or another storage method. This workflow does not require a commercial license or the Server SDK.
An extension structure separating logic and UI
Content logic and UI interaction are separated into distinct plugins. Feature plugins manage rules and content changes, while UI plugins handle the interface and user interaction. The command system distinguishes between Commands that coordinate business actions, Mutations that change content stored in snapshots, and Operations that change temporary state. Edits affecting multiple features are grouped into a single undo/redo record, allowing users to revert the entire action. Dependency injection and explicit plugin dependency declarations allow you to replace external dependencies or supply test doubles, making it easy to test models and services independently.
Checking the open-source scope and commercial extensions
This repository provides the core architecture and engine implementation of the Web SDK. Commercial Web SDK plugins, the Server SDK, and commercial AI SDK extensions are distributed separately and have different licenses. Some features shown in the demo include commercial capabilities, so you must distinguish between the open-source defaults and the scope of commercial extensions. @univerjs/* packages must maintain the same version, and commercial packages must use a matching release line. It is recommended to check the API stability policy before relying on extension points. XLSX import/export uses a file conversion feature that is distributed separately.