LyraLearn AI Learning Platform
Exams
← Module 21 Β· Data Architecture for AI
🎧 Listen

Pipelines and Quality

Once you know where the data lives, you need a repeatable path from source systems into the AI corpus. That path is a data pipeline, and its defining quality is not speed but trustworthiness: it must deliver the same clean result every time it runs, detect bad input before it poisons the index, and keep the corpus demonstrably fresh. Interviewers probe here because this is where AI projects quietly die β€” not in the model, but in a pipeline nobody can rerun safely.

An ingestion pipeline with a validation gate at the entrance, content-hash change detection skipping unchanged documents, and a nightly reconciliation loop comparing source to corpus.

ETL, ELT, and the AI corpus

Classic ETL (extract, transform, load) cleans and reshapes data before loading it; ELT lands raw data first β€” typically in a data lake or Azure Blob Storage β€” and transforms it inside the destination. For AI corpora, ELT usually wins: keep the raw documents immutable, then run transformation stages (text extraction, cleaning, chunking, embedding) as separate, re-runnable steps. When you improve your chunking strategy, you re-run one stage over preserved raw input instead of re-crawling every source system.

Validation at the gate

Quality checks belong at ingestion, not after users complain about wrong answers:

The robust pattern combines two triggers: change-driven processing (an event or webhook fires when a document is published) for low latency, plus a nightly reconciliation sweep that compares source against corpus to catch missed events and process deletions. Events keep you fresh; reconciliation keeps you correct.

Freshness SLAs and idempotency

Define a freshness SLA per source: "policy documents appear in the index within 15 minutes of publication; ticket history within 24 hours." Then measure it β€” record each document's source timestamp and ingestion timestamp, and alert when the gap breaches the SLA. Staleness is a silent failure mode: the pipeline looks green while the Tutor confidently cites last year's policy.

Every stage must be idempotent β€” running it twice produces the same corpus as running it once. Crashes and retries are normal; duplicate rows and double-embedded chunks must not be. Where a service both writes to its database and must notify the pipeline, use the outbox pattern: write the business change and an "event" row in the same transaction, and let a relay publish events from the outbox table. This closes the dual-write gap where the database commits but the notification is lost β€” with SQL Server, one transaction guarantees the pipeline eventually hears about every change. Exam shorthand: validate at the gate, hash for change detection, reconcile nightly, make everything idempotent.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.