docs/docs/en/ai-builder/data-modeling.md
:::tip Prerequisites
Before reading this page, make sure you have installed the NocoBase CLI and completed initialization as described in AI Builder Quick Start.
:::
The Data Modeling Skill enables creating and managing NocoBase data tables through natural language — creating tables, adding fields, setting up relationships, and more.
Before use, make sure the target data source has been configured in "Data Source Management."
Please create a file table for managing contracts
The Skill will guide the AI to analyze the fields needed for the data table and their corresponding NocoBase field types, then create a file-type data table and add the appropriate fields in the system.
Please add a status field to the users table to indicate whether the user is active, with three statuses: Active, Leaving, and Left
The Skill will guide the AI to retrieve the users table metadata and determine that an employment status field corresponds to a "Dropdown (single select)" field type in NocoBase, then add the field to the users table and configure the enum values.
I'm building a CRM, please help me design and build the data model
The Skill will create data tables, add fields, and configure relationships in the system based on the data model designed by the AI.
I'd like to add an order management data model to the existing CRM system
The Skill will guide the AI to retrieve the current system's data model and design the new feature's data modeling based on it, then automatically create data tables, add fields, and configure relationships.
Are system fields created automatically when creating a table?
Yes. System fields like id, createdAt, createdBy, updatedAt, and updatedBy are automatically generated by the server and do not need to be specified manually.
How do I fix an incorrectly configured relationship?
It's recommended to first check the current relationship field's foreign key and inverse field, then decide whether to modify or delete and recreate it. The Skill will read back and verify the relationship status on both ends after any changes.
How do I create a data table based on a plugin-extended table type?
The corresponding plugin must be enabled. If it's not enabled, the AI will typically attempt to enable the plugin. If the AI doesn't succeed, please enable the plugin manually.
How do I add a field based on a plugin-extended field type?
Same as above.