dcupl AI

dcupl AI brings artificial intelligence capabilities to your data layer. Leverage AI for intelligent model generation, data quality analysis, workflow creation, and interactive assistance.

Overview

flowchart TB
  subgraph Input["User Input"]
    D[Sample Data]
    P[Natural Language]
    F[Files]
  end

  subgraph AI["AI Processing"]
    M[Model Generation]
    L[Data Linting]
    W[Workflow Proposals]
    C[Chat Assistant]
  end

  subgraph Output["AI Artifacts"]
    MD[Model Definition]
    QR[Quality Report]
    WT[Workflow Template]
    MK[Mock Data]
  end

  D --> M --> MD
  D --> L --> QR
  P --> W --> WT
  P --> C --> MK
  F --> C

dcupl AI is powered by Claude and provides:

  • Model Generation - Infer data models from sample CSV/JSON data
  • Data Quality Linting - AI-powered analysis and recommendations
  • Workflow Proposals - Generate workflows from natural language descriptions
  • Mock Data Generation - Create realistic test datasets
  • Interactive Chat - Get help with any dcupl task

Core Concepts

Artifacts

AI operations return artifacts - reusable outputs that can be integrated into your project:

Artifact Type Description Actions
model-definition dcupl model specification View, Edit, Use in project
mock-data Generated test dataset View, Export, Use as data source
workflow-template Workflow configuration View, Import to designer
quality-report Data quality analysis View issues and recommendations

Agent Mode

The AI can work in agent mode - autonomously executing multiple steps to complete complex tasks:

flowchart LR
  U[User Request] --> A{AI Analyzes}
  A --> T1[Tool Call 1]
  T1 --> T2[Tool Call 2]
  T2 --> R[Final Response]

Available tools:

  • model-infer - Generate model from data
  • data-lint - Analyze data quality
  • workflow-propose - Suggest workflows
  • mock-data - Generate test data

Model Generation

From Sample Data

Generate models automatically from your data:

  1. Open the AI Chat in the Console
  2. Drag and drop a CSV or JSON file
  3. Ask: "Generate a model from this data"
  4. Review the generated model
  5. Click Use Model to add to your project

Example:

products.csv
id,name,price,category,inStock
1,Laptop,999.99,Electronics,true
2,Mouse,29.99,Electronics,true
3,Desk,249.00,Furniture,false

The AI generates:

product-model.json
{
  "key": "product",
  "properties": [
    { "key": "id", "type": "int" },
    { "key": "name", "type": "string" },
    { "key": "price", "type": "float" },
    { "key": "category", "type": "string" },
    { "key": "inStock", "type": "boolean" }
  ]
}

AI-Inferred Features

The AI can detect and configure:

  • Data types - string, int, float, boolean, date, array
  • Validation rules - email format, URL format, numeric ranges
  • Enum values - when a field has limited distinct values
  • Nullable fields - based on missing data patterns
  • Relationships - when field names suggest references (e.g., customerId)

API Request

model-infer-request.ts
const response = await fetch('https://<your-project>.dcupl.com/v1/ai/models/infer', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    sample: [
      { name: 'John', age: 30, email: 'john@example.com' },
      { name: 'Jane', age: 25, email: 'jane@example.com' },
    ],
    hints: {
      targetModelDescription: 'Customer data model',
    },
  }),
});

const { artifacts } = await response.json();
// artifacts[0].payload contains the model definition

Data Quality Linting

Analyze Your Data

Get AI-powered insights into data quality issues:

  1. Open a data file in the Console editor
  2. Click the AI button
  3. Type: "Lint this data"
  4. Review the quality report

Quality Analysis

The AI checks for:

  • Missing values - Null or undefined fields
  • Type inconsistencies - Mixed data types in a column
  • Format issues - Invalid email, date, or URL formats
  • Duplicates - Duplicate records or keys
  • Outliers - Unusual or suspicious values
  • Referential integrity - Broken references between models

Quality Report Example

quality-report.json
{
  "artifactType": "quality-report",
  "payload": {
    "qualityIssues": [
      { "severity": "warning", "message": "5 records have missing email addresses" },
      { "severity": "error", "message": "Phone numbers have inconsistent formats" },
      { "severity": "warning", "message": "3 duplicate customer IDs found" }
    ],
    "recommendations": [
      "Add required validation for email field",
      "Standardize phone number format to E.164",
      "Add unique constraint on customer ID"
    ],
    "summary": {
      "totalRecords": 1000,
      "issueCount": 8,
      "qualityScore": 92
    }
  }
}

Workflow Proposals

Generate from Description

Create workflows using natural language:

  1. Open the AI Chat
  2. Describe your workflow: "Create a workflow that syncs products from an external API daily and sends a Slack notification if any fail"
  3. Review the proposed workflow
  4. Click Use Workflow to import

