Artificial Intelligence1 min read

Web Scraping for RAG: Build a Reliable Pipeline with Zyte API, Qdrant and LangChain

By · Published by Everything Blog

In short

Retrieval-augmented generation separates dynamic knowledge from core models to provide citations and updates without retraining, but it cannot fully eliminate factual errors. A 2024 study revealed that even legal research tools using this architecture experienced hallucination rates between 17% and 33%. To mitigate data loss from bot blocks, engineers implemented a Python backend using Zyte API, LangChain, and Qdrant for an online bookstore assistant. This safeguards vector records by blocking empty scrapes from wiping out previously indexed knowledge.

Key points

  • Systems scraping public web data risk generating false outputs if anti-bot protections ca…: Systems scraping public web data risk generating false outputs if anti-bot protections cause them to index empty pages.
  • Research from Thinking Machines Lab demonstrated that underlying model inference remains…: Research from Thinking Machines Lab demonstrated that underlying model inference remains nondeterministic even when running at zero temperature.
  • Ingestion pipelines must actively verify web responses to prevent failed fetches from ove…: Ingestion pipelines must actively verify web responses to prevent failed fetches from overwriting accurate vector store entries.

Sources checked by our analysis pipeline: 1

Web scraping for RAG looks simple until the pipeline fails without telling anyone: a retrieval-augmented generation (RAG) pipeline that reads from the public web can get a 403 from a bot check, or a 200 that contains an empty JavaScript shell, and the pipeline either indexes that shell as if it were a real page or keeps serving last month's copy, while the chatbot on top answers with the same confidence it had when the data was good.

This article builds the backend of a chat help bot for an online bookstore: a small, tested Python pipeline built on LangChain, Qdrant, and Zyte API that treats a blocked or empty page as a first-class outcome, fetches pages as LLM-ready Markdown, and refuses to let a bad fetch replace good data in the vector store. All of the code is in the companion repository, zytelabs/zyte-rag-pipeline, and every measurement of the pipeline below comes from running it.

What is RAG, and why does it need web data?

The term comes from a 2020 paper by Patrick Lewis and colleagues, Retrieval-Augmented Generation for…

Artificial Intelligence