AI Toolkit
The AI Toolkit is a set of tools that enables your AI to work with Tiptap documents.
Use it to build AI agents with document-editing superpowers. Or add custom AI functionality to the Tiptap editor with its flexible primitives.
Try the AI Toolkit in action with this interactive demo featuring an AI agent that can read, edit, and manipulate documents.
Core Capabilities
The AI Toolkit provides two complementary approaches to building AI features: AI Agent Tools for automated workflows where your LLM makes decisions, and Primitives for custom implementations where you control the logic.
AI Agent Tools
Pre-built tool definitions that your AI agent can call to interact with documents. These work with popular frameworks like Vercel AI SDK, LangChain, OpenAI, and Anthropic. When your LLM decides to edit a document, these tools handle the execution.
Execute Tool (AI Agents)
More →Lets your AI agent read, insert, and patch document content through tool calls. Includes built-in tools for all document operations.
Tool Definitions
All tools →Framework-specific tool definitions for Vercel AI SDK, LangChain, OpenAI, Anthropic, and Mastra. Just pass them to your agent.
Primitives
Low-level methods for building custom AI features. Use these when you need fine-grained control over how AI interacts with documents, or when building features beyond standard agent workflows.
Read the Document
More →Extract document content in AI-friendly formats with chunking and selection support.
Edit the Document
More →Insert, replace, or patch content with streaming and automatic position management.
Schema Awareness
More →Help AI models generate valid content based on your custom nodes and marks.
Display Suggestions
More →Show AI changes as suggestions users can accept or reject.
Compare Documents
More →Generate real-time diffs between document versions.
Diff Utility
More →Calculate differences between documents with granular control over comparison logic.
Add AI Toolkit to your subscription
Integrate the AI Toolkit by purchasing the paid subscription add-on. We can guide your integration with dedicated engineering support via Slack.
Trusted by Axios, PostHog, Beehiiv, GitLab and more.
Guides and Examples
The AI Toolkit provides flexible building blocks rather than prescribing a single approach to implementation. Start by envisioning the feature you want to create, then use the toolkit's methods to bring it to life. These guides showcase practical examples to inspire and inform your own implementation.
Quickstart Guides
AI Agent Chatbot
Build a conversational AI that reads and edits documents through chat. Includes streaming, tool execution, and conversation management.
Review Changes
Display AI-generated edits as suggestions users can accept or reject. Implements a Google Docs-style review workflow.
Review Changes as Summary
Show a text summary of all AI changes instead of inline suggestions. Useful for bulk edits or high-level review.
Tool Streaming
Stream AI tool calls in real-time to show users what the AI is doing. Improves perceived performance and transparency.
Inline Edits
Replace selected text with AI-generated content. Perfect for rewriting, summarizing, or transforming specific sections.
Advanced Guides
Selection Awareness
Make AI operations context-aware by passing only selected content. Reduces token usage and improves relevance.
Multi-Document AI Agent
Build an agent that works across multiple documents simultaneously. Includes document switching and cross-document context.
Add Comments
Have AI insert comments and annotations into documents. Useful for feedback, suggestions, or collaborative editing.
AI Engineering Guide
Best practices for prompting, error handling, and performance optimization when building AI document features.
Proofreader
Example implementation showing how to build features that analyze and suggest improvements throughout documents.
Style Suggestions
Implement AI-powered writing style suggestions. Helps users improve clarity, tone, and consistency.