Skip to content

Repository files navigation

AI Editor

A collaborative text editor powered by an LLM. Write documents together with other users and with the LLM as an AI co-author — getting inline suggestions, edits, and review comments in real time.

Live demo: ai-editor-eight-kappa.vercel.app

Editor overview

You can comment on the whole document or select text and click the "add inline comment" button in the toolbar:

Inline comment

You can also ask AI Editor to review the document and add comments:

AI review

To address the AI Editor you can use "@ai-editor":

AI command

Features

  • Real-time collaboration — multiple users can edit the same document simultaneously (powered by Yjs + Hocuspocus)
  • AI co-authorship — the LLM participates as an author, responding to comments directed at it and making edits when given actionable feedback
  • Inline comments — highlight text and leave comments (Google Docs style); the LLM can reply and act on them
  • AI review — manually request a review from the LLM, or let it review changes as they come in
  • Highlight actions — select text to trigger LLM actions like translation, coherence improvements, or reorganization
  • Document instructions — give the LLM context and editorial guidelines per document
  • Multiple documents — create and switch between documents with a flat file structure

Tech stack

Running locally

Prerequisites

Setup

  1. Clone the repo and install dependencies:
git clone https://github.com/your-username/ai-editor.git
cd ai-editor
npm install
  1. Create a .env file and fill in your values:

Required environment variables:

DATABASE_URL=postgresql://...
ANTHROPIC_API_KEY=sk-ant-...
  1. Start the development server:
npm run dev

The app will be available at http://localhost:3000.

Building for production

npm run build
npm run start

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages