---
title: "Discussion on \"Day 17: pdf_loader.ipynb — ChromaDB, a Retriever, and a Lying Score\" | Hashnode"
description: "Discussion on \"Day 17: pdf_loader.ipynb — ChromaDB, a Retriever, and a Lying Score\". My retriever said nothing matched. The right chunk was in the database the whole time."
url: "https://hashnode.com/posts/day-17-pdf-loader-ipynb-chromadb-a-retriever-and-a-lying-score/6aae8907995f9f3f1a702232"
---

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

Discussion

# [Day 17: pdf\_loader.ipynb — ChromaDB, a Retriever, and a Lying Score](https://parthkg.hashnode.dev/day-17-pdf-loader-ipynb-chromadb-a-retriever-and-a-lying-score?utm_source=hashnode&utm_medium=feed)

My retriever said nothing matched. The right chunk was in the database the whole time.

Sep 19 · 5 min read · parthkg.hashnode.dev  
Read the article

-   [#machine-learning](https://hashnode.com/tag/machine-learning)
-   [#python](https://hashnode.com/tag/python)
-   [#rag](https://hashnode.com/tag/rag)
-   [#chromadb](https://hashnode.com/tag/chromadb)
-   [#vector-database](https://hashnode.com/tag/vector-database)

## Written by

[Parth krishan Goswami](https://hashnode.com/@ParthKG)

@ParthKG

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

Learning AIML with everyone

## Responses 2

Markdown supported · ⌘↵ to post

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

[Sep 20](https://hashnode.com/posts/day-17-pdf-loader-ipynb-chromadb-a-retriever-and-a-lying-score/6aae8907995f9f3f1a702232/comment/6ab047438bb6af4e322ff417)

"A lying score" is the right title, and the specific trap is that cosine distance is not calibrated across queries. A 0.4 on one question and a 0.4 on another do not mean the same thing, so any absolute threshold you pick from one example will misfire on the next.

What made this debuggable for me was checking two things side by side: the rank of the chunk you know is correct, and whether a plain keyword search finds it. If BM25 returns it at rank 2 and vector search does not see it at all, the problem is the embedding or the index rather than the corpus, and you have eliminated half the search space in about a minute.

[Mihai\_LeanZero](https://hashnode.com/@mihaileanzero)

[Sep 19](https://hashnode.com/posts/day-17-pdf-loader-ipynb-chromadb-a-retriever-and-a-lying-score/6aae8907995f9f3f1a702232/comment/6aaeddd9ae73beedbe30dcf2)

This is the exact bug I'd expect and most writeups skip it. Good catch showing the raw distances instead of just the fix. One thing worth adding: 1 - distance only looked like similarity because MiniLM happens to emit unit-length vectors. That's a property of that model, not of Chroma or your retriever code. Swap embedding models later and if the new one isn't reliably unit-norm, the scores don't break loudly, they just get quietly worse. Normalizing embeddings yourself right after generation, even when the model already does it, means that failure mode never comes back.
