Skip to main content

Overview

Demonstrates how agents can extract structured data from unstructured text using the UseStructuredOutputs capability powered by Instructor. This pattern enables:
  • Form autofill: Extract lead/contact data from pasted text or web content
  • Data transformation: Convert unstructured text into validated PHP objects
  • Multi-step workflows: Chain extraction with API calls using metadata storage
  • Validation with retry: Automatic retry on validation failures
Key concepts:
  • UseStructuredOutputs: Capability for LLM-powered data extraction
  • SchemaRegistry: Pre-registered extraction schemas
  • structured_output: Tool to extract data into schema
  • AgentEventConsoleObserver: Provides visibility into agent execution stages

Example