Extending the assistant
This page is for developers who want Exponential Intelligence to do something specific for their site. Everything is added from your own extension, by settings and small classes; the assistant itself stays unchanged. The task guide with code is Extending Exponential Intelligence; this page is the overview.
Contents
What you can add
| Addition | How | Example |
|---|---|---|
| A field action | Settings only: [EditViewSettings] FieldActions[] and a [FieldAction_<id>] group with label, datatypes, input and instruction | A "Headline" button on text line fields |
| A tool the model can call | A class extending expAiTool, listed in [ToolSettings] Tools[] | Counting children of a node |
| A read service as a tool | 'ai' => true in an expservices declaration, no class | Service tools |
| A provider | A [Provider_<id>] group for an OpenAI- or Anthropic-compatible server, or a class implementing expAiProvider | A company's own model gateway |
| Panel and edit form sections | Templates your extension adds to expai's lists | A section with house-style hints |
| JavaScript hooks | Script files in your design's backend script list, without inline scripts | Reacting when a draft is written |
Rules every addition keeps
From the expai extension documentation:
- Read and write through the context's reader and writer, which run as the current user with the kernel's checks.
- A writing tool records its drafts and never publishes.
- Errors the model should hear are thrown as the assistant's own exception type, so the model can correct its call.
- New tools are offered in new conversations.
- Admin templates and scripts keep the admin rules: no inline scripts or styles, so the Content Security Policy holds.
Choosing the smallest addition
- Can a field action by settings do it? Then no code is needed.
- Does a read service already return what the model needs? Opt it in.
- Only then write a tool class.
- Only for an incompatible API write a provider class; compatible servers need settings only.
The smaller the addition, the less there is to review, and the fewer ways a model can misuse it.
Checking your additions
expai declares its registries for the RAD tools: Setup > RAD > Extension point survey counts your providers, tools and field actions and shows any whose class, template or block is missing (RAD extension surface). Then activate the extension, regenerate the autoloads, clear the caches, and try the addition with a test editor.
Related pages
- Extending Exponential Intelligence
- Exponential Intelligence (expai) for applications
- The write gate and the probe
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.