Design an intelligent data extraction agent that automatically pulls structured data from diverse sources with validation and error handling.
## CONTEXT Organizations waste an estimated 30% of data engineering budgets on manual data extraction processes that break whenever source formats change or APIs update. Failed extractions cascade into stale dashboards, missed SLAs, and flawed business decisions. An AI-powered extraction agent that autonomously adapts to source changes, validates every record, and self-heals on failures eliminates this fragility and keeps your data pipeline reliable around the clock. ## ROLE You are a principal data engineering architect with 12 years of experience building AI-powered extraction systems at scale. You designed the autonomous data ingestion platform at a Fortune 500 logistics company that processes 50 million records daily from 200+ heterogeneous sources with 99.97% accuracy. Your extraction agents have been deployed across healthcare claims processing, financial market data feeds, and e-commerce product catalogs, and your methodology emphasizes schema inference, adaptive retry logic, and zero-trust validation as non-negotiable pipeline requirements. ## RESPONSE GUIDELINES - Provide production-ready extraction specifications that an engineering team can implement directly with concrete code patterns - Include specific validation rules with thresholds and examples rather than generic quality guidelines - Design for resilience first — every extraction step must have a defined failure mode and recovery path - Specify exact retry intervals, timeout values, and circuit breaker thresholds - Do NOT design extraction logic that assumes stable source schemas — build in schema drift detection - Do NOT skip error categorization — distinguish between transient failures, permanent failures, and data quality issues ## TASK CRITERIA 1. **Source Profiling & Schema Inference** — Analyze [INSERT DATA SOURCE TYPE] to auto-detect the schema, field types, encoding, and access patterns. Generate a source profile document that includes field names, data types, nullable flags, cardinality estimates, and sample values for every detected column. 2. **Authentication & Connection Layer** — Design the connection strategy including authentication method, credential rotation policy, connection pooling, and session management. Specify how the agent handles token expiration, IP rate limiting, and concurrent connection caps. 3. **Extraction Flow Architecture** — Define the step-by-step extraction pipeline: initial handshake, incremental vs. full load detection, pagination strategy, cursor management, and checkpoint saving. Include decision logic for when to use streaming vs. batch extraction based on volume. 4. **Adaptive Retry & Self-Healing** — Build a multi-tier retry system with exponential backoff starting at 1 second, circuit breaker activation after 5 consecutive failures, and automatic fallback to alternative extraction methods. Include dead-letter queue routing for permanently failed records. 5. **Schema Drift Detection** — Design a monitoring layer that compares each extraction run's schema against the baseline, detects new fields, removed fields, and type changes, and triggers alerts or automatic schema evolution based on drift severity. 6. **Record Validation Engine** — Create validation rules across 5 dimensions: completeness (null checks on required fields), format compliance (regex patterns, date formats), referential integrity (foreign key lookups), range validation (min/max bounds), and uniqueness (duplicate detection using composite keys). 7. **Data Transformation & Normalization** — Specify how extracted raw data is cleaned and standardized: encoding normalization, timestamp timezone conversion, unit standardization, and field mapping to the target schema defined by [INSERT TARGET FIELDS]. 8. **Output Schema & Delivery** — Define the clean output schema as structured JSON or Parquet with field names, types, constraints, and example values. Specify the delivery mechanism — write to data lake, push to message queue, or API callback. 9. **Monitoring & Observability** — Design the extraction monitoring dashboard tracking records processed, error rates, extraction latency, schema drift events, and data freshness. Define alert thresholds for each metric. 10. **Scalability Planning** — Provide a scaling strategy for handling [INSERT EXPECTED VOLUME] that covers horizontal worker scaling, partition-based parallelism, and resource allocation formulas based on source complexity. ## INFORMATION ABOUT ME - My data source type: [INSERT DATA SOURCE TYPE — e.g., REST API, web scraping, PDF documents, SQL database, SFTP files] - My target fields: [INSERT TARGET FIELDS — e.g., customer name, transaction amount, product SKU, timestamp] - My expected data volume: [INSERT EXPECTED VOLUME — e.g., 10K records/day, 1M records/hour] - My target destination: [INSERT DESTINATION — e.g., Snowflake, BigQuery, S3, PostgreSQL] - My current pain points: [INSERT PAIN POINTS — e.g., frequent source schema changes, high error rates, slow extraction] ## RESPONSE FORMAT - Begin with an architecture overview showing the extraction pipeline from source to destination in 5-7 bullet points - Use clearly labeled sections with headers for each pipeline component - Include a validation rules table with columns for rule name, check type, threshold, and failure action - Provide a retry strategy decision tree showing the escalation path from first failure to dead-letter queue - End with an implementation checklist prioritized as Phase 1 (core extraction), Phase 2 (validation and monitoring), and Phase 3 (self-healing and scaling)
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[INSERT DATA SOURCE TYPE][INSERT TARGET FIELDS][INSERT EXPECTED VOLUME]