What is re-ranking in the context of RAG? Why not just show the code if it’s only 5 lines?
Production RAG: what I learned from processing 5M+ documents
21–30 of 116 posts
Re: Production RAG: what I learned from processing 5M+ documents
#22> What moved the needle: Query Generation What does query generation mean in this context, it’s probably not SQL queries right?
It's described in the remainder of the point - they use an LLM to generate additional search queries, either rephrasings of the user's query or bringing additional context from the chat history.
One of the key features in Claude Code is "Agentic Search" aka using (rip)grep/ls to search a codebase without any of the overhead of RAG.
Sounds like even RAG approaches use a similar approach (Query Generation).
Re: Production RAG: what I learned from processing 5M+ documents
#23> What moved the needle: Query Generation What does query generation mean in this context, it’s probably not SQL queries right?
Re: Production RAG: what I learned from processing 5M+ documents
#24> Reranking: the highest value 5 lines of code you'll add. The chunk ranking shifted a lot. More than you'd expect. Reranking can many times make up for a bad setup if you pass in enough chunks. We found the ideal reranker set-up to be 50 chunk input -> 15 output. What is re-ranking in the context of RAG? Why not just show the code if it’s only 5 lines?
Here's sample code: https://docs.cohere.com/reference/rerank
Re: Production RAG: what I learned from processing 5M+ documents
#25Re: Production RAG: what I learned from processing 5M+ documents
#26Embedding based RAG will always just be OK at best. It is useful for little parts of a chain or tech demos, but in real life use it will always falter.
Re: Production RAG: what I learned from processing 5M+ documents
#27They should've tested other embedding models, there are better ones than openai's (and cheaper)
Re: Production RAG: what I learned from processing 5M+ documents
#28I concur: The big LLM-based rerankers (e.g. Qwen3-reranker) are what you always wanted your cross-encoder to be, and I highly recommend giving them a try. Unfortunately they're also quite computationally expensive. Your metadata/tabular data often contains basic facts that a human takes for granted, but which aren't repeated in every text chunk - injecting it can help a lot in making the end model seem less clueless.…
Re: Production RAG: what I learned from processing 5M+ documents
#29Embedding based RAG will always just be OK at best. It is useful for little parts of a chain or tech demos, but in real life use it will always falter.
The difference is this feature explicitly isn't designed to do a whole lot, which is still the best way to build most LLM-based products and sandwich it between non-LLM stuff.
Re: Production RAG: what I learned from processing 5M+ documents
#30They should've tested other embedding models, there are better ones than openai's (and cheaper)
Which do you suggest?