Data Extraction

Extract structured data from unstructured text using AI. The minded-extraction tool uses LLM capabilities to parse content and return data in a predefined format.

Overview

  • Structured Extraction with Zod Schema: Define exact data structure

  • Prompt-based Extraction: Extract information using custom prompts

  • Validation and Retries: Automatic validation with configurable retry logic

  • Structured Output Support: Uses LLM native structured output when available

Using in Flows

- id: extractCustomerInfo
  type: tool
  toolName: minded-extraction
  prompt: Extract customer name, email, and phone number from the message

Tool Parameters

Parameter
Type
Description
Required

content

string

Text to extract from

Yes

schema

object

Zod-compatible schema

No

systemPrompt

string

Custom instructions

No

examples

array

Input/output examples

No

strictMode

boolean

Enable validation (default: true)

No

maxRetries

number

Retry attempts on failure (default: 3)

No

defaultValue

any

Fallback value

No

Overriding Parameters in Flows

Available schema field properties:

  • type: 'string', 'number', 'boolean', 'array', or 'object'

  • description: Optional field description

  • required: Optional boolean (defaults to true)

Programmatic Usage

How It Works

  1. With Structured Output Support: Uses LLM's withStructuredOutput for direct schema-compliant extraction

  2. Fallback Mode: Generates prompt with schema description, parses JSON, validates against Zod schema, retries with error feedback

  3. Non-strict Mode: Skips validation for flexible extraction

Last updated