Drupal is a registered trademark of Dries Buytaert
cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! linkit 7.0.15 Minor update available for module linkit (7.0.15). views_data_export 8.x-1.10 Minor update available for module views_data_export (8.x-1.10).

ai_schema

2 sites 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
2
First release
Apr 2026
Latest release
1 month ago
Release cadence
2 days
Stability
0% stable

Releases

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