Neurelo Build Docs
Neurelo Build Docs
  • Introduction
    • Core Concepts
    • Key Features
  • Getting Started
    • Sign-in/Sign-up
    • Dashboard
      • Collapsible Sidebar
      • Light/Dark Mode
      • Account Settings
      • Audit Events
      • User Management
        • Permissions (Member v/s Admin)
      • Org Settings
    • Starting your Neurelo Project
      • Quick Start Guide
      • Step 1 - Add a Data Source
      • Step 2 - Build Definitions
      • Step 3 - Create an Environment
      • Step 4 - Create an API Key
      • Step 5 - Start Runners
      • Try your Neurelo APIs
  • "How to" Videos
    • Product Overview
    • Neurelo APIs & SDKs
    • Project Setup
    • Definitions
    • Environments
    • Data Sources
    • Organization Management
    • Creating and Using Custom Queries
    • Using the Schema Builder to build Relationships
    • Mock Data Generation
  • Definitions
    • Neurelo Schema Editor
      • Schema Builder
      • JSON/YAML Editor
      • Schema Visualization: Entity-Relationship Diagram (ERD)
    • Custom APIs for Complex Queries
      • Write and Commit Custom Queries
      • AI-Assisted Query Generation
      • Deploying Custom API Endpoints
      • Using Variables in your Custom Query
    • Branches and Commits
    • API Docs
  • Environments
    • Creating a new Environment
    • API Playground
    • Observability
    • Migrations
    • API Keys
  • Data Sources
    • PostgreSQL
    • MySQL
    • MongoDB
  • Guides
    • Provisioning Cloud Databases for using with Neurelo
      • PostgreSQL
        • AWS RDS (PostgreSQL)
      • MySQL
        • AWS RDS (MySQL)
      • MongoDB Atlas
    • Mock Data Generation
    • Wipe Data Source
    • Remote Git Repository for Definitions
      • Connecting a Remote Git Repo
      • Creating Commits from Neurelo
      • Syncing Branches
    • Data Viewer
    • Environment/Data Source Tags
    • How to work with Embedded documents and References in MongoDB
    • How to download and use the Postman Collection for your Project
    • Building Python applications with Postgres and FastAPI
    • CI Integration using Neurelo CLI
    • Schema Migrations
    • Schema AI Assist
    • Auto-Introspection
    • Access Policies
    • User Auth
      • Google
      • GitHub
      • GitLab
    • MongoDB Atlas - Migrate GraphQL to Neurelo
    • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate GraphQL APIs to Neurelo
  • Neurelo Schema Language (NSL)
    • Example 1 - DVD Rentals
    • Example 2 - Simple "Posts" App
    • Example 3 - Bookstore
  • Neurelo API Reference (REST)
    • Examples of Neurelo Auto-Generated REST API endpoints
      • Example 1 - Simple “Posts” application
      • Example 2 - "DVD Rentals" application
      • Example 3 - "Bookstore” application
      • cURL API Examples
  • Neurelo API Reference (GraphQL)
  • SDKs
    • TypeScript / JavaScript SDK
    • Go SDK
    • Python SDK
      • Python SDK Tutorial -- News Application
        • News Application using Neurelo’s Python SDKs
  • CLI (Preview Version)
  • Self-Hosted Neurelo Gateways
  • Tutorials
    • Building a Real Time Chat Application with Neurelo and MongoDB using Python
    • Building A Financial Terminal with Neurelo and MongoDB in Rust
    • Building a Restaurant Management System with Neurelo and MongoDB using GraphQL in just a few minutes
    • Bringing Neurelo’s Data APIs to Life Instantly with MySQL
  • Project Examples
  • References
    • Supported Databases
    • Supported OS and Browsers
  • Support
Powered by GitBook
On this page
  • Overview
  • Using Schema AI Assist
  • For a New Project
  • For an Existing Project
  • Limitations
  1. Guides

Schema AI Assist

