Drupal is a registered trademark of Dries Buytaert
cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). editoria11y 2.2.22 Minor update available for module editoria11y (2.2.22). ai 1.2.13 Minor update available for module ai (1.2.13). ai 1.3.2 Minor update available for module ai (1.3.2). moderated_content_bulk_publish 2.0.51 Minor update available for module moderated_content_bulk_publish (2.0.51). moderated_content_bulk_publish 2.0.50 Minor update available for module moderated_content_bulk_publish (2.0.50). editoria11y 2.2.21 Minor update available for module editoria11y (2.2.21). eca 3.1.0 Minor update available for module eca (3.1.0). sophron 3.1.1 Minor update available for module sophron (3.1.1). ai 1.3.1 Minor update available for module ai (1.3.1). seven 2.0.0-beta6 New beta version released for theme seven (2.0.0-beta6). seven 1.0.1-beta1 First beta version released for theme seven (1.0.1-beta1). bamboo_twig 6.0.7 Minor update available for module bamboo_twig (6.0.7). ebt_core 1.4.38 Minor update available for module ebt_core (1.4.38). ept_core 1.4.24 Minor update available for module ept_core (1.4.24). block_exclude_pages 2.2.2 Minor update available for module block_exclude_pages (2.2.2). dxpr_theme_helper 3.1.1 Minor update available for module dxpr_theme_helper (3.1.1). dxpr_theme_helper 3.1.0 Minor update available for module dxpr_theme_helper (3.1.0).

ai_schema

No security coverage
View on drupal.org

AI Schema exports Drupal’s complex data model into clean, structured, and LLM-friendly JSON. It helps developers and AI tools understand entities, fields, relationships, and database structure without deep Drupal knowledge.

Features

AI Schema transforms Drupal’s internal data model into multiple machine-readable formats designed for developers, data tools, and AI systems.

Key capabilities include:

  • LLM-friendly schema export
    Generates a compact, token-efficient model (compact-model.json) optimized for AI tools like ChatGPT and Claude.
  • Entity relationship graph
    Outputs a full relationship graph (relation-graph.json) showing how entities and bundles are connected.
  • Automatic SQL query generation
    Creates ready-to-use SELECT queries with correct JOIN logic for Drupal field tables.
  • Full data model export
    Includes entity types, bundles, fields, storage tables, and column mappings.
  • Per-entity context files
    Combines schema, relations, and SQL into a single file per entity bundle.
  • AI semantic hints
    Fields are automatically classified (label, content, taxonomy, media, etc.) to improve machine understanding.

When should you use this module?

  • When you want to integrate Drupal with AI tools (LLMs)
  • When you need to generate SQL queries without dealing with Drupal’s schema complexity
  • When building data pipelines, BI tools, or external APIs
  • When documenting or analyzing a Drupal data model

Post-Installation

After enabling the module, no UI configuration is required.

All functionality is available via Drush commands.

To generate the full export:

drush aischema:export-all

This will create a ai-schema/ directory in your project root containing:

  • compact-model.json (LLM-optimized schema)
  • relation-graph.json (entity relationships)
  • sql-queries.json (generated SQL queries)
  • Additional advanced exports

Typical workflow

  1. Run the export command
  2. Use compact-model.json and relation-graph.json as input for LLM tools
  3. Use sql-queries.json for direct execution or integration

No configuration pages or UI setup are needed.

Additional Requirements

  • Drupal 10.x or 11.x
  • Drush 12.x or 13.x

No additional contributed modules or external libraries are required.

This module works standalone.

However, it pairs well with:

  • Headless Drupal setups (JSON:API, GraphQL)
  • BI and analytics tools
  • AI / LLM platforms (ChatGPT, Claude, etc.)

Similar projects

There are tools that export Drupal configuration or provide schema introspection, but AI Schema is different in key ways:

  • Designed specifically for AI/LLM consumption
  • Provides token-efficient compact schema representation
  • Includes automatic SQL query generation
  • Adds semantic meaning (AI hints) to fields
  • Outputs relationship graphs

This makes it more than a schema export tool it is an AI integration layer for Drupal.

Supporting this Module

This module is developed and maintained by OctoHaus.

If you are interested in contributing, feedback, or collaboration, feel free to get in touch.

Activity

Total releases
1
First release
Apr 2026
Latest release
15 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.0-rc1 Pre-release Apr 7, 2026