Skip to main content
This cookbook demonstrates how to build an automated data enrichment pipeline using Model Inference. You’ll learn to fetch records from a dataset, run inference to classify or enrich each record, and handle results at scale.

What this recipe accomplishes

  • Fetch sample records from a dataset
  • Run AI inference to enrich each record with classifications
  • Handle inference results with proper error handling
  • Process records in batches for efficiency

Prerequisites

  • SDK installed and configured (see Authentication)
  • A dataset with records to enrich
  • A data plane ID where inference will run

Complete example

How it works

  1. Fetch records: The pipeline retrieves sample records from your dataset using getDatasetSample()
  2. Enrich with inference: Each record is sent to Model Inference with a prompt asking for classification and tagging
  3. Structured output: The JSON Schema ensures every response includes category, confidence, tags, and summary
  4. Batch processing: Records are processed in parallel batches with rate limiting between batches
  5. Error handling: Failed enrichments are tracked and reported without stopping the pipeline

Customizing the recipe

Different enrichment tasks

Change the schema and prompt for your use case:

Writing results back

Store enriched records in a new dataset:

Running Inference

Inference fundamentals

Batch Processing

Advanced batch patterns

Tracking Jobs

Monitor job status

Managing Datasets

Dataset operations