Drupal AI Views Agent

Created on 3 August 2025, about 1 month ago

The detailed document can be found at https://docs.google.com/document/d/16yCLk7Q7WWbbqH9PxD6yJX9VufHNUqEWOGCW...

Summary

This issue outlines the scope, technical specifications, and user stories for a new Drupal AI Views Agent feature, designed to integrate AI capabilities into the Drupal Views module. The core objective is to enable users to create and configure Drupal Views using natural language instructions, leveraging Large Language Models (LLMs) and the existing Drupal AI Agent framework.

Introduction and Scenarios

The Drupal AI Views Agent will enhance the Views module by allowing users to interact with it through natural language. This feature will utilize Drupal AI agents and sub-agents to interpret user commands and translate them into specific Views configurations.

Sample scenarios include:

  • An event organizer wants to create a display for upcoming events to show on a homepage.
  • A non-profit organization wants to add a latest article listing to their homepage for awareness.

These scenarios are created based on https://new.drupal.org/assets/2025-06/Drupal-AI-Strategy-June-25_0.pdf.

Scope

The project's scope covers:

  • Development of the Drupal AI Views Agent for interpreting natural language to configure Views.
  • Integration with the existing Drupal AI Agent framework.
  • Identification and conversion of key parameters from natural language input (e.g., content type, display type, fields, filters, sorting)
  • Programmatic creation and configuration of a new View based on extracted parameters.
  • Support for common Views features: display types (block, page), style types (listing, table, grid), fields/view modes, filters (content type, status, arguments), sorting, content limits, headers/footers, and access control.

Technical Specifications

The Drupal Views AI Agent will process natural language instructions using an LLM to derive specific Views parameters.

An example instruction:

"Create a block display to show the latest 9 published articles in a 3 by 3 grid. Each article in the grid should show the title of the article, the image of the article, the summary of the article, and a read more link to the article."

Extracted parameters from this instruction would include:

  • Content type: article
  • Display type: block
  • Style type: grid
  • Style specific options: 3x3
  • Fields to use: title, summary, image, link to the article
  • Limit: 9
  • Sort order: published date descending
  • Content status: published

These parameters will then be passed to a function call plugin to create the view.

User Stories

The user stories for covering the AI agent's ability:

Future Considerations

Future enhancements may include:

  • Advanced filtering options (date ranges, taxonomy terms, user fields).
  • Relationship support between content types.
  • Contextual filters/arguments.
  • Exposed filters.
  • Internationalization for multi-language support.

Risks

Potential risks identified are:

  • LLM inaccuracies.
  • Complexity of the Views module.
  • Performance overhead.
  • Security vulnerabilities from natural language interpretation.
  • Instability and breaking changes due to ongoing Drupal AI module development.

Next Steps

The next steps involve:

  1. Review and approval of this document.
  2. Detailed technical design phase.
  3. Establishment of a comprehensive project plan and timeline.
  4. Commencement of development.

The detailed document can be found at https://docs.google.com/document/d/16yCLk7Q7WWbbqH9PxD6yJX9VufHNUqEWOGCW...

🌱 Plan
Status

Active

Version

1.0

Component

Project Management

Created by

🇨🇦Canada jibran Toronto, Canada

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

Comments & Activities

  • Issue created by @jibran
  • 🇨🇦Canada jibran Toronto, Canada
  • 🇨🇦Canada jibran Toronto, Canada

    Created 📌 Add views creation function call plugin Active as a first step.

  • 🇨🇦Canada jibran Toronto, Canada

    I tried to create a flow diagram for the Views Agent to visualize the flow.

    Core Processes

    Process 1: List View

    Process: 2: Create View

    Process 3: Update View

    Views Agent

  • 🇩🇪Germany marcus_johansson

    Awesome user stories!

    I do think however you will have to end up with having to split it up in a lot more tools, so having a tool specifically for getting filters for your view type, settings filters and setting filter etc., then one tool for sorting - trying to push one big config array is something that even the biggest models have issues with. You can try this, but my gut feeling is telling me to split it up in smaller tools, similar to how you would setup a Views manually in the GUI, so something like (outside of reusing tools to get entity types etc.)

    * Get View Types (page, block, embed, export etc.)
    * Get Display View Formats and Outputs for View Type (like Unformatted List and Fields or Entity)
    * Set base view config (title, type, display view format).
    * Get Display View Format Settings for specific Display View Format
    * Set Display View Format
    * Get Output formats for View Type and Display View Format combination.
    * Set Output formats
    etc.

    Its important that you feed this in pieces and maybe even in sub-agents, to keep the context for a specific task low.

    But once again, you could try with the big blob array, but you need the get information tools for sure at least.

  • 🇨🇦Canada jibran Toronto, Canada

    Thank you for the feedback. I agree we would need sub-agents and I have seen with field type plugin how breaking up in smaller chunks gives more precise results.
    I'll refine my approach.

  • 🇨🇦Canada jibran Toronto, Canada

    Updated the update view process as per the discussion.

Production build 0.71.5 2024