Data Foundations: The Substrate Everything Depends On

Model quality is bounded by data quality, and the defects you tolerate here — poor lineage, silent drift, unmanaged PII, careless retrieval — resurface downstream as hallucinations, bias, privacy incidents, and un-auditable decisions.

Every model, retrieval system, and evaluation downstream inherits the quality of the data beneath it. This is the phase teams are most tempted to rush, and the one whose shortcuts are most expensive later. “Garbage in, GenAI out” is not a slogan; it is the mechanism by which a powerful model produces confidently wrong output. This post is Phase 2 of the roadmap — establishing the governed, high-quality, well-described data substrate the rest of the system stands on.

Data quality as an engineered property

Treat data quality the way you treat code quality: as something tested and gated, not hoped for. Define the dimensions that matter — completeness, accuracy, consistency, timeliness, validity, uniqueness — and express them as automated tests and data contracts in your pipelines, failing the build on violation. A layered architecture (raw, cleansed, curated, in the medallion idiom) keeps each stage independently testable and makes it obvious where a defect entered. Quality that is not enforced in the pipeline degrades silently until it surfaces as a model failure no one can explain.

Lineage, cataloging, and PII

You cannot govern or debug what you cannot trace. Track where every dataset came from and where it flows, in a catalog that records ownership, sensitivity labels, and lineage. That catalog is the backbone of both governance (it answers “what data trained this, and may we use it?”) and incident response (it answers “what’s affected?”). The ability to trace data lineage and inference is also what makes decisions explainable and auditable — a requirement, not a nicety, for anything consequential.

PII deserves special, concrete discipline: strip or tokenize it across all stores — not just the training set, but the search indexes, caches, aggregates, and logs. The classic leak is sanitizing the training data and leaving personal data in the vector index or the request logs. Apply data minimization and purpose limitation from the start; this is where privacy-by-design stops being a policy word and becomes an implemented control. And remember that a right-to-erasure request must propagate into the vector index and caches too — a stale retrieved document is both a correctness and a privacy defect.

Retrieval is a data-engineering problem

For any system that grounds a model in your data, retrieval quality — not model choice — is usually the dominant lever on accuracy. That makes chunking, embedding, and indexing first-class engineering, not defaults to accept. The techniques below are roughly ordered by return on effort.

Because “lost in the middle” is real — models use the beginning and end of a long context better than the buried middle — retrieving fewer, better chunks and placing them well beats retrieving more.

Feature stores and vector stores are not the same thing

A recurring confusion worth settling: a feature store solves point-in-time-correct joins (preventing label leakage) and a shared online/offline store (eliminating training-serving skew) — it matters mainly for predictive and tabular ML. A vector store solves nearest-neighbor retrieval for grounded generation. They are different tools for different problems; a GenAI-only application often needs the vector store and not the feature store. Do not adopt one thinking it does the other’s job.

Labeling and synthetic data

Where you need labels, build labeling workflows with quality control and inter-annotator agreement, not ad-hoc tagging. Where you use synthetic data, generate it under governance and track its provenance so it is never silently conflated with real data — an unmarked synthetic record that leaks into evaluation or training quietly corrupts both.

The gate and anti-patterns

Phase 2 is done when curated, quality-tested datasets exist for the target use case with automated quality gates; lineage and sensitivity classification are queryable for every dataset in scope; PII handling is implemented across all stores including indexes and caches; and, for RAG systems, a retrieval design is documented and its retrieval quality is measurable. Avoid the recurring failures: pointing a powerful model at un-curated data and blaming the model; PII leaking via the side door of the vector index or logs; treating chunking and embedding as incidental; and running with no monitoring on input-data distributions — the silent drift the observability phase will need to catch.

Key takeaways

Further reading

Sources & References