<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="311841" data-post-id="311841">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh, definitely. If you have PDFs, you need to extract text from them for embeddings. Once you choose a LLM, you need to consider prompt engineering, window size, etc. Some models make it easier than others.</p>
<p>But those considerations all exist around the three main blocks I have mentioned and will vary per use case and per technology. That’s another reason why I would start with something off the shelf and then break it apart based on your needs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="311841" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-311841" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="311841"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="311900" data-post-id="311900">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="quda" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/quda/120/33107_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  quda
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is a great example. I will try to contact <a href="http://fly.io" rel="noopener nofollow ugc">fly.io</a> maybe get some insights on their experience.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="311900" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-311900" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="311900"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="311903" data-post-id="311903">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="quda" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/quda/120/33107_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  quda
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks Jose, obviously it is feasible RAG with Elixir.<br>
I’m facing the big challenge in persuading the customer to adopt this new (and exotic) approach, as they prefer to stick to tools and technologies that are “<em>well-established</em>”, “<em>industry-tested</em>” and take no risks. <img src="https://forum.elixirforum.com/images/emoji/apple/face_with_raised_eyebrow.png?v=15" title=":face_with_raised_eyebrow:" class="emoji" alt=":face_with_raised_eyebrow:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="311903" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-311903" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="311903"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="312017" data-post-id="312017">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dacello" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dacello/120/32993_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dacello
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For what its worth, my team at <a href="https://revelry.co/" rel="noopener nofollow ugc">Revelry</a> has been building a custom RAG-based application with Elixir/Phoenix over the past year, and I am really happy we decided to stick with Elixir.</p>
<p>I gave a brief breakdown of the steps needed to build a RAG flow (without LangChain) in this <a href="https://revelry.co/insights/artificial-intelligence/comparing-openais-assistants-api-custom-gpts-and-chat-completion-api/" rel="noopener nofollow ugc">blog post</a> (see the section about “How to build a RAG flow”). That article is primarily about comparing OpenAI’s API offerings, but the tangent about RAG that I gave is relevant, especially given that we did exactly that using Phoenix and Elixir. We are currently using OpenAI for our LLM, but the RAG part is really LLM agnostic. We could plug in open source models in place of GPT 4 if we wanted to, but right now it is getting us the best results.</p>
<p>Directly from the blog post linked above are the general steps to build a RAG flow:</p>
<ul>
<li>Set up a Vector Database
<ul>
<li>Options range from building it yourself in Postgres with <a href="https://github.com/pgvector/pgvector" rel="noopener nofollow ugc">PG Vector</a>, to open source VectorDB’s such as <a href="https://github.com/chroma-core/chroma" rel="noopener nofollow ugc">Chroma</a>, to a nice managed solution like <a href="https://www.pinecone.io/" rel="noopener nofollow ugc">Pinecone</a>.</li>
</ul>
</li>
<li>Enable uploading of documents to your system that need to go into the vectorDB (probably via some web interface)</li>
<li>Extract plain text from the files (can be more involved depending on the file type)</li>
<li>For each uploaded document, chunk the text based on content type
<ul>
<li>there are a lot of decisions to be made here in terms of how large the chunks are, what to separate the chunks on, how much overlap there should be, etc</li>
</ul>
</li>
<li>Convert those chunks into vector embeddings
<ul>
<li>You can use openAI’s embedding models via API, but you can also use any embedding model of your choice (open source or proprietary).</li>
</ul>
</li>
<li>Store those vector embeddings in your vector DB</li>
<li>Query against the vector DB using semantic search to pull relevant pieces of information out, and inject that info into a prompt before it’s sent to the LLM</li>
<li>Send the “retrieval augmented” prompt to the LLM to generate the stuff. Hence “Retrieval Augmented Generation”.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312017" data-batch-url="/posts/batch_likers">
                        23
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-312017" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312017"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="312310" data-post-id="312310">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="quda" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/quda/120/33107_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  quda
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Very interesting experience indeed. Many thanks for sharing it.<br>
Did you use this in production or just an internal experiment ?<br>
How did you perform the finetuning (PEFT/LoRA) of your model(s) ? Have you been also using Elixir for that?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312310" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-312310" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312310"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="312468" data-post-id="312468">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dacello" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dacello/120/32993_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dacello
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is definitely more than an experiment. We are building an application called <a href="https://prodops.ai/" rel="noopener nofollow ugc">ProdOps.AI</a> which has the goal of augmenting software/product delivery teams using generative AI. Its very much in its early stages, primarily being used by our internal teams and close partners, but we plan to release it out in the wild in the very near future. Don’t want to promote that here, but just for context the primary use cases (currently) include generating product roadmaps, backlogs, user stories, and implementation plans augmented with proprietary data that can be either synced up via an external data source (e.g. github/slack/google drive) or manually uploaded. We also built a pretty useful prompt template management system which allows for building prompts that can query against a given organization’s proprietary data based on user inputs at the time of generation. We initially created this prompt management system to enable our team to easily iterate on prompts for specific use cases, but it turned into a pretty useful generic RAG-based prompt management system. We hope to abstract some of the less opinionated/product development specific stuff out into open source tooling at some point, but that will take some time and effort.</p>
<p>As far as fine tuning goes, we havent crossed that bridge yet. So far, we have gotten what we needed from RAG + GPT4 without fine tuning. We definitely will be digging more into fine tuning soon, but it doesnt seem necessary for this application at this juncture.</p>
<p>That said, I asked my team if they had any opinions on training LoRAs etc, and was reminded that Sean Moriarity mentioned in a talk a while back that he’d fine-tuned a model using Python tooling but then deployed it on Elixir for production inference. Check his <a href="https://youtu.be/ELBQytOaQUQ?si=exykCmtM8bpAAWUl&amp;t=1570" rel="noopener nofollow ugc">talk</a> out (should be timestamped where he talks about the fine tuning)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312468" data-batch-url="/posts/batch_likers">
                        12
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-312468" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312468"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="329250" data-post-id="329250">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dacello" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dacello/120/32993_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dacello
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just wanted to give a little update:</p>
<p>We ended up abstracting the text chunking part of our RAG app out into an open source package and it has been published on hex.</p>
<p><a href="https://github.com/revelrylabs/text_chunker_ex" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/revelrylabs/text_chunker_ex</a></p>
<p>While the text chunking is definitely not the hardest part of all of this, it was the easiest thing for us to abstract out to share with the community. Feel free to check out the announcement <a href="https://revelry.co/insights/artificial-intelligence/announcing-textchunker" rel="noopener nofollow ugc">blog post</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329250" data-batch-url="/posts/batch_likers">
                        19
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-329250" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329250"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="345139" data-post-id="345139">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joelpaulkoch" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/joelpaulkoch/120/34540_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joelpaulkoch
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I want to share this here since it’s RAG related:<br>
We implemented the Jina embeddings v2 model in Elixir so we can use it for our RAG project.<br>
I hope this blog post also helps you in case you want to use a model that’s not supported out of the box in Bumblebee.</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://bitcrowd.dev/how-to-run-jina-embeddings-in-elixir/">
  <header class="source">
      <img src="https://bitcrowd.dev/img/favicon.svg" class="site-icon" alt="" width="351" height="351">

      <a href="https://bitcrowd.dev/how-to-run-jina-embeddings-in-elixir/" target="_blank" rel="noopener nofollow ugc" title="12:00AM - 28 October 2024">bitcrowd.dev – 28 Oct 24</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/362;"><img src="https://bitcrowd.dev/img/og/how-to-run-jina-embeddings-in-elixir.jpg" class="thumbnail" alt="" width="690" height="362"></div>

