Editor feature understanding and configuration awareness
CKEditor AI knows your editor. Along with AI Chat requests, the editor shares a compact snapshot of the features it has loaded and how they are configured. The AI uses this knowledge to tailor its responses to the capabilities available in your integration.
This is first and foremost a quality mechanism. Knowing both which features are available and how they are configured, the AI keeps its edits within what your editor can represent:
- It only uses the formatting your editor supports – if your setup has no tables, the AI will not produce one.
- It respects your configured values – the allowed heading levels, the exact font sizes, your color palettes, and so on.
- Its changes apply cleanly – the editor does not need to drop or alter parts of the response that it could not represent.
Feature understanding works on its own, with no configuration. To also ground the AI in your organization’s own rules and reference material – another quality lever – combine it with the Context Library.
The editor below is deliberately configured with a restricted, custom set of features: a document title plus two section heading levels, a handful of font families, sizes, and colors, and basic table and list support. The document is left intentionally rough – a plain, unstyled data table, a title that is not a title, and section headings on mixed-up levels.
Use the shortcuts displayed at the start of the conversation in the AI Chat panel. Each sends a deliberately minimal prompt, so everything the AI gets right about your setup comes from feature understanding:
- What are my heading options? – the AI answers with the exact heading levels configured here.
- Fix the headings – the mixed-up section levels get normalized to the heading structure configured in this editor.
- Style the table – the AI adds a header row and shades alternating rows using colors from the configured palette.
The snapshot is keyed by feature and contains the following information:
- Enabled editor features – which content features are loaded in the editor, so the AI can tell at a glance what the editor is able to produce.
- Feature configuration – for features whose configuration shapes the document content (like the allowed heading levels, font sizes, or color palettes), the snapshot carries their configured values.
- Custom features – features of custom plugins registered with the AI agent, together with the configuration they were registered with.
- Editor version – the version of CKEditor 5 the snapshot was taken from, so the AI knows which editor release the capabilities describe.
- Root type – whether the editing root the document belongs to is inline (like a heading-only title field) and which HTML element hosts it.
- UI details – toolbars, icons, labels, or keystrokes are stripped from the snapshot.
- Callback-based configuration – options provided as functions, like a mention feed that fetches items from your application, cannot be serialized and never leave the editor. We plan to extend what the AI understands about these features – see What’s next.
Keep in mind that data provided statically in the configuration – like a mention feed defined as a plain array – is part of the feature configuration and is sent. The live editor configuration is never modified in the process.
Registering a custom plugin with the AI agent is only needed if it adds its own content to the document (like a new HTML element or a custom widget) and has a matching custom skill. Plugins that only add UI, like toolbar buttons or panels, do not need to be registered.
When a plugin that introduces custom content is not registered, the AI agent does not know that this content is supported by the editor. As a result, the quality of the AI agent’s responses may suffer.
To register a custom plugin, use the AIEditorConfig#add() method to match it with an existing custom skill.
Learn how to write, upload, and manage custom skills in the Cloud Services documentation. To serve a different variant of a skill to each editor version, see Target an editor version.
Features are usually registered per editor instance, so a custom plugin loaded into several editors of the same context must call this method for each of them. We recommend doing this from its init() method.
For instance, for a custom skill that looks as follows (see Frontmatter fields for what name, description, and configKey mean):
---
name: myCustomFeature
description: My custom feature description.
configKey: myCustomFeature
---
## Rules
Description of the feature's content and usage, also referring to configuration keys such as `myCustomFeature.someKey`.Copy codethe custom plugin should be registered in the following way:
class MyCustomFeature extends Plugin {
init() {
// ...
if ( this.editor.plugins.has( 'AIEditorConfig' ) ) {
// The name must correspond to the "configKey" property of the custom skill to be used by the AI agent.
// Use empty object as the configuration when the feature has no practical configuration.
this.editor.plugins.get( 'AIEditorConfig' ).add( this.editor, 'myCustomFeature', {
// Configuration that may be relevant to the AI agent for producing
// or preserving the feature's content.
someKey: 'someValue'
} );
}
}
}Copy codeEditor comes with a set built-in features and corresponding skills. It is not possible to override the configuration of a core editor feature with a custom feature using this API. The name you use must be unique.
Feature understanding will grow over time. Planned improvements include:
- Dynamic data features – deeper understanding of features that pull in data from your application, like mention feeds.
- Command-driven features – features that produce content through editor commands rather than markup, like remove format.
- Comments and suggestions – working with the annotations added on top of the content: generating new comments, proposing replies in existing threads, and acting on comments and suggestions.
- Context library – ground the AI output in reusable prompts and reference files managed on the AI service.
- AI Chat – the conversational AI feature that uses the snapshot to tailor its responses.
- CKEditor AI integration – installation and configuration of the AI features.
- Using CKEditor AI programmatically – drive AI features and apply their results from code.