Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,409 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WriterAgent

WriterAgent logo

License: GPL v3+ Python 3.11+ LibreOffice 7.0+ Release

A LibreOffice extension that brings agentic AI to Writer, Calc, and Draw — chat in the sidebar, edit documents, run Python in spreadsheets, research the web, and check grammar.

Unlike proprietary office suites that lock you into a single cloud provider and send all your data to their servers, WriterAgent is local-first. You can run fast, private models locally (via Ollama, LM Studio, etc.) ensuring your documents never leave your machine. If you choose to use cloud APIs, you can switch between providers (e.g., OpenRouter, Together.AI) in seconds, maintaining full control over your data.

Download .oxt · Feature index · Discussions


Features

Writer

  • Sidebar chat with deep tool-calling — 9 core tools for everyday editing plus dozens of specialized sub-agents that unlock page layout, shapes, charts, bookmarks, footnotes, track changes, indexes, forms, and more. Try "Do web research and write a report on the space elevator, suitable for mathematicians (or English teachers)" — the AI will research, write, and format a complete document (the math version even uses LaTeX).
  • Format-preserving edits — Rewrite or tighten a selection and existing bold, italics, highlights, and font sizes survive intact. HTML import handles tables and nested lists. One Ctrl+Z reverts a whole AI turn.
  • Realtime grammar — Async proofreader with three backends: Harper (fast local Rust checker, auto-installs), LanguageTool (local server), or any LLM. Sentence cache, Unicode-aware splitting, and optional auto language detection so mixed-locale documents get the right checker per sentence. Details
  • Math & analytics — TeX/MathML delimiters become editable LibreOffice Math objects. SymPy helpers for symbolic math. Readability metrics, NER, and key phrases via spaCy. Math

Calc

  • =PROMPT() and =PY() — AI prompts and NumPy/pandas code in spreadsheet cells with auto spill, shared kernel, init scripts, and document-attached scripts. NumPy in LibreOffice · Data shapes
  • Trusted helper domains — Analysis (14 helpers: EDA, outliers, regression, Monte Carlo, …), Viz, Math, Quant, Optimize, and Units — via chat or Tools → Run Python Script. Domain reference · Analysis tools
  • Sheet → Python converter — Rewrite 235+ Calc formula functions as =PY() while constants, dates, and formats stay unchanged. Details
  • DuckDB SQL — Query folder files (CSV, Parquet, XLSX, ODS) and live Calc ranges from chat or scripts. Batch edits, conditional formatting, and sheet filters.

Multi-modal & intelligence

  • Private web research — Local smolagents loop with DuckDuckGo; synthesizes multiple pages and can update the open document with what it finds — e.g. "find the current price of … and update this memo." Agent search
  • Cross-document reads — Say "our budget spreadsheet" in the sidebar to read other files in the same folder; edits stay on the active doc. Optional hybrid search (BM25 + semantic vectors, RRF) via writeragent_embeddings/. Embeddings
  • LO-DOM — A recursive structural model so the agent understands headings, sections, and object relationships — not just a wall of text. Semantic tree
  • Images, OCR, voice — Generate or edit images; offline OCR via Docling; cross-platform voice recording. Images · Vision · Audio
  • Memory & locales — Persistent agent memory across sessions; 34 shipped locales with AI-driven translation pipeline. Memory · Localization

Integrations

  • MCP server — Enable in Settings → Http; endpoint http://localhost:8765/mcp for Cursor, Claude Desktop, LM Studio, or custom agents. Prefer a document_url argument on each tool call (or legacy X-Document-URL header) so clients do not edit the wrong window when several docs are open; discover targets with list_open_documents. MCP protocol
  • External agent backends — Under Settings → Agent backends, swap built-in chat for Hermes or Grok Build via ACP, with approve/reject dialogs for tool calls. Cursor plugin · LO skill

Full catalog with doc links: docs/features.md.


Install

  1. Download WriterAgent.oxt (full AI suite) or LibrePy.oxt (Python/NumPy + analysis / OCR) from Release Assets, then double-click to install.
  2. Open WriterAgent → Settings and set an OpenAI-compatible endpoint and model (e.g. http://localhost:11434 for Ollama).
  3. Open the sidebar: View → Sidebar → WriterAgent, or use Ctrl+Q / Ctrl+E for extend / edit selection.

No GPU? Try OpenRouter free models or Together.AI’s free tier.


Showcase

Hermes + Opus 4.6 (Web Research)

Hermes-Agent / Opus-4.6 Akihabara

Arch Linux Resume

Opus 4.6 Resume

Spreadsheet Dashboard

Chat Sidebar with Dashboard

Math Expressions

Math Expressions

Python in LibreOffice

Python in LibreOffice

Sonnet diagram of an Arch Linux deity

Sonnet 4.6 Visual


Docs & integrations

Feature index docs/features.md
Architecture docs/writeragent-architecture.md
MCP docs/mcp-protocol.md
NumPy / =PY() docs/enabling_numpy_in_libreoffice.md
Embeddings docs/embeddings.md
Benchmarks docs/benchmarks.md
Localization docs/localization.md
Code explorer DeepWiki
Cursor rules/skills cursor-libreoffice · libreoffice-skill

Under the hood, all AI interactions are governed by a formally verified state machine with type checking, and static analysis. Architecture · Formal verification · Test architecture

State machine architecture

Hit a rough edge? File an issue with steps to reproduce, or open a PR. A star helps too.


The Evolution of WriterAgent

A weekly chronicle of building a professional AI suite inside LibreOffice:


Contributing

Ask DeepWiki Discussions

Prerequisites: Python 3.11–3.13 for dev (pinned to 3.13 in .python-version), uv, and LibreOffice with unopkg. Run make check-setup to verify. On macOS: make, gettext, and LibreOffice via Homebrew or /Applications.

git clone https://github.com/KeithCu/writeragent.git
cd writeragent
uv python install 3.13
uv sync
make deploy          # or: make deploy writer
make test
make help

If uv sync fails on Python 3.14 / spaCy wheels: rm -rf .venv && uv sync --python 3.13. Contributor orientation: AGENTS.md.


Credits

Project Contribution
LibreCalc AI Assistant Calc AI foundation and inspiration
LibreOffice MCP Extension MCP server patterns, Makefile, tool registry
Hermes Agent Tool-call parsers, JSON repair, memory patterns
latex2mathml LaTeX → MathML

License

GNU GPL v3 (or later) — see LICENSE. Originally MPL 2.0; relicensed in 2026 for stronger reciprocity and library compatibility.

Year Contribution Contributor
2024 Original release John Balis
2025–2026 Config, registries, build system quazardous
2026 Calc integration (originally MIT) LibreCalc AI Assistant
2026 Modifications and relicensing KeithCu

About

A LibreOffice extension that adds agentic AI and NumPy features.

Resources

Stars

98 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages