Back to Blog

Introducing Neurelo AI Schema: An Industry First for SQL and NoSQL Databases

AI is playing an ever increasing role in application development. From code generation to tests, debugging, and documentation, Generative AI (GenAI) is helping developers save time and boost productivity. Reflecting that trend, AI Query Assist is firmly established as one of the most popular features of the Neurelo platform. 90% of developers building with Neurelo use it to help them quickly generate, test, and deploy ad-hoc queries without having to know all of the intricacies of SQL or the MongoDB Query Language. Equipped with this insight, we began exploring ways to integrate AI into additional phases of the development lifecycle. 

Before you start writing queries, you must first design your database schema. With our new Neurelo AI Schema, we help you do just that. 

AI schema is powered by our fine-tuned LLM. You can use it when you are modeling relational tables in PostgreSQL or MySQL, or collections in MongoDB. Simply prompt AI Schema with a natural language description of the app you are building, and it will auto-generate the data model for you. Tables, relationships, objects, fields, and data types are all created by AI Assist. Unique to Neurerlo is the freedom and flexibility to iteratively refine the schema through conversational text prompts rather than having to regenerate it from scratch. You can also manually edit the data model in our schema builder. 

On its own, AI Schema saves you hours and days of research into schema design best practices just to arrive at a good starting point. But those savings are only the start. When you use AI Schema as part of your development workflow in Neurelo — generating mock data and crafting queries for testing, then creating API endpoints when you commit — you save days and weeks in development and experimentation. You free cycles up to focus on building great software and shipping it faster. 

Sounds like magic right? We’re going to walk you through how this all comes together. Before that, a quick discussion on the problems we are solving. 

The Challenges of Schema Design 

Designing your database schema is a critical part of the app dev process. A combination of art and science (sprinkled with what seems like mythology and folklore along the way), even experienced developers struggle to get it right.  

Schema design questions are some of the most common on sites like Stack Overflow and Reddit. Talks on the topic attract the highest attendance at database conferences. Thousands of books and millions of blog posts have been written over the years to instill best practices. And yet all too often, suboptimal schemas wreak havoc on applications, leaving developers frustrated, overwhelmed, and scrambling to fix cascading issues. 

Designing schemas for relational databases and for MongoDB each present their own set of distinct considerations and trade-offs that are often dictated by the specific app you are building.

MySQL and PostgreSQL MongoDB
The primary issue is balancing normalization and performance. Proper normalization reduces redundancy and improves data integrity but can lead to complex joins and slow queries, making the app feel sluggish to users.

Predefined schemas mean subsequent table modifications are labor-intensive, error-prone, and disruptive, reducing the rate at which new features can be deployed to production.
A dynamic schema offers flexibility but requires meticulous planning to avoid costly redesigns later. Developers must anticipate query access patterns. One of the toughest challenges is figuring out when to embed related data in a single document using a denormalized model or reference related data in a separate collection, much like a conventional relational database.

Handling data consistency is also complex due to MongoDB’s distributed design.

The table above summarizes just a few of the top level considerations. You also need to think about indexing, hardware constraints, scalability with techniques like partitioning and sharding, ease of evolution to accommodate future app requirements, granularity of access controls to sensitive rows and fields, and many, many more.

The Impact of Getting Schema Design Wrong

Incorrect schema design can severely affect both applications and developers. 

For applications, poor design leads to latency and throughput issues like slow queries along with inefficient data storage and retrieval. Data integrity suffers as well. In relational databases, improper normalization causes data anomalies and inconsistencies. In MongoDB, failing to design for consistency can result in stale or conflicting data.

For developers, flawed schemas increase maintenance complexity, leading to frequent, risky schema migrations. Time spent optimizing queries and refactoring data structures reduces productivity and delays feature development. 

How does Neurelo AI Schema Help?

We already use our OpenAI GPT-4o LLM — fine-tuned with the latest MongoDB, MySQL, and Postgres query syntax — to generate queries for you. We have further extended that fine tuning with the latest schema design patterns for those databases. This means all you need to do is provide a text prompt describing your application, and AI Schema comes back with a recommended data model. 

Your prompt can be pretty much any application type: ecommerce backend, insurance claims processing, HR system, connected vehicle, customer relationship management, gaming platform. If you can build it in software, we can model it with AI Schema!

Let me step you through the process by building out my new restaurant management system. 

To get started, create a new project in Neurelo. Then you can follow the "Build Schema" step by asking the AI with a simple NLP prompt such as - "create a schema for a restaurant management system." The AI generates a comprehensive data model tailored to your database, such as MongoDB, including collections, fields, field types, and more. This schema is immediately displayed in an intuitive Schema Builder UI, allowing you to review and edit as needed.

Figure 1: Example of the AI Schema for Restaurant Management System

AI Schema allows you to further improve the schema with additional NLP prompts such as - "add frequent restaurant visitors with loyalty details," and the AI will update the schema accordingly. You can continue to ask as many incremental improvements you need and along the way review and edit as needed. You can see further examples in our AI Schema documentation

As you can see, what would have taken you hours or days of reading and research is now compressed to minutes with AI Schema. But there is much more value Neurelo can provide.

Unifying your App Dev Workflow

Generating your first schema is a great start. But now you need to test and refine it, making sure it supports the functionality demanded by the app with the latency demanded by the business.

Figure 2: Unifying the database development and management lifecycle into a single platform

As you build your schema with AI Schema (or manually), Neurelo's GitSchema automatically converts your schema into JSON and YAML. This lets you commit the schema to your Git repository, collaborate with your development team, ensure governance, and automate your database interface as part of your CI/CD workflow.

When you commit your schema, Neurelo's AI generates Data APIs in REST and GraphQL, complete with comprehensive API documentation. Additionally, Neurelo's AI-powered Mock Data Generator can insert thousands of synthetic data records into your database instantly. 

Within minutes, Neurelo enables you to go from an idea to having a schema, Data APIs, and synthetic data, allowing you to build your app in minutes instead of days or weeks with multiple tools. What's really important to emphasize is that it is only by working with a unified database tool spanning every stage of your application lifecycle — and which also understands your application context — that you can get the benefits of this integrated experience 

Furthermore if you need to change your data model, Neurelo’s AI Schema and Query Assist can help regenerate and redeploy the data model and query code for you, and with higher accuracy than general purpose AI copilots. 

AI Beyond the Database Layer

At Neurelo we are focused on simplifying how developers build with data. AI is already helping us do that. But why stop at the database? Knowing your data model and query patterns helps our AI models write your business logic and frontend. The time it takes to spin up a proof-of-concept of your app is compressed from days and weeks to hours. We are not there yet, but AI Schema and AI Query Assist gives us a great start in realizing that future vision. 

Getting Started with AI Schema

I hope you are excited to try AI Schema out. Before doing that, some of you will want to dig deeper, so take a look at our engineering blog where we cover xxxx. If you’re eager to jump in, you can try Neurelo for free simply by creating an account

If you have any questions or feedback on how we can continue to develop AI Assist, DM us on Twitter/X or LinkedIn