# When Not to RAG - Don't Tell the LLM What It Already Knows

DevFeed: [When Not to RAG - Don't Tell the LLM What It Already Knows](<https://devfeed.tech/articles/when-not-to-rag-don-t-tell-the-llm-what-it-already-knows-122510.md>)

Original publisher: [Read original article](<https://codeahoy.com/2024/09/18/you-dont-always-need-rag/>)

Author: Umer Mansoor

Published: 2024-09-18T00:00:00Z

Content type: article

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [AI Chat](<https://devfeed.tech/topics/ai-chat.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [AI Context Management](<https://devfeed.tech/topics/ai-context-management.md>), [knowledge cutoff](<https://devfeed.tech/topics/knowledge-cutoff.md>), [LLM observability](<https://devfeed.tech/topics/llm-observability.md>)

Tags: [ai-chat](<https://devfeed.tech/tags/ai-chat.md>), [chat](<https://devfeed.tech/tags/chat.md>), [edtech](<https://devfeed.tech/tags/edtech.md>), [llm](<https://devfeed.tech/tags/llm.md>), [pinecone](<https://devfeed.tech/tags/pinecone.md>), [rag](<https://devfeed.tech/tags/rag.md>), [retrieval](<https://devfeed.tech/tags/retrieval.md>), [retrieval-augmented-generation](<https://devfeed.tech/tags/retrieval-augmented-generation.md>), [search](<https://devfeed.tech/tags/search.md>), [semantic-search](<https://devfeed.tech/tags/semantic-search.md>)

## AI overview

The article argues that RAG should be selective: models can answer many general questions without retrieved context, while private, frequently changing, or citation-dependent information can require it. In an education chat product, retrieving documents for every query added latency and sometimes made otherwise sound answers strange. The team routed general questions to the model without RAG, moved its response judge off the blocking path for asynchronous review, and injected concise course details into prompts. It also ran document search in parallel and displayed results as related materials. In an A/B test, the changes improved latency and reduced student abandonment, while document clickthrough rose. The author cautions that retrieval adds latency, API cost, and risk of degrading answers; judges can impede streaming. The account favors revisiting these tradeoffs as models improve and notes that grounding depends on high-quality source material.

## Source excerpt

Let me try to describe RAG, or Retrieval Augmented Generation, in one sentence: before you ask the LLM a question, you go find some documents that might help and paste them into the prompt as supporting evidence. When a student asks an LLM what a derivative is, the LLM gives a great response on its own. It has read more math and calculus books than any of us ever will. It doesn't need the Wikipedia page on derivatives as supporting evidence. Now imagine the same student asking 'what's on my MATH 101 midterm next week?' The LLM has no clue. The MATH 101 syllabus that was updated at the start of the semester wasn't part of the model's training data. This is what RAG fixes. RAG is a good technique. It's also easy to overuse. In this blog post, let's look at what overusing RAG did to one product experience. Context Suppose you are a hands-on manager of multiple teams at an Edtech company. After yet another reorg as AI eats away your business, you've just inherited the AI team. Some months earlier, the team shipped an AI chat for students, which is also yours now. This is how the system works: A student sends a chat message. A tiny classifier model detects intent. Semantic search runs over the document library (RAG) to find relevant documents. The best chunks are sent to the LLM along with the system prompt and the student's message (RAG). The LLM's response goes through a judge (another LLM call). The response is sent to the student. That's a lot of steps for a single response. Worse yet, none of the calls were parallelized. Let's look at some rough numbers. The classifier is very fast and takes a few 100 milliseconds. The semantic search (Pinecone) adds another 300-500ms. The main LLM call, with 3-4k tokens of context, adds 6-8 seconds. Then comes the judge. An older, smaller model to keep costs down. It has a rubric in its system prompt and grades the response against the query and the rubric, adding another 3-5s. Average response takes about 10 seconds. Your design t