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
You can comment on the whole document or select text and click the "add inline comment" button in the toolbar:
You can also ask AI Editor to review the document and add comments:
To address the AI Editor you can use "@ai-editor":
- 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
- TanStack Start — full-stack React framework
- Tiptap — rich text editor
- Yjs + Hocuspocus — real-time collaboration
- TanStack Query — data fetching
- Vercel AI SDK — AI streaming and tool use
- PostgreSQL — document and comment storage
- Tailwind CSS + shadcn/ui — styling
- Node.js 18+
- A PostgreSQL database
- An Anthropic API key
- Clone the repo and install dependencies:
git clone https://github.com/your-username/ai-editor.git
cd ai-editor
npm install- Create a .env file and fill in your values:
Required environment variables:
DATABASE_URL=postgresql://...
ANTHROPIC_API_KEY=sk-ant-...
- Start the development server:
npm run devThe app will be available at http://localhost:3000.
npm run build
npm run start


