Skip to main content

Generate ERD

ekai generates an Entity Relationship Diagram with AI-detected primary and foreign keys using multi-signal analysis from statistical profiling and onboarding context.

Prerequisites

Complete the Statistical Profiling step to analyze your data patterns.


Starting ERD Generation

Click Go To Schema Generation or navigate to the SCHEMA tab to start:

ERD generation starting

The AI Agent initiates schema analysis with connection information:

  • Connection name and type
  • Total number of tables
  • Processing status

Generation Progress

Watch the AI work through your schema:

ERD generation in progress

Progress Steps

The AI Agent Chat shows real-time progress:

To Do:

  • Set up workspace and validate data sources
  • Filter candidate keys from table columns
  • Identified Keys. Moving to Relationships
  • Identifying Relationships. Tables left: 2
  • Generate table and column descriptions

Key Detection Results

For each table, the SCHEMA tab displays detected keys:

Keys Tab

FieldDescription
Primary KeyDetected primary key column(s)
TypeSingle or Composite
Foreign KeysDetected FK columns
ConfidenceCertain, High, Medium, Low
ReasoningAI explanation for the detection

Example Detection

Table: SALESFORCE_CAMPAIGNS
─────────────────────────────
Primary Key:
• Columns: CAMPAIGN_ID
• Type: Single
• Confidence: Certain

Foreign Keys:
• PRODUCT_ID → SALESFORCE_PRODUCTS.PRODUCT_ID

Analysis:
"CAMPAIGN_ID is the clear candidate for the primary key as it
uniquely identifies a campaign. PRODUCT_ID shows a strong
relationship (0.90) to SALESFORCE_PRODUCTS with an exact
column name match."

ERD Complete - DBML View

When generation completes, view the ERD in DBML (Database Markup Language) format:

Completed ERD in DBML format

DBML Output

Table SALESFORCE_CAMPAIGNS {
ACTUAL_SPEND float [note: "Actual expenditure for the campaign"]
CAMPAIGN_ID number [pk, note: "Unique identifier for each campaign"]
CREATED_DATE text [note: "When the campaign was created"]
PRODUCT_ID number [note: "Related product identifier"]
STATUS text [note: "Campaign status (active, inactive, completed)"]
// ... more columns

Note: "Marketing campaigns managed through Salesforce"
}

Table SALESFORCE_PRODUCTS {
PRODUCT_ID number [pk]
PRODUCT_NAME text
// ... more columns
}

Ref: SALESFORCE_CAMPAIGNS.PRODUCT_ID > SALESFORCE_PRODUCTS.PRODUCT_ID

SCHEMA Sub-tabs

TabContent
KEYSPrimary and foreign key analysis per table
RELATIONSHIPSAll detected relationships
DOCUMENTATIONGenerated table/column descriptions
ENTITY RELATIONSHIPDBML code view

Visual ERD Diagram

Click View Visualization to see the interactive ERD:

Visual ERD diagram

Diagram Features

Interactive Canvas
  • Zoom in/out
  • Pan to navigate
  • Click tables for details
Table Boxes
  • Table name header
  • Column names listed
  • PK indicator
Relationship Lines
  • FK connections
  • Cardinality indicators
  • Click for details
Controls
  • + / - zoom
  • Fullscreen mode
  • Download image

Generation Summary

The AI Agent provides a summary of what was generated:

Database structure for your financial services platform:

26 tables across 3 systems:

  • Salesforce (5 tables): Campaigns, interactions, leads, opportunities, products
  • Temenos Core Banking (16 tables): Customers, accounts, loans, payments, KYC
  • Worldline Payments (5 tables): Cards, transactions, merchants, disputes, fraud alerts

Key highlights:

  • 33 relationships connecting your data
  • Primary and foreign keys identified across all tables
  • Detailed descriptions for every table and column
  • Full integration between CRM, banking, and payment systems

Next Steps