<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Embeddings on PG Blog</title><link>https://pg-blogs.netlify.app/tags/embeddings/</link><description>Recent content in Embeddings on PG Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 04 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://pg-blogs.netlify.app/tags/embeddings/index.xml" rel="self" type="application/rss+xml"/><item><title>RAG From Scratch in Java</title><link>https://pg-blogs.netlify.app/posts/20-rag-from-scratch-in-java/</link><pubDate>Sat, 04 Jul 2026 00:00:00 +0000</pubDate><guid>https://pg-blogs.netlify.app/posts/20-rag-from-scratch-in-java/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Retrieval-augmented generation (RAG) is the pattern behind almost every &amp;ldquo;chat with your documents&amp;rdquo; feature: instead of hoping a model already knows the answer, you find the passages most likely to contain it and hand them to the model as context. Done well, it&amp;rsquo;s the single highest-leverage technique for keeping an LLM application grounded in facts it didn&amp;rsquo;t memorize.&lt;/p&gt;
&lt;p&gt;This post builds RAG &lt;strong&gt;from scratch&lt;/strong&gt; — no vector database, no framework — so the mechanics are visible end to end: splitting documents into chunks, turning them into embeddings, searching them with nothing more than array math, reranking the results, and generating a grounded answer. It builds directly on the grounding discipline from &lt;a href="https://pg-blogs.netlify.app/posts/11-building-reliable-llm-apps-in-java/"&gt;Building Reliable LLM Applications in Java&lt;/a&gt; — &amp;ldquo;give the model the source material and instruct it to answer only from that material&amp;rdquo; — by showing where that source material actually comes from. We&amp;rsquo;ll close with the question every RAG design eventually has to answer honestly: when does retrieval beat simply pasting more into the context window?&lt;/p&gt;</description></item><item><title>RAG From Scratch in Python</title><link>https://pg-blogs.netlify.app/posts/21-rag-from-scratch-in-python/</link><pubDate>Sat, 04 Jul 2026 00:00:00 +0000</pubDate><guid>https://pg-blogs.netlify.app/posts/21-rag-from-scratch-in-python/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Retrieval-augmented generation (RAG) is the pattern behind almost every &amp;ldquo;chat with your documents&amp;rdquo; feature: instead of hoping a model already knows the answer, you find the passages most likely to contain it and hand them to the model as context. Done well, it&amp;rsquo;s the single highest-leverage technique for keeping an LLM application grounded in facts it didn&amp;rsquo;t memorize.&lt;/p&gt;
&lt;p&gt;This post builds RAG &lt;strong&gt;from scratch&lt;/strong&gt; — no vector database, no framework — so the mechanics are visible end to end: splitting documents into chunks, turning them into embeddings, searching them with nothing more than array math, reranking the results, and generating a grounded answer. It builds directly on the grounding discipline from &lt;a href="https://pg-blogs.netlify.app/posts/10-building-reliable-llm-apps-in-python/"&gt;Building Reliable LLM Applications in Python&lt;/a&gt; — &amp;ldquo;give the model the source material and instruct it to answer only from that material&amp;rdquo; — by showing where that source material actually comes from. We&amp;rsquo;ll close with the question every RAG design eventually has to answer honestly: when does retrieval beat simply pasting more into the context window?&lt;/p&gt;</description></item></channel></rss>