Define a Built-in AI Employee
A built-in AI employee is registered with its plugin. When the plugin loads for the first time, NocoBase creates the corresponding employee record and marks it as built-in. On later plugin loads, the employee's default profile, prompt, Skills, and Tools are updated from the code.
Single-file and directory forms
Use a single file when the profile is simple and does not need a separate prompt or dedicated resources:
Use a directory when you need prompt.md, dedicated Skills, or dedicated Tools:
The directory form is better suited to long-term maintenance.
Use defineAIEmployee()
In index.ts, use defineAIEmployee() from @nocobase/ai:
The main fields are:
The current type of tools is an array of objects:
autoCall only overrides the current AI employee's call permission for a CUSTOM Tool. For GENERAL and SPECIFIED Tools, runtime behavior still follows the Tool's own defaultPermission. If a CUSTOM Tool has no employee-level configuration, it also falls back to the Tool's own defaultPermission.
Tools discovered automatically in the directory are normalized to { name: 'toolName' }.
Put long prompts in prompt.md
When an AI employee uses the directory form, put its system prompt in the sibling prompt.md file:
When prompt.md exists, it overrides systemPrompt in index.ts. Long prompts are easier to review in a Markdown file and avoid escaping problems in TypeScript template strings.
Built-in AI employee example: Nathan
The employee profile in packages/plugins/@nocobase/plugin-flow-engine/src/ai/ai-employees/nathan/index.ts is short:
Nathan's full capabilities come from other resources in the same directory:
The loading process automatically completes three levels of binding:
- Files in
tools/are registered as Tools - The Tools are automatically bound to the
frontend-developerSkill - The Skill is automatically bound to Nathan
As a result, index.ts does not need to list the complete skills and tools configuration again.
Related links
- AI employee plugin development — Understand the relationship between built-in AI employees, Tools, and Skills
- Define a Skill — Create a dedicated Skill for an employee
- Complete example: Create a built-in AI employee — See the complete employee directory and registration process
- Internationalization for AI employee plugins — Learn how localization differs for employee profiles and Tool and Skill text

