Where RAG Fails: Understanding the Limitations of Retrieval-Augmented Generation
8 min readBefore we jump into RAG we must undertand the pros and cons of an LLM this will lead us to understand the RAG systems better.
Issues that we face in LLM
-
The knowledge cutoff: An LLM is trapped in the past, based on it’s strict cutoff date, when it’s data was collected
-
Hallucinations: When the training data doesn’t contain a specific fact, the LLM are unable to verify the fact, it will return a fluent and convencing output, but entirely missleading information.
-
Lack of Contextual and Proprietary Memory: A model know’s nothing about your project until you explicitly paste user-specific history in prompt window, this leads to consumption of lot more token. Also due to context window size the model may hallucinate.
-
Inability to access private data: A standalone LLM know nothing outside the public training data on which it is trained on. It knows nothing about your specific world your company’s internal codebase, private project requirements, personal notes, or localized database schemas. Also you cannot use it to analyze internal business intelligence, debug closed-source team files, or automate workflows that depend on private data unless you manually copy-paste massive chunks of text into the prompt window (which hits context window limits).
And that’s where the RAG comes into picture, to solve all of this issues
What is RAG ?
Retrieval-Augmented Generation (RAG) is an architectural pattern designed to solve the issue that we face with a standalone LLM. where the standalone llm answers question only on pre trained public data, when we use RAG it scans for external source like database, local files, web search, to answer the questions.
Why RAG was introduced
-
Fine-Tuning is Expensive and Slow: Fine-tuning a model is expensive and slow, this requires massive computational power, ML expertise, and hours or even days of training time.
The RAG solution: RAG requires zero changes to the model’s core weights. You just connect the LLM to a database. It can access new data instantly without a single second of retraining. -
Static Training Can’t Handle Dynamic Data: If your data changes daily like stock prices, inventory levels, job listings, or daily code commits fine-tuning is useless. You cannot re-train a big parameter model every twenty minutes.
The RAG Solution: Because RAG pulls fresh data in real time right when a query is made, your system is always perfectly up to date. -
Fine-Tuning Doesn’t Stop Hallucinations: Even if you fine-tune a model on your private documents, it can still misremember the details and hallucinate numbers or terms because it’s still just guessing the next word based on probability.
The RAG Solution: By forcing the model to read the source material as it types, hallucinations drop dramatically. The model is constrained to the facts right in front of it. -
Data Security and Access Control: If you train a single corporate model on all company data, a low level employee could ask the model about executive salaries, and it might answer. There is no way to put access permissions inside a model’s neural network.
The RAG solution: You can apply standard database security to your data retrieval step. If a user doesn’t have permission to see a document, the RAG system simply won’t retrieve it, ensuring the LLM never sees it either.
How a basic RAG pipeline works

Indexing of Data
Think of indexing as the “preparation stage.” Before an AI can answer questions using your data, it first needs to read, organize, and store that data in a format it actually understands.
Steps for indexing data
-
Data Ingestion: This is your raw, unstructured data. It could be PDFs, Markdown files, text documents, or API responses.
-
Text Extraction: The system strips away the formatting, tables, or file metadata to extract the raw text content from those documents.
-
Chunking: LLM have a limited memory capacity (context window) and get confused by massive amount of text. “Chunking” cuts the long extracted text into smaller, manageable pieces (usually a few sentences or paragraphs per chunk).
-
Vector Embeddings: Computers don’t understand words, they understand numbers. The chunks of text are passed through an Embedding Model (as shown in the diagram). This model converts each text chunk into a long list of numbers called a Vector (like the [1, 42, 8, 6, 45] in the diagram).
These numbers aren’t random. They mathematically represent the meaning and concept of the text. If two chunks talk about similar topics (e.g., “Dog” and “Animal”), their number lists will look very similar mathematically.
-
Vector DB Store: Finally, these mathematical vectors are saved into a Special Vector Database (like Qdrant, Pinecone, Chroma, or Milvus).
Steps for Data Retrieval & Generation

