AI Assistant
dbdiagram AI is an intelligent assistant that helps you design, modify, and optimize your database schemas through natural language conversations.
This feature is available in our Personal Pro plan
Overview​
The AI Assistant understands database design concepts and can help you with:
- DBML schema design - Create and modify tables, relationships, and database structures
- Database best practices - Suggest optimal data types, indexes, and constraints
- Diagram optimization – Automatically arrange your tables for clarity and group related tables using TableGroups with meaningful header colors
- Quick transformations - Convert between database systems (PostgreSQL, MySQL, SQL Server, etc.)
Getting Started​
Freestyle Chat​
Simply describe what you want to achieve in natural language, for example:
Create a users table with email, password, and timestampsAdd a relationship between "orders" table and "customers" tableConvert all data types to PostgreSQL format
The AI will generate DBML code and show you a preview of the changes in the diff viewer.

Quick Actions​
Quick Actions provide one-click access to common database design tasks. They appear in the AI chat panel and adapt based on your current schema state.

When starting with an empty schema, you can quickly get going with ready-made templates such as a Slack-style messaging app or a document management example.
For existing schemas, the assistant also helps you enhance your design by creating table groups, adding timestamps, detecting relationships, adding indexes, or remapping data types.
Chat Thread Management​
The AI Assistant organizes conversations into threads that are automatically saved.
- New Chat - Click the + button to start a new thread
- Chat History - Click the History icon to view all conversations
- Switch threads - Click any thread to resume that conversation
- Edit titles - Click the thread name to rename it
- Delete threads - Remove conversations you no longer need
Best Practices​
- Use conversation context: The AI remembers previous messages in each thread, so you can build iteratively.
- Ask for explanations: Request help understanding database concepts or design decisions.
- Try the learning mode: Use "Learn Database Design" quick action for interactive tutorials.
- Mix manual and AI editing: Freely combine AI-generated code with your own manual edits.
Troubleshooting​
If you encounter issues:
- Ensure your prompts are related to schema design.
- Check if you have sufficient token quota remaining for the month.
- Review changes carefully in the diff viewer before accepting.
Privacy and Data Usage​
Your conversations with the AI Assistant are:
- Used only to generate schema suggestions.
- Not shared with other users.
- Subject to our Privacy Policy.
Your database schemas and conversations are only sent to our AI service when you actively use the AI Assistant. This data is only used to produce schema suggestions and is never used to train AI models.