Skip to main content
Version: Next

Build the Collection With AI

Read Working With an AI first — every step below has a Prompt, a Check and an If not.

Step 1: Open the AI Data Modeler​

  1. Open Administration → Datamodel → AI Data Modeler.
  2. Start a new chat and select the mode Plan.

Step 2: Plan the Basic Model​

Prompt:

I want to manage my CD and DVD collection in EP. Please plan a data model:

- Entity type "cd" (CD): title, artist, release year, genre, number of tracks.
- Entity type "dvd" (DVD): title, director, release year, genre, runtime in minutes.
- Entity type "artist" (Artist): name, country.
- A relationship from cd to artist ("performed by").
- One genre enum shared by CDs and DVDs, with about 10 common genres
for music and film.

Use only letters, digits and underscores in technical names.
Labels in English and German. Do not create anything yet, only plan.

Check — the plan must contain:

  • three entity types for CD, DVD and artist,
  • title and release year on both CD and DVD,
  • a relationship from CD to artist,
  • one enum for genres, used by both CD and DVD,
  • technical names without hyphens or spaces,
  • labels in English and German.

If not, for example when the artist is only a text field on the CD:

Please model the artist as its own entity type "artist" and connect
cd to artist with a relationship instead of a text property.

Example result (yours will differ): the AI proposes cd, dvd, artist, an enum media_genre with entries such as rock, pop, jazz, classical, action, drama, a relationship performed_by from cd to artist, and lists the properties with their property types.

Step 3: Add the DVD Box​

A DVD box — for example a trilogy — contains several single DVDs. This is a hierarchy: the box is the parent, the discs are its children, in a fixed order.

Prompt:

Extend the plan: add an entity type "dvd_box" (DVD box) with title and
release year. A DVD box contains several single DVDs in a fixed order
(disc 1, disc 2, ...). A DVD can also exist on its own, outside a box.
How do you model this containment in EP, and why?

Check:

  • a new entity type for the DVD box,
  • a connection from the box to the DVDs that keeps the order of the discs,
  • DVDs can still exist on their own,
  • the AI explains its choice.

EP offers two ways for this — both are fine for the tutorial:

OptionWhat it meansWhen it fits
Relationship from box to DVD, with a disc number as property of the relationshipThe DVDs are independent entities; the box points to themDVDs are also sold or lent individually
List (has_list) on the boxThe discs are ordered entries inside the boxDiscs only exist as part of a box

Since the prompt says that a DVD can exist on its own, a relationship with a disc number is the better fit. See Relationship Types and Lists.

If not, for example when the AI makes the DVD box a parent type of DVD (inheritance instead of containment):

A DVD box is not a kind of DVD — it contains DVDs. Please do not use
inheritance here. Use a relationship "contains_disc" from dvd_box to
dvd with a property "disc_number" on the relationship.

Step 4: Build the Model​

When the plan passes all checks:

  1. Switch to the mode Agent.

  2. Send:

    The plan is fine. Please create it in EP now.
  3. Review what the AI is about to do and confirm with Upload to EP Core.

Check in EP — not in the chat:

  • Open Administration → Datamodel → Entity Types and search for cd, dvd, dvd_box and artist. All four exist.
  • Each entity type has the planned properties on its tab Properties, in a sensible order (column #).
  • The relationships appear on the tab Relationships of cd and dvd_box.
  • The genre enum has its entries (open /search/enums).

If not: describe precisely what is missing, for example "The entity type dvd has no property runtime_minutes. Please add it as an integer." For small corrections it is often faster to fix them by hand — see Properties.

Step 5: Readable Labels​

Prompt (Agent mode):

Add label scripts:
- cd: "<title> – <artist name>" if the relationship to the artist exists,
otherwise only the title.
- dvd and dvd_box: "<title> (<release year>)".
- artist: the name.

Check: open the entity type dvd → Data Sheet → Label Script. The script returns the title and the year. You can also ask the AI Low Code Generator next to the script editor to explain it.

Step 6: Sample Data​

Prompt (Agent mode):

Create sample data:
- 3 artists with 2 CDs each.
- 4 single DVDs.
- 1 DVD box "The Lord of the Rings Trilogy" (2003) with its three
movies as discs 1 to 3.

Check in EP:

  • The search page of cd shows six CDs; each is connected to its artist.
  • The DVD box shows its three discs in the right order.
  • Open the DVD box in the Graph Browser and expand its relationship: the three discs appear around it.

Step 7: Menu Entry​

Users should find the collection in the sidebar, not by typing addresses.

Prompt (Agent mode):

Add a menu group "Media Collection" (German: "Mediensammlung") to the
sidebar with the icon Lucide:Disc3. Inside it, add one entry per entity
type you created: CDs, DVDs, DVD boxes and artists. Each entry opens the
search page of its type (/search/<technical name>). Use fitting Lucide
icons and English and German titles.

Check in EP:

  • Reload the page. The sidebar shows the group Media Collection with four entries.
  • Each entry opens the search page of the right type.
  • Switch the language to German: the titles are German.

If not, for example when the AI cannot change the sidebar: build the menu by hand in the Menu Builder (/admin/menu-builder), as described in Step 6 of the manual tutorial. You can also check or tidy up the AI's result there — for example drag the entries into a different order.

Visible to everyone

Menu changes apply to all users right away. On a shared test system, tell your colleagues.

What You Learned​

  • The AI Data Modeler plans and builds data models from a description in plain language.
  • Plan mode is safe for exploring; Agent mode changes EP.
  • Clear prompts with names and structure lead to predictable results; checks in EP confirm them.
  • Menu entries can be created by prompt as well — and checked or corrected in the Menu Builder.
  • Containment hierarchies such as a DVD box are modeled with a relationship (with an order property) or a list — not with inheritance.