Skip to content

Resolve #3542955 "Adding Overrides"

AI Agents Overrides Implementation

What was done

  • Introduced a new config entity: AI Agent Override.

    • Works as an extension layer on top of existing AI agents (which are both config entities and plugins).
    • Designed to persist in the system, but can be enabled/disabled as needed.
  • Built a service layer to handle overrides logic and integration.

  • Added UI support for managing overrides directly from the agent edit form.

    • Disabling an override on the agent removes its effect.
  • Overrides allow “parasitic extensions” of an agent:

    • Altering the prompt used by the agent.
    • Adding or removing agent tools.
    • Adjusting settings for the agent.
  • Defined schema and configuration structure to support persistence and flexibility.

How to test

  1. Create or import an AI Agent Override config entity.

Sample generated by

id: taxonomy_design_agent_override
label: 'Taxonomy Design Agent Override'
status: true
weight: 0
parent_agent: taxonomy_agent_config
tools_add:
  - 'ai_agent:get_config_schema'
  - 'ai_agent:get_field_config'
  - 'ai_agent:list_taxonomy_term'
tools_remove:
  - 'ai_agent:modify_vocabulary'
prompt_extra_text: |
  Your taxonomy terms should be all prefixed with "design_*" for consistency.

  When working with taxonomy terms, always check existing terms first to avoid duplicates.
  Focus on creating a coherent design vocabulary that supports content organization.
prompt_mod_strategy: suffix
prompt_replace_token: ''
fail_if_parent_missing: false
tool_settings:
  'ai_agent:list_taxonomy_term':
    return_directly: false
    progress_message: 'Checking existing taxonomy terms...'
    description_override: 'List taxonomy terms with a focus on design-related vocabulary. Use this to check for existing terms before creating new ones.'
  'ai_agent:get_config_schema':
    return_directly: false
    progress_message: 'Analyzing taxonomy configuration schema...'
tool_usage_limits:
  'ai_agent:list_taxonomy_term':
    vid:
      action: 'only_allow'
      hide_property: false
      values:
        - 'tags'
        - 'categories'
        - 'design_vocabulary'
  'ai_agent:get_field_config':
    entity_type:
      action: 'force_value'
      hide_property: false
      values:
        - 'taxonomy_term'
  1. Attach it to an existing AI agent (usually by importing and checking that the box is ticked on, on the agent edit page).
  2. Verify that:
    • Prompt modifications apply.
    • Tools can be added/removed through the override.
    • Settings changes take effect.

i.e. go to admin/config/ai/agents/explore?agent_id=taxonomy_agent_config - and run a prompt:

image

  1. Disable the override from the agent’s edit form.

    • Confirm that its effects are gone.
  2. Re-enable it and confirm the override behavior is restored.

🤷

Merge request reports

Loading