> For the complete documentation index, see [llms.txt](https://docs.nimbalyst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nimbalyst.com/visual-editors-powered-by-ai/data-models.md).

# Data Models

Design database schemas visually in Nimbalyst. Build a Prisma-based data model with AI from your existing code and markdown documentation.

Design a database schema as a visual entity-relationship diagram backed by a real Prisma schema file. You can move between the canvas and Prisma source, so the model stays useful to both people and coding agents.

<figure><img src="https://562749618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiVUeHZHlFlZrZt02syRC%2Fuploads%2Fgit-blob-f48df06c73f8786e3ba577a3862bb2f50588b06e%2FData%20Model%20Gif.gif?alt=media" alt="Creating and editing a data model in Nimbalyst"><figcaption><p>A Prisma schema rendered as an editable entity-relationship diagram.</p></figcaption></figure>

Data models use the `.prisma` extension. Open one from the file tree to use the visual editor, or switch to source mode to edit the Prisma syntax directly.

More on the visual schema editor is on the [data modeling feature page](https://nimbalyst.com/features/data-modeling/) and the [DataModelLM extension page](https://nimbalyst.com/extensions/datamodellm/).

* **Create with AI**: type `/datamodel` and describe the entities, fields, and relationships you need.
* **Edit visually or in source**: add and arrange entities on the canvas, or edit the underlying Prisma syntax.
* **Work from project context**: ask the agent to derive or revise the schema using existing code and documents.
* **Embed it in markdown**: type **/** in a document and insert the data model so readers can see it with the surrounding plan.
* **Export it**: export SQL DDL, JSON Schema, DBML, or DataModelLM JSON. MongoDB models can also export Mongoose schemas and MongoDB index scripts.
* **Collaborate**: share a data model with your team for live editing and presence.

<figure><img src="https://562749618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiVUeHZHlFlZrZt02syRC%2Fuploads%2Fmgzi5jnJhGvkXOV1hlCU%2FData%20Model%20Dark.png?alt=media&amp;token=e4c25f19-cc18-4c5d-8cf7-5061c84e4b59" alt="Data model editor in dark mode showing related database entities"><figcaption><p>The visual editor shows entities, fields, and the relationships between them.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nimbalyst.com/visual-editors-powered-by-ai/data-models.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
