8000 GitHub - kauttoj/WordLLMs: WordLLMs a Word add-in which integrates the AI&Agent into Microsoft Word · GitHub
[go: up one dir, main page]

Skip to content

About

WordLLMs a Word add-in which integrates the AI&Agent into Microsoft Word

Resources

Stars

10 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

277 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

WordLLMs

AI Agents and Multi-Agent collaboration inside Microsoft Word
license release stars
Features • Getting Started • Installation • Usage

Starting from Word GPT Plus, WordLLMs is a complete overhaul with a Python backend, multi-agent orchestration, revised tools, file attachments, GUI enhancements and support for all major Large Language Model (LLM) providers including local models.

WordLLMs is self-hosted, running locally on your machine storing all data on your device. No data is shared or stored elsewhere, except in two situations:

  • LLM API calls: You must choose some providers for LLMs, which can include official OpenAI, Anthropic, Google endpoints, or their Azure counterparts. You can also use a local, self-hosted models.

  • Web search: If you enable web search tool, LLM sends web queries to Tavily service (https://app.tavily.com). You can disable web search tool completely.

If you use a self-hosted LLM running LMstudio or Ollama, you can run the WordLLMs fully offline.

Introduction

WordLLMs brings the full power of modern LLMs directly into Microsoft Word. It's a free alternative to MS Copilot. Chat with any model, let an autonomous agent read and edit your document, or have multiple AI experts collaborate on a task — all without leaving Word.

The application is powered by a Python/FastAPI backend using LangChain and LangGraph for agent orchestration, with a Vue 3 frontend that communicates via Server-Sent Events for real-time streaming.

Image

Features

8 AI Providers, All Latest Models (updated regularly)

Provider Example Models Notes
OpenAI GPT-5.4, GPT-5.4 mini, GPT-5.2, GPT-5.1, GPT-5 Mini/Nano, GPT-4.1 Compatible with DeepSeek and other OpenAI-compatible APIs via custom base URL
Anthropic Claude Opus 4.6/4.5, Claude Sonnet 4.6/4.5, Claude Haiku 4.5
Google Gemini Gemini 3.1 Pro, Gemini 3 Pro/Flash, Gemini 2.5 Pro/Flash
Azure OpenAI Custom deployment names Full Azure integration with configurable API versions
Groq Llama 3.3/4, Qwen3.5, Kimi-K2, GPT-OSS etc. Ultra-fast inference
Ollama Any locally loaded model Local deployment, fully private
Together AI Large selection of state-of-art open models
LM Studio Any locally loaded model Local deployment, fully private

All providers support custom model names — enter any model your endpoint serves.

Three Operating Modes

Chat Mode

Straightforward conversation with any LLM without any tools. LLM only sees what you tell it. Use it for Q&A, brainstorming, translation, or content generation.

Agent Mode

An autonomous LangGraph agent with access to 25+ tools that can read, write, search, and format your Word document. The agent plans multi-step actions, executes them, and reports results — all in a single conversation turn.

  • Reads your document or selection, then makes targeted edits
  • Multi-step reasoning with up to 100 iterations (configurable)
  • Web search and URL fetching for research tasks

Multi-Agent Mode

2-4 LLM experts collaborate on your document, each potentially from a different provider. Two collaboration strategies are available:

Parallel Mode — All experts analyze the document independently and in parallel. A synthesizer agent aggregates their feedback and makes the final edits. Best for getting diverse perspectives quickly.

Collaborative Mode — Experts engage in a multi-round (Round Robin -type) discussion (up to 10 rounds), building on each other's points. An overseer agent evaluates after each round and decides whether to continue or conclude. Best for iterative refinement of complex tasks.

Key multi-agent capabilities:

  • Mix providers freely: e.g., Expert 1 = Claude Opus, Expert 2 = GPT-5.2, Overseer = Gemini
  • Tool access control: Experts get read-only document access; only the overseer/synthesizer can write
  • Per-expert memory: In collaborative mode, each expert maintains notes across rounds

25+ Document Tools

The agent (and multi-agent) modes can manipulate your Word document through Office.js:

Reading — Get selected text, full document content, document properties, table structures, text search with context

Writing — Insert/replace/append text, create paragraphs with styles, insert tables, lists, images, page breaks, bookmarks, content controls

Formatting — Bold, italic, underline, font changes, color, highlighting, paragraph alignment/spacing/indentation, Word styles (Heading 1, etc.), clear formatting, search-and-replace

General — Web search (Tavily), URL fetching, math calculations, date/time

MCP Server Integration

Extend your agent with any MCP (Model Context Protocol) server. MCP is an open standard for connecting AI tools to external services. WordLLMs can connect to any MCP-compliant server and make its tools available to agents.

  • Connect to any MCP server by providing its startup command
  • Discovered tools are automatically available in agent and multi-agent modes
  • Enable/disable individual MCP tools per session
  • Auto-reconnects previously connected servers on backend startup
  • Example use cases: academic paper search (Mendeley), file system access, database queries, custom APIs

Quick Actions

One-click operations on selected text via customizable toolbar buttons, for example:

  • Translate — Using LLM capabilities
  • Polish — Professional writing improvement
  • Academic — Scholarly writing enhancement
  • Summarize — Concise summaries
  • Grammar — Proofread and correct
  • 3 custom slots — Define your own actions with custom system/user prompts
  • Custom role — Define custom instructions to steer LLMs (added to system prompt)

Conversation Management

  • Persistent history stored in SQLite (configurable database path)
  • Edit past messages, retry from any turn, fork conversations into branches
  • File attachments — Upload text files or images into the conversation
  • Cross-mode continuity: switch between chat, agent, and multi-agent modes within the same conversation thread

Customization

  • System prompt presets — Save and switch between multiple system prompts (steer responses)
  • Per-provider settings — Temperature, max tokens, custom base URLs, API versions
  • Custom models — Add any model name for any provider
  • Agent iteration limit — 1 to 500 steps (default 100)
  • Configurable timeouts — 5 to 900 seconds per LLM call (default 90s)

Getting Started

Requirements

Software

  • Microsoft Word 2016/2019 (retail version), Word 2021, or Microsoft 365
  • Edge WebView2 Runtime
  • Python 3.10+ (for the backend)
  • Node.js 20+ (only for building from source)

Note: Works only with .docx files (not compatible with older .doc format)

API Access

You need an API key from at least one provider:

Installation

WordLLMs is essentially a "mini" website inside Word; Word only presents it. As a result, you need to serve the WordLLMs application outside Word. Choose the method that best suits your needs below. An easier, executable version (Method 3) might be added later.

Method 1: Docker Deployment (Recommended)

  1. Install Docker desktop https://www.docker.com/products/docker-desktop

  2. Choose a folder on your PC where WordLLMs will store your conversation history. For example: C:\Users\YourName\WordLLMs

    Create the folder first if it doesn't exist.

  3. Pull and run the Docker image. Open Command Prompt and at the FIRST time, run:


docker pull kauttoj/wordllms
docker run -d --name wordllms -p 3000:8000 -v "C:\Users\YourName\WordLLMs:/app/data" kauttoj/wordllms

Replace C:\Users\YourName\WordLLMs with the folder you chose in step 1. Keep the :/app/data part exactly as shown — that is the path inside the container and must not be changed.

Note: Your conversation history is stored in a file on your PC. The -v flag is how Docker links your chosen Windows folder to the app running inside the container. Without it, all conversations are permanently lost every time the container stops. The app's file browser can only access folders that were linked this way at startup — you cannot change the folder later from inside the app.

Now, the app should be running in the background. You should see this in the Docker:

Image

Later, when you restart your app, click run in Docker

Image

or run this command in console:


docker start wordllms

which restarts the old container without creating a new one. You can learn more at https://www.docker.com/blog/getting-started-with-docker-desktop

How to update new version? First stop (if not stopped) and remove the container from Docker (delete button) or with console:


docker stop wordllms
docker rm wordllms

Then repeat those same two pull and run commands as above.

Your conversation history and MCP server configs are stored in the folder you chose in step 1 and will be automatically reloaded by the new container. In the rare case that a new version introduces a breaking change incompatible with your existing data, the app will move your old files to an archive_<timestamp> subfolder in that same directory and start fresh automatically.

  1. Open WordLLMs in Word, go to Settings and set History Database Path to:

/app/data/conversations.db

or any other filename you prefer. Click the folder icon to browse existing .db files, or type the path directly. This path always uses the /app/data form regardless of what Windows folder you chose — Docker translates it automatically.

  1. Download manifest.xml.
  2. [Optional: Edit manifest.xml if you changed the host port in the docker run command (e.g., if you used -p 8080:8000, replace localhost:3000 with localhost:8080).]
  3. Proceed to the Add-in Installation Guide.

All processing happens in the container, it's the "brains" of the app. You need to run the Docker image (or Python app) each time you use WordLLMs. You either do this via terminal OR Docker desktop client.

Method 2: Build from Source

Requires Node.js 20+ and Python 3.10+

  1. Clone and install dependencies:
git clone [https://github.com/kauttoj/WordLLMs.git](https://github.com/kauttoj/WordLLMs.git)
cd WordLLMs
yarn install
pip install -r requirements.txt
  1. Build the frontend:
yarn build
  1. Start the backend (serves both the API and built frontend static files):
uvicorn src.backend.main:app --host 0.0.0.0 --port 3000
  1. Download manifest.xml and update the URLs to match your server address.
  2. Proceed to the Add-in Installation Guide.

Add-in Installation Guide

You will need to sideload the add-in into Microsoft Word.

Full instructions from Microsoft: Sideload Office Add-ins

  1. Go to the folder where you saved the manifest.xml file, for example C:\Users\username\Documents\WordLLMs.

  2. Open the context menu for the folder (right-click the folder) and select Properties.

  3. Within the Properties dialog box, select the Sharing tab, and then select Share.

  4. Within the Network access dialog box, add yourself and any other users you want to share, choose the Share button. When you see confirmation that your folder is shared, note the full network path displayed immediately following the folder name.

  5. Open a new document in Word, choose the File tab, and then choose Options.

  6. Choose Trust Center, and then choose the Trust Center Settings button.

  7. Choose Trusted Add-in Catalogs.

  8. In the Catalog Url box, enter the full network path and then choose Add Catalog.

  9. Select the Show in Menu check box, and then choose OK.

  10. Close and then restart Word.

  11. For older Word: Click Insert > My Add-ins > Shared Folder, choose WordLLMs, and then choose Add. For current Word: Click Home > Add-ins > Advanced at bottom > click WordLLMs. See images.

  12. Enjoy!

Usage

For a full user-friendly tutorial covering all features, see the Usage Instructions.

Getting Started

After opening WordLLMs, click the Settings button on the homepage to configure your preferred AI providers and API keys.

Chat Mode

Type your message and press Enter. Responses stream in real time. Use the quick action buttons for common tasks like translation or polishing.

Agent Mode

Switch to Agent mode and give the AI instructions that involve your document:

  • "Read the entire document and create a summary at the beginning"
  • "Format all section headings as Heading 2 and make them blue"
  • "Search the web for recent statistics on X and insert them after paragraph 3"
  • "Create a table comparing the three approaches mentioned in the document"

The agent will plan its steps, use the appropriate tools, and report back. You can watch tool calls and results in real time.

Multi-Agent Mode

Switch to Multi-Agent mode and configure:

  1. Number of experts (2-4)
  2. Strategy: Parallel or Collaborative
  3. Model per expert: Pick a different provider/model for each expert
  4. Max rounds (collaborative mode): 1-10

Then give your task. Examples:

  • "Review this document for logical consistency, grammar, and tone" (parallel — each expert focuses on a different aspect)
  • "Debate the pros and cons of the approach described in this document" (collaborative — experts discuss across rounds)
  • "Rewrite the introduction to be more engaging" (parallel — get multiple rewrites, synthesizer picks the best)

Quick Actions

Click the toolbar buttons for instant operations on selected text. The first 5 slots come pre-configured (Translate, Polish, Academic, Summarize, Grammar). The remaining 3 slots are fully customizable with your own system and user prompts.

Custom Models

For each AI provider:

  1. Go to Settings > select your provider
  2. Enter a custom model name and click Add
  3. The model appears in the model dropdown

Configuration Tips

  • Temperature: Lower (0.3-0.5) for factual tasks, higher (0.7-1.0) for creative tasks (only for non-reasoning, legacy LLMs)
  • Max Tokens: Increase for longer responses, decrease for concise answers
  • Custom Base URL: Use for OpenAI-compatible services (DeepSeek, local proxies, etc.)
  • Agent Max Iterations: Increase for complex multi-step tasks

Using MCP Servers

WordLLMs supports the Model Context Protocol (MCP) — an open standard that lets you connect external tools and data sources to your AI agents. Any MCP-compliant server works out of the box.

How It Works

The Python backend acts as an MCP client. When you add a server, the backend spawns it as a subprocess (via stdio transport), discovers its tools, and makes them available to agents as regular server-side tools. The browser never communicates with MCP servers directly — everything goes through the backend.

Adding an MCP Server

  1. Go to Settings > MCP tab
  2. Fill in the server details:
  • Server name: A friendly name (e.g., "Mendeley")
  • Command: The executable to run (e.g., python, npx, node)
  • Arguments: Command-line arguments, space-separated (e.g., -m mendeley_mcp)
  • Environment variables: Any required env vars as KEY=VALUE, comma-separated
  1. Click Add Server
  2. Click Connect — the backend will start the server and discover its tools
  3. Discovered tools appear with checkboxes — all enabled by default
  4. Toggle individual tools on/off as needed

Example: Mendeley Academic Papers

Mendeley MCP gives your agent access to your Mendeley library and the Mendeley catalog of 100M+ academic papers.

Setup:

  1. Install the Mendeley MCP server:
pip install mendeley-mcp
  1. Get your Mendeley API credentials:
  1. In WordLLMs, go to Settings > MCP tab and add:
  • Server name: Mendeley
  • Command: python
  • Arguments: -m mendeley_mcp
  • Environment variables: < 8BD0 code>MENDELEY_CLIENT_ID=your_id, MENDELEY_CLIENT_SECRET=your_secret
  1. Click Add Server, then Connect

Available tools after connecting:

Tool Description
mendeley_search_library Search your personal Mendeley library
mendeley_get_document Get full details of a document
mendeley_list_documents Browse documents with folder filtering
mendeley_list_folders Navigate your collections
mendeley_search_catalog Search 100M+ papers in Mendeley's catalog
mendeley_get_by_doi Find a paper by DOI
mendeley_add_document Add a paper to your library

Example agent prompts:

  • "Search Mendeley for recent papers on transformer architectures and insert a summary table into my document"
  • "Find papers by Smith et al. on climate change and add their citations to the references section"
  • "Look up DOI 10.1234/example and insert the abstract after paragraph 2"

Finding More MCP Servers

MCP is an open ecosystem. You can find servers for various services:

  • MCP Server Registry — Official list of MCP servers
  • Any MCP-compliant server that supports stdio transport will work with WordLLMs

Troubleshooting MCP

  • Connection fails: Make sure the server command is installed and accessible from your terminal. Try running the command manually first.
  • No tools discovered: The server may require authentication or configuration via environment variables. Check the server's documentation.
  • Tool execution errors: Errors from MCP tools are shown directly in the agent's response. Check the backend console for detailed logs (lines prefixed with [MCP]).
  • Server disconnects: If a server process dies, the next tool call will fail with an error. Click Connect again in Settings to restart it.

Architecture

graph TD
    subgraph Word["Microsoft Word (Office.js)"]
        FE["Vue 3 Frontend (TypeScript)\nChat · Agent · Multi-Agent UI\n25+ Word tools via Office.js\nSSE streaming client"]
    end

    FE -- "SSE (Server-Sent Events)" --> Agents

    subgraph Backend["Python Backend (FastAPI)"]
        Agents["LangGraph Agents\nSingle Agent · Multi-Agent parallel/collab"]
        Providers["LangChain Providers\nOpenAI · Anthropic · Gemini · Azure\nGroq · Ollama · LM Studio"]
        Tools["Server Tools\nWeb search · URL fetch · Math · Date"]
        MCP["MCP Client Manager\nConnects to external MCP servers\nDynamic tool discovery"]
        DB["SQLite Conversation Store\nUnified history across all modes"]
        Agents --> Providers
        Agents --> Tools
        Agents --> MCP
        Agents --> DB
    end

    MCP -- "stdio" --> MCPServers["MCP Servers\nMendeley · Filesystem · Custom"]

Loading

Privacy & Security

  • Local storage: API keys are stored in browser localStorage within the Word add-in sandbox. They are never sent to any server other than the AI provider you configured.
  • Direct connection: The backend communicates directly with AI providers. There are no intermediary servers.
  • Local models: Ollama and LM Studio run entirely on your machine — your data never leaves your network.
  • Conversation history: Stored in a local SQLite database at a path you control.

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request.

Acknowledgements

WordLLMs started from Word GPT Plus by Kuingsmile. Thanks for the original project that provided the foundation for this work.

License

MIT License

Show your support

Give a star if you find this app useful.

About

WordLLMs a Word add-in which integrates the AI&Agent into Microsoft Word

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0