Skip to content

Implement Drupal Recipe Integration for AI Functionalities Configuration #3

@robertoperuzzo

Description

@robertoperuzzo

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Currently, the ddev drupal-ai setup wizard reads the drupal_modules configuration from functionalities.yaml to determine which modules to install for each selected functionality. This approach is reductive because:

  1. Limited Configuration Scope: Installing modules alone doesn't provide a fully functional Drupal AI environment
  2. Manual Configuration Required: Users must manually configure each module after installation
  3. No Default Settings: There's no way to automatically set up sensible defaults for AI tools
  4. Inconsistent Experience: Each functionality requires different manual configuration steps that aren't documented or automated

The current approach forces users to:

  • Manually configure each AI module after installation
  • Set up content types, fields, and configurations specific to AI functionalities
  • Configure search indexes, vector storage, and other complex integrations
  • Apply security and permission settings manually

Describe your solution

Implement Drupal Recipe integration alongside the current module-based configuration system by leveraging the existing Drupal recipes ecosystem. The solution should:

1. Recipe Mapping

Utilize existing Drupal recipes or create new ones for each functionality defined in functionalities.yaml:

  • vector-search → Use/create vector search recipe with pre-configured Search API, content types, and pgvector integration
  • content-generation → Use/create content generation recipe with editorial workflows and AI content types
  • image-analysis → Use/create image analysis recipe with media handling and AI vision integration
  • qa-system → Use/create Q&A system recipe with knowledge base structure and search integration
  • code-assistant → Use/create code assistant recipe with code snippet management and syntax highlighting
  • document-processing → Use/create document processing recipe with file handling and extraction workflows

2. Enhanced Configuration Structure

Extend functionalities.yaml to include recipe references:

functionalities:
  vector-search:
    name: "Vector Search & Embeddings"
    description: "Semantic search using vector databases"
    required_addons: ["robertoperuzzo/ddev-pgvector"]
    required_capabilities: ["embeddings"]
    drupal_modules: ["ai", "ai_search", "search_api"]  # Keep existing for module installation
    drupal_recipes: ["drupal/ai-vector-search"]        # New: recipes to apply
    recipe_config_overrides:                           # New: custom config merging
      search_api:
        default_server: "pgvector_server"

3. Recipe Ecosystem Integration

  • First: Research and leverage existing recipes from the Drupal recipes ecosystem
  • Second: Create new recipes only where gaps exist in the ecosystem
  • Third: Contribute new recipes back to the community

4. Merge Configuration Logic

During ddev drupal-ai setup, combine:

  • Recipe-provided default configurations (from ecosystem recipes)
  • User-selected customizations from the CLI wizard
  • Environment-specific settings (API keys, endpoints, etc.)

5. Enhanced CLI Wizard

Extend the setup process to:

  • Install the appropriate Drupal recipe(s) based on selected functionalities
  • Apply recipe configurations as a baseline
  • Overlay user customizations on top of recipe defaults
  • Handle configuration conflicts gracefully

Describe alternatives

Alternative approaches considered:

1. Custom Configuration Profiles

Create our own configuration management system instead of using Drupal recipes

  • Pros: Full control over configuration structure
  • Cons: Reinventing the wheel, not leveraging community standards, maintenance burden

2. Enhanced Module Approach

Extend modules to include more opinionated defaults

  • Pros: Simpler implementation, no recipe dependencies
  • Cons: Still requires manual configuration, doesn't leverage Drupal's configuration management best practices

3. Recipe-Only Approach

Replace module configuration entirely with recipes

  • Pros: Cleaner architecture, full configuration management
  • Cons: May not provide granular control, dependency on recipe availability

Additional context

Implementation Strategy

1. Recipe Research Phase
  • Audit existing Drupal recipes ecosystem for AI-related recipes
  • Identify gaps where new recipes need to be created
  • Document recipe dependencies and compatibility
2. Recipe Development Phase
  • Create missing recipes for AI functionalities
  • Ensure recipes follow Drupal community best practices
  • Include comprehensive configuration for each AI use case
3. Integration Phase
  • Extend functionalities.yaml structure to include recipe references
  • Modify CLI wizard to handle recipe installation
  • Implement configuration merging logic
4. Community Contribution
  • Submit new recipes to appropriate Drupal recipe repositories
  • Document recipe usage patterns for the community

Expected Benefits

  • Faster Setup: Users get fully configured AI environments out of the box
  • Community Standards: Leverage and contribute to Drupal recipes ecosystem
  • Better Defaults: Use community-vetted configurations and best practices
  • Reduced Errors: Less manual configuration means fewer setup mistakes
  • Improved UX: Seamless transition from infrastructure setup to working AI tools
  • Ecosystem Growth: Contribute back to Drupal AI recipe ecosystem

Related Files to Modify

  • drupal-ai/configs/functionalities.yaml - Add recipe references
  • commands/web/drupal-ai - Enhance setup wizard with recipe installation
  • README.md - Update documentation to reflect recipe integration
  • Template files in drupal-ai/templates/ - Add recipe-specific templates

Summary

This enhancement would transform the setup from "install modules and configure manually" to "install recipes and get a working AI-powered Drupal site with sensible defaults immediately."

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions