RAG: from dumb implementation to serious results
summary
Shows concrete RAG fixes using LangChain4j and Gemini embeddings: switch sentence-plus-sliding-window chunks to avoid split facts, generate hypothetical questions per paragraph to index likely queries, and use query compression plus reranking to boost retrieval precision. Demonstrates an agentic pipeline with function-calling tools that issues topic-specific searches and composes answers; claims Gemini’s large context (up to 1 million token windows) and reranking recover correct facts (population examples: 3.85M vs ~3.7M) but warns of higher token costs and the need for evaluation.
AI-written summary · about
