Introduction

Add AI writing tools to your Tiptap editor. You review every change, and your editor, documents, and server stay yours.

emend is in beta

@emend/ai is available on npm. APIs and components may still change between preview releases. Test it thoroughly before relying on it in production.

emend is an open-source, MIT-licensed AI editing layer for rich text editors built with Tiptap. It combines a provider-neutral runtime with editable AI components that you install through the Shadcn registry CLI. AI changes stay out of your document until you accept them.

What emend gives you

  • Three AI surfaces, one runtime: The Bubble Menu appears next to selected text, the Composer is a prompt box under your document, and the AI Assistant is a floating chat panel. All three can edit your writing or answer questions.
  • Changes you review first: When AI edits your text, you see the change before it lands and choose to accept or reject it.
  • Your own server route: The route decides the model, provider, authentication, rate limits, and logging. emend currently ships a recipe for the Vercel AI SDK, with more providers planned.
  • Two ways to start: Add one or more AI surfaces to an editor you already own, or copy a complete editor starter into your app.

Choose an integration path

Starting pointWhat you keepWhat emend adds
Existing Tiptap editorYour schema, extensions, toolbar, and persistenceOne or more AI surfaces and the review runtime
emend editor starterFull ownership of the copied component sourceA complete editor with your choice of AI experience

Both paths are written for Next.js for now. Support for other React frameworks is coming soon.

How emend is distributed

PartDistributionPurpose
@emend/ainpm package previewProtocol, controller, transports, React, Tiptap, and server APIs
UI componentsShadcn registryBubble Menu, Composer, AI Assistant, and editor starters
Server recipeShadcn registryConsumer-owned Vercel AI Gateway route

How emend works

The editing flow

  1. Select text and pick an action or write your own instruction to edit it. Or select nothing and type a question to chat with the AI.
  2. emend sends the relevant part of your document to your server route, which calls the model.
  3. For an edit, the proposed change appears as a preview in your document. For a question, the answer appears in the AI surface.
  4. Accept applies the change as a single step you can undo. Reject leaves the document as it was.

What stays yours

The editor, copied component source, server route, provider credentials, authentication, persistence, and deployment remain inside your application. emend does not replace your product's permissions, content model, or backend.

On this page