---
title: "Comment by Ahmet Özel on \"Building a RAG Pipeline from Scratch: Embeddings, Vector Store, and Generation\" | Hashnode"
description: "The ingestion example should inspect the per-document results returned by upload_documents. A batch request completing does not establish that every chunk was a"
url: "https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8/comment/6aef42afbd4ad8233da4e74e"
---

[Discussion](https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8)

Comment [Building a RAG Pipeline from Scratch: Embeddings, Vector Store, and Generation](https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 7](https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8/comment/6aef42afbd4ad8233da4e74e)

The ingestion example should inspect the per-document results returned by upload\_documents. A batch request completing does not establish that every chunk was accepted, and the current function discards the response entirely. That can make a retrieval miss look like an embedding or ranking problem when the expected chunk was never indexed.

I would add a fixture with one rejected document among otherwise valid chunks, then require ingestion to report the failed IDs and their errors. The retrieval evaluation can then run only after its expected corpus has actually been accounted for, rather than inferring successful ingestion from the absence of a thrown exception.

[Hu Jin](https://hashnode.com/@whoai)

[Nov 7](https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8/comment/6aef42afbd4ad8233da4e74e#reply-6aef4a6721f7eca6e70a168f)

Thanks for catching this—you’re right. The example discards the per-document results from upload\_documents, so a completed batch can hide rejected chunks and make an ingestion failure look like a retrieval problem. Checking each result and reporting failed IDs and errors belongs in this introductory example, not just a follow-up. Your mixed-success fixture is a good regression test, too: retrieval evaluation should only run once the expected corpus is accounted for. I’m planning a production RAG evaluation article later in the series, and this is an important prerequisite to cover there as well.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Nov 8](https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8/comment/6aef42afbd4ad8233da4e74e#reply-6aeff3253a42503095e3981d)

That prerequisite is also worth separating into accepted by ingestion and visible to the retrieval path. A second fixture could accept every document but delay search visibility for one expected chunk, so the evaluation cannot accidentally start against a partially available corpus.

A bounded readiness check with the expected chunk identifiers would then give a clear ingestion or readiness failure instead of lowering retrieval scores. Keeping that stage separate from relevance evaluation would make the introductory example and the later evaluation article easier to compare.
