Event-Driven Document ETL Pipeline for RAG
Turns unstructured and semi-structured documents into a retrieval-ready knowledge base — a scale-to-zero worker that replaced a fragile three-Lambda chain.
▸ Implementation details
- Format-aware parsing (PDF/DOCX/PPTX/CSV/XLSX/JSON) with structure-preserving, section-aware chunking
- Per-document LLM entity extraction — 50-100x cheaper than per-chunk, and clinical/technical documents still fit in one call
- Hybrid retrieval: dense embeddings + sparse neural vectors + BM25, with a structural metadata prefix and IDF-weighted tags for ranking quality
- Native tabular data (CSV/XLSX) routed to a relational store for SQL-queryable access with row-level RBAC; PDF-extracted tables stay in the search index
- Content-hash idempotency, dead-letter handling, and per-item error isolation so one bad chunk never blocks a whole document