Example Conversation

User: "I need a workflow that fetches customer data from our CRM API, enriches it with order history, and updates our analytics database"

AI Response:

flowchart LR
  T[Scheduled Trigger
Daily at 6 AM] --> F[Fetch CRM Data] F --> E[Enrich with Orders] E --> U[Update Analytics DB] U --> N[Send Completion Report]

The AI generates a complete workflow template with:

  • Trigger configuration
  • HTTP request nodes with proper authentication
  • Data transformation scripts
  • Error handling

Script Refinement

Improve existing workflow scripts:

  1. Open a workflow in the designer
  2. Select a script node
  3. Ask: "Add error handling to this script"
  4. Review and apply the improved script
refined-script.ts
// Before
return items.map((item) => process(item.json));

// After (AI-improved)
return items
  .map((item) => {
    try {
      const result = process(item.json);
      return { json: result, metadata: { processedAt: Date.now() } };
    } catch (error) {
      console.error('Processing failed:', error.message);
      return {
        json: { error: error.message, original: item.json },
        metadata: { failed: true },
      };
    }
  })
  .filter((item) => !item.metadata?.failed);

Mock Data Generation

Create Test Data

Generate realistic mock datasets:

  1. Open your model definition
  2. Click AI and ask: "Generate 100 sample records"
  3. Review the generated data
  4. Click Use Data to add to your project

Example

For a customer model, the AI generates:

mock-customers.json
[
  {
    "key": "cust-001",
    "name": "Alice Johnson",
    "email": "alice.johnson@email.com",
    "phone": "+1-555-0101",
    "address": "123 Oak Street, Portland, OR 97201",
    "createdAt": "2025-03-15T10:30:00Z"
  },
  {
    "key": "cust-002",
    "name": "Bob Martinez",
    "email": "bob.martinez@email.com",
    "phone": "+1-555-0102",
    "address": "456 Pine Avenue, Seattle, WA 98101",
    "createdAt": "2025-03-16T14:22:00Z"
  }
]

The AI respects:

  • Field types and constraints
  • Validation rules (valid emails, phone formats)
  • Enum values
  • Referential integrity (if multiple models)

Interactive Chat

Chat Interface

Access the AI chat from anywhere in the Console:

  1. Click the Assistant icon in the toolbar
  2. Type your question or drag files into the chat
  3. Get streaming responses with artifacts

Features

  • Streaming responses - Real-time token streaming
  • File attachments - Upload JSON/CSV (max 50MB)
  • Multi-turn conversations - Context is maintained
  • Artifact generation - AI outputs can be used in projects

Example Conversations

User: "What's the best way to model a many-to-many relationship between products and categories?"

AI: "In dcupl, you can model many-to-many relationships using array references. Here's the recommended approach..."

{
  "key": "product",
  "properties": [
    { "key": "name", "type": "string" },
    { "key": "categories", "type": "Array<Reference<category>>" }
  ]
}

User: (drops CSV file) "Why is my data not loading correctly?"

AI: "I see some issues with your CSV file:

  1. Row 45 has a malformed date in the 'createdAt' column
  2. The 'price' column contains text values in 3 rows
  3. Some rows are missing the required 'id' field

Here's how to fix these..."

User: "How do I retry failed HTTP requests in a workflow?"

AI: "You can implement retry logic using error ports and conditional edges. Here's a pattern..."

Best Practices

Model Generation

  1. Provide representative data - Include all field variations and edge cases
  2. Use sufficient sample size - 10+ rows helps AI understand patterns
  3. Review generated models - Verify inferred types and add constraints
  4. Iterate - Regenerate if the first result isn't optimal

Data Linting

  1. Lint before deployment - Catch issues early
  2. Act on recommendations - Implement suggested validators
  3. Regular quality checks - Lint after data updates
  4. Document exceptions - Note intentional data patterns

Chat Usage

  1. Be specific - Clear instructions get better results
  2. Provide context - Include relevant files and constraints
  3. Iterate - Ask follow-up questions to refine outputs
  4. Review artifacts - Always verify AI-generated content

Configuration

Available Models

Model Use Case Iterations
Claude General AI tasks Up to 10

File Limits

  • Max file size: 50MB
  • Supported types: .json, .csv
  • Sources: Desktop drag-drop, Console file browser

Agent Configuration

agent-config.ts
{
  agentic: true,
  agentOptions: {
    maxIterations: 10  // Maximum tool calls per request
  }
}

What's Next?

  • Workflows - Build automated data pipelines
  • RAPI - Deploy REST APIs from your models
  • SDK Integration - Connect AI-generated models to your app