AiVdbProviderClientBase depends on classes in the ai_search submodule

Created on 15 July 2025, about 2 months ago

Problem/Motivation

\Drupal\ai\Base\AiVdbProviderClientBase is in the AI core module, but can only be used if the ai_search submodule is also enable because it requires the following classes/interfaces:

  • Drupal\ai_search\AiVdbProviderSearchApiInterface
  • Drupal\ai_search\EmbeddingStrategyInterface
  • Drupal\ai_search\Plugin\Exception\EmbeddingStrategyException

Steps to reproduce (required for bugs, but not feature requests)

Please provide information like AI modules enabled, which AI provider, browser, etc.

Proposed resolution

We should either move this under the ai_search submodule or remove this dependencies.

Remaining tasks

Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)

πŸ› Bug report
Status

Active

Version

1.2

Component

AI Core module

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kim.pepper
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    The idea is that AiVdbProviderInterface can be implemented in some other way than AI Search yet still be relied to actually make queries/searches e.g. for agent calls or other functionality so maybe we need something like this:

    new src/Base/AiVdbProviderStandaloneClientBase.php:

    abstract class AiVdbProviderStandaloneClientBase implements AiVdbProviderInterface, ContainerFactoryPluginInterface {
       ...
    }
    

    existing src/Base/AiVdbProviderClientBase.php:

    if (interface_exists('\Drupal\ai_search\AiVdbProviderSearchApiInterface')) {
      abstract class AiVdbProviderClientBase extends AiVdbProviderStandaloneClientBase implements AiVdbProviderSearchApiInterface {
         ...
      }
    }
    
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    ... With an else on the latter in case ai search is disabled I guess

  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Why not just split out the Search API dependent code to the ai_search submodule, rather than conditional logic?

    There also seems to be some entanglement with both:

    • \Drupal\ai\AiVdbProviderInterface::querySearch() and
    • \Drupal\ai\AiVdbProviderInterface::vectorSearch()

    depending on the output of \Drupal\ai_search\AiVdbProviderSearchApiInterface::prepareFilters() in the ai_search submodule.

    Should these be moved to the ai_search submodule too?

  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    Created a MR that splits out this dependency.

Production build 0.71.5 2024