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:
| User Story | Description | Views Plugin/ Feature |
|---|---|---|
| As a Site Administrator, I want to create a new View using natural language instructions, so that I can quickly and intuitively build content listings. | This involves the core functionality of the Drupal Views AI agent, processing natural language, and converting it to Views configurations. | Programmatically create a view |
| As a Site Administrator, I want the AI agent to support various display types (e.g., block, page) when creating a View, so that I can generate different types of content presentations. | This user story focuses on the agent's ability to correctly identify and apply display type parameters. | Views Display plugins |
| As a Site Administrator, I want the AI agent to understand and apply different display styles (e.g., listing, table, grid), so that I can control the visual layout of my content. | This user story covers the agent's capacity to interpret and configure style type options, including specific grid dimensions. | Views Style plugins |
| As a Site Administrator, I want to specify which fields to display in a View using natural language, so that I can control the information presented for each content item. | This user story involves parsing field names from natural language and mapping them to available Drupal fields. | Views FIeld plugins |
| As a Site Administrator, I want to apply filters (e.g., content type, status) to a View using natural language, so that I can narrow down the content displayed. | This focuses on the agent's ability to identify and configure filters based on natural language input. | Views Filter/Argument plugins |
| As a Site Administrator, I want to set the sorting order of content in a View using natural language (e.g., "latest", "alphabetical"), so that I can organize my content effectively. | This user story covers the agent's interpretation of sorting instructions and mapping them to Views sorting criteria. | Views Sort plugins |
| As a Site Administrator, I want to specify a limit on the number of content items displayed in a View using natural language, so that I can control the length of my listings. | This involves the agent's ability to extract and apply numerical limits. | Views Pager plugins |
| As a Site Administrator, I want the AI agent to be able to ask clarifying questions if my initial instruction is ambiguous or incomplete, so that the View can be configured correctly. | This user story addresses the iterative nature of agent-based interactions and handling incomplete information. | Misc |
| As a Site Administrator, I want to define specific access permissions for a View using natural language (e.g., "only authenticated users"), so that I can control who sees my content. | This focuses on the agent's ability to integrate with Drupal's access control mechanisms. | Views Access plugins |
| As a Site Administrator, I want to add headers and footers to a View using natural language, so that I can provide additional context or branding. | This involves the agent's capability to identify and apply header and footer content. | Views Area plugins |
| As a Developer, I want a well-documented API for interacting with the Drupal Views AI Agent, so that I can extend its functionality or integrate it into other modules. | This user story addresses the need for clear technical documentation and a robust API. | Documentation |
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:
- Review and approval of this document.
- Detailed technical design phase.
- Establishment of a comprehensive project plan and timeline.
- Commencement of development.
Flow Chart
The sample workflow for the agent.
Core Processes

Process 1: List View

Process: 2: Create View

Process 3: Update View

Views Agent

The detailed document can be found at https://docs.google.com/document/d/16yCLk7Q7WWbbqH9PxD6yJX9VufHNUqEWOGCW...
| Comment | File | Size | Author |
|---|
Comments
Comment #2
jibranComment #3
jibranCreated #3542457: Add views agent as a first step.
Comment #4
jibranI 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
Comment #5
marcus_johansson commentedAwesome 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.
Comment #6
jibranThank 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.
Comment #7
jibranUpdated the update view process as per the discussion.

Comment #8
marcus_johansson commentedJust bumping this issue so we don't have issues on 1.x branch.