<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed" -->

---
title: AI Interview #7 - Why is this chatbot failing? | daily.dev
description: A mock technical interview walks through debugging a low-accuracy RAG chatbot pipeline. The candidate diagnoses that pulling 20-25 chunks via vector similarity...
canonical: https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: AI Interview #7 - Why is this chatbot failing? | daily.dev
og:description: A mock technical interview walks through debugging a low-accuracy RAG chatbot pipeline. The candidate diagnoses that pulling 20-25 chunks via vector similarity...
og:url: https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed
og:image: https://api.daily.dev/og/posts/eAfbfCweD.png
og:image:alt: AI Interview #7 - Why is this chatbot failing?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Interview #7 - Why is this chatbot failing?

**[Gaurav Sen](https://daily.dev/sources/gkcs)** · 7 min read · 0 upvotes · 0 comments

## Summary

A mock technical interview walks through debugging a low-accuracy RAG chatbot pipeline. The candidate diagnoses that pulling 20-25 chunks via vector similarity pollutes the LLM's context window, causing hallucination and poor accuracy. The fix discussed is adding a cross-encoder reranker to re-score chunks via token-level matching rather than embedding similarity, then keeping only the top 5-10 highest-scoring chunks before passing them to the LLM. The conversation also covers why rerankers aren't used standalone (cost and scaling), the latency trade-off (50-100ms), and typical accuracy gains (5-10% on faithfulness and answer relevancy metrics).

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=dob12Lp2HZM>

## Questions this post answers

### Why is my RAG chatbot hallucinating or giving inaccurate answers even though retrieval seems to work offline?

Pulling too many chunks (like 20-25) into the context window pollutes it, creating a needle-in-a-haystack problem for the LLM that increases hallucination and reduces accuracy. Vector similarity search can also rank irrelevant chunks highly since embeddings struggle with negation, numeric ranges, and near-identical phrasing. Adding a cross-encoder reranker to filter down to the 5-10 most relevant chunks before generation typically improves faithfulness and answer relevancy by 5-10%.

_For teams tuning retrieval pipelines, daily.dev surfaces practical RAG debugging approaches like this one._

### What is the difference between vector similarity search and a reranker in a RAG pipeline?

Vector similarity search converts a query into an embedding and finds the closest vectors among thousands or millions of stored embeddings, which is cheap but can miss meaning like negation or numeric ranges. A reranker, typically a cross-encoder, instead compares the actual tokens of the query against the tokens of each candidate chunk individually, producing a more accurate token-level similarity score, though at higher computational cost, so it is used as a second filtering step rather than a replacement for vector search.

_Engineers deciding between retrieval architectures can track reranking trade-offs like these on daily.dev._

### How many chunks should I retrieve with top-k search before reranking in a RAG system?

A common pattern is retrieving 20 to 25 chunks with vector search first, then reranking and filtering down to 5 to 10 before passing them to the LLM. Retrieving a larger initial set helps surface relevant chunks that might otherwise be missed, while the reranking step removes irrelevant ones using token-level cross-encoder scoring, reducing context pollution and hallucination in the final answer.

_Developers tuning top-k and reranking thresholds can follow RAG optimization discussions on daily.dev._

## Similar posts on daily.dev

- [The AI Series: The Hardest Part of RAG, Part 2 — Why Perfect Chunks Still Give You Bad Retrieval](https://daily.dev/posts/the-ai-series-the-hardest-part-of-rag-part-2-why-perfect-chunks-still-give-you-bad-retrieval-4qoyry9kl) · Medium · 1 upvotes · 0 comments
- [How to reduce AI hallucinations in e-commerce: a practical guide to RAG](https://daily.dev/posts/how-to-reduce-ai-hallucinations-in-e-commerce-a-practical-guide-to-rag-5cwo1bb30) · Netguru · 0 upvotes · 0 comments
- [Most RAG Hallucinations Are Retrieval Failures: How the Retrieval Brick Decides What the Model Can Invent](https://daily.dev/posts/most-rag-hallucinations-are-retrieval-failures-how-the-retrieval-brick-decides-what-the-model-can-i-8ajbd1sn7) · Towards Data Science · 2 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#rag](https://daily.dev/tags/rag), [#vector-search](https://daily.dev/tags/vector-search)

[View this post on daily.dev](https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"AI Interview #7 - Why is this chatbot failing?","url":"https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed"},"datePublished":"2026-09-28T14:08:06.115Z","dateModified":"2026-09-28T14:08:34.139Z","description":"A mock technical interview walks through debugging a low-accuracy RAG chatbot pipeline. The candidate diagnoses that pulling 20-25 chunks via vector similarity...","image":"https://i.ytimg.com/vi/dob12Lp2HZM/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/dob12Lp2HZM/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Gaurav Sen","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Gaurav Sen","logo":"https://media.daily.dev/image/upload/s--Ttjtrbgk--/f_auto,q_auto/v1780213730/logos/gkcs?_a=BAMAMiWQ0","url":"https://daily.dev/sources/gkcs"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,rag,vector-search","timeRequired":"PT7M","video":{"@type":"VideoObject","name":"AI Interview #7 - Why is this chatbot failing?","description":"A mock technical interview walks through debugging a low-accuracy RAG chatbot pipeline. The candidate diagnoses that pulling 20-25 chunks via vector similarity...","thumbnailUrl":"https://i.ytimg.com/vi/dob12Lp2HZM/sddefault.jpg","uploadDate":"2026-09-28T14:08:06.115Z","duration":"PT7M","url":"https://api.daily.dev/r/eAfbfCweD","embedUrl":"https://www.youtube.com/embed/dob12Lp2HZM"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gaurav Sen","item":"https://daily.dev/sources/gkcs"},{"@type":"ListItem","position":3,"name":"AI Interview #7 - Why is this chatbot failing?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ai-interview-7---why-is-this-chatbot-failing--eafbfcwed#faq","mainEntity":[{"@type":"Question","name":"Why is my RAG chatbot hallucinating or giving inaccurate answers even though retrieval seems to work offline?","acceptedAnswer":{"@type":"Answer","text":"Pulling too many chunks (like 20-25) into the context window pollutes it, creating a needle-in-a-haystack problem for the LLM that increases hallucination and reduces accuracy. Vector similarity search can also rank irrelevant chunks highly since embeddings struggle with negation, numeric ranges, and near-identical phrasing. Adding a cross-encoder reranker to filter down to the 5-10 most relevant chunks before generation typically improves faithfulness and answer relevancy by 5-10%. For teams tuning retrieval pipelines, daily.dev surfaces practical RAG debugging approaches like this one."}},{"@type":"Question","name":"What is the difference between vector similarity search and a reranker in a RAG pipeline?","acceptedAnswer":{"@type":"Answer","text":"Vector similarity search converts a query into an embedding and finds the closest vectors among thousands or millions of stored embeddings, which is cheap but can miss meaning like negation or numeric ranges. A reranker, typically a cross-encoder, instead compares the actual tokens of the query against the tokens of each candidate chunk individually, producing a more accurate token-level similarity score, though at higher computational cost, so it is used as a second filtering step rather than a replacement for vector search. Engineers deciding between retrieval architectures can track reranking trade-offs like these on daily.dev."}},{"@type":"Question","name":"How many chunks should I retrieve with top-k search before reranking in a RAG system?","acceptedAnswer":{"@type":"Answer","text":"A common pattern is retrieving 20 to 25 chunks with vector search first, then reranking and filtering down to 5 to 10 before passing them to the LLM. Retrieving a larger initial set helps surface relevant chunks that might otherwise be missed, while the reranking step removes irrelevant ones using token-level cross-encoder scoring, reducing context pollution and hallucination in the final answer. Developers tuning top-k and reranking thresholds can follow RAG optimization discussions on daily.dev."}}]}
```

