Data Science

What is the best strategy for building a RAG pipeline with LangChain and vector stores?

VA Asked by Valerie Simmons · 15-08-2025
0 upvotes 16,758 views 0 comments
The question

I'm building a Retrieval-Augmented Generation (RAG) system for our technical manuals. My current setup often retrieves irrelevant chunks, causing the LLM to give wrong answers. Should I focus on changing my chunking strategy, or is the problem likely in the embedding model or the vector database retrieval settings? I'm using FAISS right now.

3 answers

0
NA
Answered on 12-09-2025

Improving RAG usually requires a multi-pronged approach. First, try "Parent Document Retrieval"—instead of passing small chunks to the LLM, you retrieve small chunks but pass the larger parent document for better context. Second, look at "Self-Querying" retrievers if your manuals have metadata like version numbers or categories. FAISS is great for speed, but ensure you are using a high-quality embedding model like text-embedding-3-small. Finally, adding a "Reranking" step with a Cross-Encoder after initial retrieval can dramatically filter out those irrelevant chunks you mentioned.

0
RA
Answered on 16-09-2025

Have you experimented with "Recursive Character Text Splitting" to ensure that your chunks don't break in the middle of a vital technical sentence?

VA 20-09-2025

Raymond, that change actually made a massive difference! Switching from a fixed-size splitter to the recursive one allowed the chunks to respect paragraph boundaries. The LLM now gets much more coherent snippets of information, which has almost entirely eliminated the hallucinations we were seeing earlier. It’s a simple change but incredibly effective for technical documentation where structure matters.

0
GR
Answered on 25-09-2025

Don't underestimate the power of a good system prompt. Sometimes telling the LLM to say "I don't know" if the context is weak is the best fix.

NA 28-09-2025

Spot on, Gregory. Guardrails in the prompt are just as important as the quality of the data coming out of the vector store.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

World globe icon Country: Canada

Book Free Session