Skip to main content

flightline learn

The learn command is an advanced tool used to refine your synthetic scenarios with patterns from real data. While Flightline can generate scenarios based on your code alone, learn allows you to provide concrete examples to enhance realism and domain accuracy.

Usage

flightline learn <path/to/sample.json>

When to use learn

Use this command when your discovery-based scenarios (from flightline generate --from-discover) are not specific enough for your domain. By providing a small sample of real data, you can help Flightline understand:
  1. Complex Schema Structure: Nested relationships that might be ambiguous in the code.
  2. Domain-Specific Logic: Inferred business rules (e.g., total must equal subtotal + tax).
  3. Realistic PII Patterns: Custom formats for IDs, emails, or addresses used in your industry.

Key Options

OptionDescription
--model, -mThe model used to analyze the data (default: google/gemini-3-flash-preview).
--output, -oPath to save the profile (default: profile.json).

Privacy and Security

A crucial feature of the learn command is that the resulting profile.json contains zero real data values. It extracts the metadata and statistical “DNA” of your dataset without retaining the sensitive “cells.” This makes it safe to check into version control or use in non-production environments.

Refining Generation

Once you have created a profile, use it with the generate command to create more grounded test data:
flightline generate --profile profile.json --count 100

Generate Refined Data

See how to use your learned profile for generation.