This is a Next.js project demonstrating the Tiptap AI Toolkit capabilities with a list of demos:
- AI Agent Chatbot (
/ai-agent-chatbot
) - A simple AI agent that can read and edit Tiptap documents - Review Changes (
/review-changes
) - Preview and approve AI-inserted changes using suggestions - Review Changes as Summary (
/review-changes-as-summary
) - Preview and approve AI-inserted changes using suggestions as a summary
- React + Next.js
- AI SDK by Vercel
- OpenAI models
- Tiptap AI Toolkit
-
Configure .npmrc file Follow the official guide for installing Tiptap Pro extensions.
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.local
file in the root directory and add your API keys:OPENAI_API_KEY=your-api-key-here # Upstash Redis for rate limiting (optional but recommended) UPSTASH_REDIS_REST_URL=your_upstash_redis_rest_url_here UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_rest_token_here
-
Run the development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3000
- Chat with an AI that can read and edit Tiptap documents
- Uses the Vercel AI SDK for streaming responses
- Integrates with Tiptap AI Toolkit for document manipulation
- Preview AI-generated changes before applying them
- Accept or reject changes individually or in bulk
- Custom styling for suggestions (red for deletions, green for insertions)
- Halt conversation until user reviews changes
- Visit the home page to choose between the two demos
- In either demo, you can ask the AI to improve the document
- In the Review Changes demo, you'll see suggestions highlighted and can accept/reject them
- The AI will respond and make changes based on your requests