PreviousSchema MigrationsNextAuto-Introspection

Last updated 9 months ago

Overview

Traditionally, creating a database schema involves a detailed analysis of business requirements, followed by designing tables and relationships using tools and languages like SQL. This process can be time-consuming, complex, and prone to human error. Now, you can leverage the power of artificial intelligence to automate and enhance the process of designing and optimizing database structures with Neurelo's AI Schemafeature.

Neurelo's AI Schema Assist capability helps construct schemas for your application, just by specifying the intent of the application you want to build. If you already have an existing schema, it also allows you to extend and enhance your schema.

This feature significantly reduces the time and effort required to design complex database schemas and also helps adapt the schema to changing business requirements and data patterns.

This feature is supported for MongoDB, MySQL, and PostgreSQL

Using Schema AI Assist

For a New Project

To generate the schema using AI Assist for new projects, start by creating a new project. Once done, you will be presented with the option to either "Connect to a Data Source" or "Build Definitions" in your project dashboard.

Click on the "Build Schema" button under "Build Definitions." This will present you with the "Build a Schema" view.

In this view, click on the "Schema AI Assist" option. This will present you with a playground to build and iterate over your schema.

Let us say we would like to create a new schema for a "Retro CD Collection." To build this schema, you can send the following prompt in the playground: "Build a schema to store Retro CD Collection data." The database engine we will be using for this example is MongoDB.

Once the schema is generated, the playground will automatically close, and you can visualize your schema in our "Schema Builder" view. Here is an example of a schema generated by Schema AI Assist for MongoDB:

As you can observe, it generated a single object "cdCollection" with properties such as the album name, artist name, release year, genre, track list, duration, label, and the condition of the CD (mint, good, fair, etc.).

Notice also how the types are correctly aligned with what’s usually expected from such schemas.

You can also open the schema in the "ERD" view to review the schema

If you are satisfied with the first iteration, make sure to commit your changes. If you would like to further iterate over it, click on the "AI Assist" button on the top right of the "Schema" view to open up the playground again.

Let us say for the second iteration, we would like to update the “condition” property so that the options (mint, good, fair, etc.) are not of type “String” but instead should be an “Enum” with a couple of options.

To do this, you can simply use a prompt such as “Let us use an enum for the condition property.”

Et voila! The “condition” property is now an enum.

You can also ask it to create complex schemas, such as extending the existing schema to store cover art details and the CD’s physical appearance details. For instance, doing so generates the following schema (visualized using our ERD viewer):

You can also edit this schema manually using the Schema Builder, or the JSON/YAML editors. Once you have a schema you like, you can Commit the schema and use it in your environments.

For an Existing Project

Using Schema AI Assist for existing projects is similar to using it for new projects. Simply click on the “AI Assist” button in the “Schema” view under the Definitions for your project.

The Schema AI playground should pop up. You can then specify a new prompt and iterate over your existing schema.

Limitations

Please note the following when using the Schema AI Assist feature:

  • While it is rare, there might be cases where Schema AI Assist generates inaccuracies in certain parts of the schema. This should be immediately flagged by our “Schema Validation” functionality. Should this happen, we recommend you either:

    • Iterate again with Schema AI Assist over your previously working schema

  • Note - If there are inaccuracies, before using Schema AI Assist again make sure to fix the schema first or switch back to your previous working schema before iterating again. We use the most recent schema present in the Schema definitions editor to generate a new schema

As you can notice, it generated two “Inner Objects” (Embedded Documents in MongoDB) inside the “cdCollection” object to store the details for cover art and the CD’s physical appearance. To read more about how we support Embedded Documents, check out our tutorial on .

Or, switch to the “JSON/YAML Editor'' and directly correct the inaccuracies in the Neurelo Schema Language (NSL). To read more about how to work with NSL, check out our guide on .

how to work with Embedded Documents and References in MongoDB
Neurelo Schema Language (NSL)
✨