Frequently Asked Questions
What is the most common mistake when building RAG?
The most common mistake is fixed-character chunking (splitting text strictly every 500 characters), which slices sentences and paragraphs in half, destroying their semantic meaning for both the embedding model and the generator LLM.
Why does my RAG system hallucinate when context is provided?
It hallucinates because the retrieved context was only topically adjacent rather than containing the exact answer, and your prompt failed to instruct the model to explicitly declare when information is missing.
Why does vector search miss exact error codes or product names?
Vector embeddings map words to general semantic concepts rather than preserving exact character strings. To find exact codes or SKUs, you must use hybrid search combining BM25 keyword matching with vector embeddings.
How many chunks should I inject into a RAG prompt?
For most standard applications, injecting the top 3 to 5 highly relevant chunks (approx. 1,000 to 2,000 tokens) provides the best balance between complete context and peak model attention.
How do you fix RAG in multi-turn chat applications?
Use query condensation: before searching the vector database, pass the chat history and the user’s latest message to a fast model to rewrite it into a self-contained, standalone search query.
Further Reading & Primary Sources
- Evaluating Retrieval-Augmented Generation Systems (opens in a new tab)arXivThe RAGAS framework analyzing the primary root causes of retrieval and generation failures.
- OWASP Top 10 for Large Language Model Applications (opens in a new tab)OWASPComprehensive security guidelines on managing hallucination, data leakage, and prompt boundaries.
Put This Into Practice with JobsDart Tools
Test and apply the principles from this guide directly using our dedicated career tools. Designed to eliminate guesswork and surface verified opportunities.
JobsDart Verified Job Discovery
Direct Recruiter ReviewExplore verified global, remote, and corporate tech openings with direct hiring team review and real-time application tracking.
JobsDart Free ATS Resume Checker
Instant AnalysisValidate that your resume formatting and keyword taxonomy match enterprise hiring standards before submitting.
