---
title: "Automating Data Ingestion with a RAG Flywheel"
description: "Zalando's Supply Operations automates mapping of diverse supplier spreadsheet headers (10-60 columns) onto a 55+ column internal schema using an LLM-driven RAG flywheel that learns from human-approved mappings."
url: "https://swe.quest/articles/automating-data-ingestion-with-a-rag-flywheel-a00e5b0ced1109c4"
canonical: "https://engineering.zalando.com/posts/2026/10/structure-automating-data-ingestion-with-a-rag-flywheel.html"
source: "Zalando Engineering"
published: "2026-10-11"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["rag","llms","vector-search","postgres","data-pipelines"]
---

# Automating Data Ingestion with a RAG Flywheel

A post on [Zalando Engineering](https://swe.quest/sources/zalando.md), published 2026-10-11, 13 min read, Case study. Original: [https://engineering.zalando.com/posts/2026/10/structure-automating-data-ingestion-with-a-rag-flywheel.html](https://engineering.zalando.com/posts/2026/10/structure-automating-data-ingestion-with-a-rag-flywheel.html)

## Summary

Zalando's Supply Operations automates mapping of diverse supplier spreadsheet headers (10-60 columns) onto a 55+ column internal schema using an LLM-driven RAG flywheel that learns from human-approved mappings. Generation runs on AWS Bedrock at temperature 0 with forced tool calling, and the API stays the decision boundary: it rejects unknown source or target columns and invalid confidence scores, and it enforces full coverage and stable ordering. Cold-start uploads rely on zero-shot deduction. Warm starts embed each column as name, type and sample values with Titan V2 (1024 dimensions), then query pgvector with an HNSW index for the top 3 matches above 0.8 cosine similarity, ranked by approval count to resist drift, and inject them as historical context.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)

## Prerequisites

- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

pgvector, AWS Bedrock, Amazon Titan Text Embeddings V2, Claude Sonnet, HNSW, OpenAI SDK, Zalando

## Related posts

- [Building Data-Aware AI Applications with Heroku AI and LlamaIndex](https://swe.quest/articles/building-data-aware-ai-applications-with-heroku-ai-and-llamaindex-8f85403b0aabecc2.md): Heroku Engineering · 2025-08-19 · Medium · 4 min read · RAG & retrieval, Vector search, PostgreSQL, Python, LLMs
  A RAG stack on Heroku pairs LlamaIndex for ingestion, indexing and retrieval with Heroku Managed Inference (Claude 4 Sonnet via an OpenAI-compatible API), Cohere Embed Multilingual for embeddings, and Heroku Postgres with pgvector as the vector store.
- [Building a RAG pipeline for Google Analytics with ClickHouse and Amazon Bedrock](https://swe.quest/articles/building-a-rag-pipeline-for-google-analytics-with-clickhouse-and-amazon-bedrock-e2945701d51424da.md): ClickHouse · 2023-11-21 · Medium · 26 min read · RAG & retrieval, LLMs, Vector search, Analytics & OLAP, Cloud platforms
  A natural language interface over raw Google Analytics data stored in ClickHouse is built as a multi-step RAG pipeline that generates SQL from user questions using Amazon Bedrock models.
- [Building a RAG application with Llama 3.1 and pgvector](https://swe.quest/articles/building-a-rag-application-with-llama-3-1-and-pgvector-aa7660e0eb99da02.md): Neon · 2024-07-30 · Medium · 12 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs, Python
  A small RAG pipeline built on Neon Postgres with pgvector as the vector store, OctoAI's gte-large embedding model producing 1024-dimensional vectors, and Llama 3.1 405B generating answers.
- [Inside OpenAI’s in-house data agent](https://swe.quest/articles/inside-openai-s-in-house-data-agent-55ba2e68b590558a.md): OpenAI · 2026-01-29 · Medium · 13 min read · AI agents, RAG & retrieval, Analytics & OLAP, Evaluation, LLMs
  OpenAI built an internal GPT-5.2-powered data agent that answers natural-language analytics questions over a platform of 600+ PB and 70k datasets, available via Slack, web, IDEs, Codex CLI and ChatGPT through MCP.
- [ChatGPT plugins now support Postgres & Supabase](https://swe.quest/articles/chatgpt-plugins-now-support-postgres-supabase-db9d10a95a8d96b9.md): Supabase · 2023-05-25 · Medium · 7 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs
  Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
