<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Francesco Ciannavei</title>
    <description>The latest articles on Forem by Francesco Ciannavei (@francesco_ciannavei_801e8).</description>
    <link>https://forem.com/francesco_ciannavei_801e8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1581413%2F70550cc8-8c6f-4e00-b9ab-4743726b6cc9.png</url>
      <title>Forem: Francesco Ciannavei</title>
      <link>https://forem.com/francesco_ciannavei_801e8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/francesco_ciannavei_801e8"/>
    <language>en</language>
    <item>
      <title>Local RAG with Go, Ollama, and Postgres (pgvector): a minimal guide</title>
      <dc:creator>Francesco Ciannavei</dc:creator>
      <pubDate>Sun, 09 Nov 2025 22:17:59 +0000</pubDate>
      <link>https://forem.com/francesco_ciannavei_801e8/local-rag-with-go-ollama-and-postgres-pgvector-a-minimal-guide-3d8d</link>
      <guid>https://forem.com/francesco_ciannavei_801e8/local-rag-with-go-ollama-and-postgres-pgvector-a-minimal-guide-3d8d</guid>
      <description>&lt;p&gt;This post contains an explaination on how the RAG (Retrieval-Augmented Generation) architecture works and some &lt;a href="https://github.com/FrancescoCiannavei/Local-rag-example/tree/main/examples" rel="noopener noreferrer"&gt;examples&lt;/a&gt;.&lt;br&gt;
The post is a shameless copy paste of the guide I made on github: &lt;a href="https://github.com/FrancescoCiannavei/Local-rag-example" rel="noopener noreferrer"&gt;https://github.com/FrancescoCiannavei/Local-rag-example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explaination
&lt;/h2&gt;

&lt;p&gt;Retrieval-Augmented Generation (RAG) is a popular alternative to fine-tuning large language models, it allows for more flexible content generation by leveraging pre-trained models and a retrieval mechanism.&lt;br&gt;
Content is stored on a database, relevant information to the user query can be found by transforming the query in a vector and using a vector search on a database to find the most relevant data to what the user is talking about.&lt;br&gt;
By storing the data on a database you can easly obtain it without training a model each time the data changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Request diagram
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Flocal-rag-example--user-request-diagram.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Flocal-rag-example--user-request-diagram.jpg" alt="local rag example user request diagram" width="800" height="502"&gt;&lt;/a&gt;&lt;br&gt;
This diagram shows how the reuqest from the user is handled.&lt;/p&gt;

&lt;h3&gt;
  
  
  Seed diagram
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Flocal-rag-example--application-seed-diagram.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Flocal-rag-example--application-seed-diagram.jpg" alt="local rag example application seed diagram" width="800" height="565"&gt;&lt;/a&gt;&lt;br&gt;
This diagram shows how data is stored for quick and precise retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google's AI Overview
&lt;/h2&gt;

&lt;p&gt;A popular example of RAG is Google's new AI Overview tool.&lt;/p&gt;

&lt;p&gt;When you search for something on Google the overview tool takes the top results from the search and &lt;strong&gt;tries to answer to your question using a RAG system&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is a perfect usecase for RAG, the data that is being fetched from search results is constantly changing, it would be impossible to train the model on new data each time someone makes an update, RAG allows more flexibility at the small cost of performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Fgoogle-ai-overview-rag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFrancescoCiannavei%2FLocal-rag-example%2Fmain%2Fassets%2Fgoogle-ai-overview-rag.png" alt="google AI Overview RAG" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Help
&lt;/h3&gt;

&lt;p&gt;If you happen to have any questions feel free to open a &lt;a href="https://github.com/FrancescoCiannavei/Local-rag-example/issues/new" rel="noopener noreferrer"&gt;GitHub issue&lt;/a&gt;, I'd be happy to help.&lt;/p&gt;






&lt;p&gt;This repo takes great inspiration from &lt;a href="https://github.com/timescale/private-rag-example" rel="noopener noreferrer"&gt;Private rag example&lt;/a&gt; by Timescale.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>go</category>
      <category>tutorial</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