<h3><a href="https://bitcrowd.dev/how-to-run-jina-embeddings-in-elixir/" target="_blank" rel="noopener nofollow ugc">How to use Jina embeddings in Elixir with Bumblebee | bitcrowd blog</a></h3>

  <p>When directly compared with OpenAI's 8K model text-embedding-ada-002, the jina-embeddings-v2 stand out in terms of quality. Their long context length is a game changer. Don't let a missing model implementation stop you from realizing your awesome AI...</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345139" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-345139" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345139"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="349243" data-post-id="349243">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joelpaulkoch" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/joelpaulkoch/120/34540_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joelpaulkoch
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Apologies for hijacking this thread, but here’s another blog post that shows how you can implement a local RAG system in Elixir.</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://bitcrowd.dev/a-rag-for-elixir-in-elixir/">
  <header class="source">
      <img src="https://bitcrowd.dev/img/favicon.svg" class="site-icon" alt="" width="351" height="351">

      <a href="https://bitcrowd.dev/a-rag-for-elixir-in-elixir/" target="_blank" rel="noopener nofollow ugc" title="12:00AM - 10 December 2024">bitcrowd.dev – 10 Dec 24</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/362;"><img src="https://bitcrowd.dev/img/og/a-rag-for-elixir-in-elixir.jpg" class="thumbnail" alt="" width="690" height="362"></div>

<h3><a href="https://bitcrowd.dev/a-rag-for-elixir-in-elixir/" target="_blank" rel="noopener nofollow ugc">A RAG for Elixir in Elixir | bitcrowd blog</a></h3>

  <p>Find out how you can implement a local RAG system in Elixir.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349243" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/rag-app-using-elixir-feasible/60439/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-349243" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349243"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>