---
title: "Discussion on \"Building a RAG Pipeline from Scratch: Embeddings, Vector Store, and Generation\" | Hashnode"
description: "Discussion on \"Building a RAG Pipeline from Scratch: Embeddings, Vector Store, and Generation\". Large language models know a lot, but not your data. They don't know last week's policy update, your product catalog, or your internal docs, and when asked anyway they may confidently make something u"
url: "https://hashnode.com/posts/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation/6aef1e788d6aa32adb2f1de8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building a RAG Pipeline from Scratch: Embeddings, Vector Store, and Generation](https://whoai.hashnode.dev/building-a-rag-pipeline-from-scratch-embeddings-vector-store-and-generation?utm_source=hashnode&utm_medium=feed)

Large language models know a lot, but not your data. They don't know last week's policy update, your product catalog, or your internal docs, and when asked anyway they may confidently make something u

Nov 7 · 5 min read · whoai.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#rag](https://hashnode.com/tag/rag)
-   [#azure](https://hashnode.com/tag/azure)
-   [#python](https://hashnode.com/tag/python)

## Written by

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

@whoai

  
[View profile](https://hashnode.com/@whoai)

Software engineer writing about AI coding tools, RAG, and Azure AI Search.

Software engineer writing about AI coding tools, RAG, and Azure AI Search.

## Responses 3

Markdown supported · ⌘↵ to post

[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.