User Query: A user types a question or prompt into the system (eg, “Why there is so much ghee in dosa” ).
Query Embedding: Just like the documents during indexing, the user’s question must be translated into numbers. The query is passed through the exact same Embedding Model, which converted the question into a mathematical vector (like the [3, 6, 7, 45] in the diagram).
Similarity Search: The query vector is sent to the Vector Database. The database performs a mathematical comparison between this new query vector and all the pre-stored document chunk vectors. It instantly identifies and pulls out the chunks whose numbers are closest to the query’s numbers.
Prompt Augmentation: The system retrieves those matching chunks and combines them with the user’s original question. It wraps them together into a single structured prompt.
LLM Generation: This combined prompt (Original Question + Retrieved Chunks) is sent to the LLM. The LLM reads the provided facts, reasons through the context, and generates a highly accurate, grounded response back to the user.
Common Scenario where RAG works well
Internal Corporate Knowledge Bases
Companies have thousands of pages of internal PDFs, HR policies, onboarding guides, and compliance documents scattered across drives.
You can’t upload 5000 pages into a prompt every time, and you can’t train a public LLM on private corporate data. That’s where the RAG comes into picture RAG indexes the internal data and now employee can ask question to the RAG model.
Customer Support Automation & Intelligent Chatbots
Standard chatbots rely on rigid, hardcoded decision trees. RAG upgrades these to handle complex, natural-language customer inquiries using up-to-date product manuals.
If a product manual updates or there are some new features added in the product, you don’t need to train the model, you can simply swap the documents.
Intelligent Developer Assistants
Engineers working on large enterprise codebases often spend more time finding where a feature is implemented than actually writing code.
Chunking the entire repository user can ask where the authentication logic is implemented and undertand the flow of code, faster and quickly.
Algorithmic Learning & Educational Platforms
While consuming educational content from websites like youtube and other streaming platform, or solving DSA problems on platforms like leetcode, If user ask to explain a complex algorithum or undertand something from a video they can easily ask the RAG model and it will answer them based on video content.
Why RAG sometimes give incorrect answers
Bad Chunking Strategy: If text is chopped up poorly (eg, cutting a sentence or function completely in half), critical context is lost before it even reaches the database.
Semantic Search Mismatch: The vector database might fetch documents that sound similar to the query but don’t actually contain the specific factual answer required.
Outdated or Conflicting Data: If the database contains multiple versions of a document (e.g., an old 2024 docs and a new 2026 docs), the system might pull the obsolete data and treat it as current truth.
Context Overload: If the retrieval step dumps too many documents into the prompt at once, the LLM can get overwhelmed and overlook the correct answer hidden in the middle of the text.
Over-Reliance on Parametric Memory: If the retrieved text contradicts what the LLM originally learned during its base training, it may ignore the provided documents entirely and fall back on its own internal assumptions.
Formatting or Synthesis Failure: The LLM might fetch the correct data snippets but fail to stitch them together logically, resulting in an answer that misinterprets the relationship between the facts.
When RAG is not the right solution
When You Need to Teach the Model a Brand New Skill
RAG provides context not capability. It cannot teach an LLM a new programming language, a specific coding syntax style that it doesn’t already understand structurally.
When Your Primary Need is Reasoning, Logic, or Creativity
RAG usually tries to find facts based on it’s internal private data and not on any external fact so the problems which require external knowledge outside the knowledge base that we have provided RAG doesn’t perform well enough.
When the Context is Static, Small, and Fits in the Prompt
If you have a small product manual, or a small codebase, building full vector database infrastructure is massive engineering overkill. Mordern LLM have a huge context window if your data is not so big directly give it to LLM and ask for answers, even zero shot and few shot prompting work at this level of data.
When Ultra-Low Latency is Critical
RAG pipeline require multiple network roundtrip, from chunking the user query, searching it in vector database , sending the retrived data back to LLM for answering and the showing the results, this multi step process introduces delay.