{"id":2186,"date":"2025-03-04T07:02:30","date_gmt":"2025-03-04T07:02:30","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/03\/04\/llm-rag-creating-an-ai-powered-file-reader-assistant\/"},"modified":"2025-03-04T07:02:30","modified_gmt":"2025-03-04T07:02:30","slug":"llm-rag-creating-an-ai-powered-file-reader-assistant","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/03\/04\/llm-rag-creating-an-ai-powered-file-reader-assistant\/","title":{"rendered":"LLM + RAG: Creating an AI-Powered File Reader Assistant"},"content":{"rendered":"<p>    LLM + RAG: Creating an AI-Powered File Reader Assistant<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n<p class=\"wp-block-paragraph\">AI is everywhere.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">It is hard not to interact at least once a day with a Large Language Model (LLM). The chatbots are here to stay. They\u2019re in your apps, they help you write better, they compose emails, they read emails\u2026well, they do a lot.<\/p>\n<p class=\"wp-block-paragraph\">And I don\u2019t think that that is bad. In fact, my opinion is the other way \u2013 at least so far. I defend and advocate for the use of AI in our daily lives because, let\u2019s agree, it makes everything much easier.<\/p>\n<p class=\"wp-block-paragraph\">I don\u2019t have to spend time double-reading a document to find punctuation problems or type. AI does that for me. I don\u2019t waste time writing that follow-up email every single Monday. AI does that for me. I don\u2019t need to read a huge and boring contract when I have an AI to summarize the main takeaways and action points to me!<\/p>\n<p class=\"wp-block-paragraph\">These are only some of AI\u2019s great uses. If you\u2019d like to know more use cases of LLMs to make our lives easier, I wrote a whole book about them.<\/p>\n<p class=\"wp-block-paragraph\">Now, thinking as a data scientist and looking at the technical side, not everything is that bright and shiny.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">LLMs are great for several general use cases that apply to anyone or any company. For example, coding, summarizing, or answering questions about general content created until the training cutoff date. However, when it comes to specific business applications, for a single purpose, or something new that didn\u2019t make the cutoff date, that is when the models won\u2019t be that useful if used <em>out-of-the-box<\/em> \u2013 meaning, they will not know the answer. Thus, it will need adjustments.<\/p>\n<p class=\"wp-block-paragraph\">Training an LLM model can take months and millions of dollars. What is even worse is that if we don\u2019t adjust and tune the model to our purpose, there will be unsatisfactory results or hallucinations (when the model\u2019s response doesn\u2019t make sense given our query).<\/p>\n<p class=\"wp-block-paragraph\">So what is the solution, then? Spending a lot of money retraining the model to include our data?<\/p>\n<p class=\"wp-block-paragraph\">Not really. That\u2019s when the Retrieval-Augmented Generation (RAG) becomes useful.<\/p>\n<p class=\"wp-block-paragraph\"><em>RAG is a framework that combines getting information from an external knowledge base with large language models (LLMs). It helps AI models produce more accurate and relevant responses.<\/em><\/p>\n<p class=\"wp-block-paragraph\">Let\u2019s learn more about RAG next.<\/p>\n<h2 class=\"wp-block-heading\">What is RAG?<\/h2>\n<p class=\"wp-block-paragraph\">Let me tell you a story to illustrate the concept.<\/p>\n<p class=\"wp-block-paragraph\">I love movies. For some time in the past, I knew which movies were competing for the best movie category at the Oscars or the best actors and actresses. And I would certainly know which ones got the statue for that year. But now I am all rusty on that subject. If you asked me who was competing, I would not know. And even if I tried to answer you, I would give you a weak response.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">So, to provide you with a quality response, I will do what everybody else does: search for the information online, obtain it, and then give it to you. What I just did is the same idea as the RAG: I obtained data from an external database to give you an answer.<\/p>\n<p class=\"wp-block-paragraph\">When we enhance the LLM with a <em>content store<\/em> where it can go and <strong>retrieve<\/strong> data to <strong>augment<\/strong> (increase) its knowledge base, that is the RAG framework in action.<\/p>\n<p class=\"wp-block-paragraph\"><em>RAG is like creating a content store where the model can enhance its knowledge and respond more accurately.<\/em><\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" data-dominant-color=\"e2e1e7\" data-has-transparency=\"false\" style=\"--dominant-color: #e2e1e7;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"589\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-2-1024x589.png?resize=1024%2C589&#038;ssl=1\" alt=\"Diagram: User prompts and content using LLM + RAG\" class=\"wp-image-598624 not-transparent\" srcset=\"https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-2-1024x589.png 1024w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-2-300x173.png 300w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-2-768x442.png 768w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-2.png 1079w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><figcaption class=\"wp-element-caption\">User prompt about Content C. LLM retrieves external content to aggregate to the answer. Image by the author.<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">Summarizing:<\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Uses search algorithms to query external data sources, such as databases, knowledge bases, and web pages.<\/li>\n<li class=\"wp-block-list-item\">Pre-processes the retrieved information.<\/li>\n<li class=\"wp-block-list-item\">Incorporates the pre-processed information into the LLM.<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\">Why use RAG?<\/h2>\n<p class=\"wp-block-paragraph\">Now that we know what the RAG framework is let\u2019s understand why we should be using it.<\/p>\n<p class=\"wp-block-paragraph\">Here are some of the benefits:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Enhances factual accuracy by referencing real data.<\/li>\n<li class=\"wp-block-list-item\">RAG can help LLMs process and consolidate knowledge to create more relevant answers\u00a0<\/li>\n<li class=\"wp-block-list-item\">RAG can help LLMs access additional knowledge bases, such as internal organizational data\u00a0<\/li>\n<li class=\"wp-block-list-item\">RAG can help LLMs create more accurate domain-specific content\u00a0<\/li>\n<li class=\"wp-block-list-item\">RAG can help reduce knowledge gaps and AI hallucination<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">As previously explained, I like to say that with the RAG framework, we are giving an internal search engine for the content we want it to add to the knowledge base.<\/p>\n<p class=\"wp-block-paragraph\">Well. All of that is very interesting. But let\u2019s see an application of RAG. We will learn how to create an AI-powered PDF Reader Assistant.<\/p>\n<h2 class=\"wp-block-heading\">Project<\/h2>\n<p class=\"wp-block-paragraph\">This is an application that allows users to upload a PDF document and ask questions about its content using AI-powered natural language processing (NLP) tools.\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">The app uses <code>Streamlit<\/code> as the front end.<\/li>\n<li class=\"wp-block-list-item\">\n<code>Langchain<\/code>, OpenAI\u2019s GPT-4 model, and <code>FAISS<\/code> (Facebook AI Similarity Search) for document retrieval and question answering in the backend.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">Let\u2019s break down the steps for better understanding:<\/p>\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Loading a PDF file and splitting it into chunks of text.\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">This makes the data optimized for retrieval<\/li>\n<\/ol>\n<\/li>\n<li class=\"wp-block-list-item\">Present the chunks to an embedding tool.\n<ol class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Embeddings are numerical vector representations of data used to capture relationships, similarities, and meanings in a way that machines can understand. They are widely used in Natural Language Processing (NLP), recommender systems, and search engines.<\/li>\n<\/ol>\n<\/li>\n<li class=\"wp-block-list-item\">Next, we put those chunks of text and embeddings in the same DB for retrieval.<\/li>\n<li class=\"wp-block-list-item\">Finally, we make it available to the LLM.<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\">Data preparation<\/h3>\n<p class=\"wp-block-paragraph\">Preparing a <em>content store<\/em> for the LLM will take some steps, as we just saw. So, let\u2019s start by creating a function that can load a file and split it into text chunks for efficient retrieval.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Imports\nfrom  langchain_community.document_loaders import PyPDFLoader\nfrom langchain.text_splitter import RecursiveCharacterTextSplitter\n\ndef load_document(pdf):\n    # Load a PDF\n    \"\"\"\n    Load a PDF and split it into chunks for efficient retrieval.\n\n    :param pdf: PDF file to load\n    :return: List of chunks of text\n    \"\"\"\n\n    loader = PyPDFLoader(pdf)\n    docs = loader.load()\n\n    # Instantiate Text Splitter with Chunk Size of 500 words and Overlap of 100 words so that context is not lost\n    text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100)\n    # Split into chunks for efficient retrieval\n    chunks = text_splitter.split_documents(docs)\n\n    # Return\n    return chunks<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Next, we will start building our Streamlit app, and we\u2019ll use that function in the next script.<\/p>\n<h3 class=\"wp-block-heading\">Web application<\/h3>\n<p class=\"wp-block-paragraph\">We will begin importing the necessary modules in Python. Most of those will come from the langchain packages.<\/p>\n<p class=\"wp-block-paragraph\"><code>FAISS<\/code> is used for document retrieval; <code>OpenAIEmbeddings<\/code> transforms the text chunks into numerical scores for better similarity calculation by the LLM; <code>ChatOpenAI<\/code> is what enables us to interact with the OpenAI API; <code>create_retrieval_chain<\/code> is what actually the RAG does, retrieving and augmenting the LLM with that data; <code>create_stuff_documents_chain<\/code> glues the model and the ChatPromptTemplate.<\/p>\n<p class=\"wp-block-paragraph\"><em>Note: You will need to <\/em><a href=\"https:\/\/www.geeksforgeeks.org\/how-to-get-your-own-openai-api-key\/\"><em>generate an OpenAI Key<\/em><\/a><em> to be able to run this script. If it\u2019s the first time you\u2019re creating your account, you get some free credits. But if you have it for some time, it is possible that you will have to add 5 dollars in credits to be able to access OpenAI\u2019s API. An option is using Hugging Face\u2019s Embedding.\u00a0<\/em><\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Imports\nfrom langchain_community.vectorstores import FAISS\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain.chains import create_retrieval_chain\nfrom langchain_openai import ChatOpenAI\nfrom langchain.chains.combine_documents import create_stuff_documents_chain\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom scripts.secret import OPENAI_KEY\nfrom scripts.document_loader import load_document\nimport streamlit as st<\/code><\/pre>\n<p class=\"wp-block-paragraph\">This first code snippet will create the App title, create a box for file upload, and prepare the file to be added to the <code>load_document() <\/code>function.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Create a Streamlit app\nst.title(\"AI-Powered Document Q&amp;A\")\n\n# Load document to streamlit\nuploaded_file = st.file_uploader(\"Upload a PDF file\", type=\"pdf\")\n\n# If a file is uploaded, create the TextSplitter and vector database\nif uploaded_file :\n\n\u00a0\u00a0\u00a0\u00a0# Code to work around document loader from Streamlit and make it readable by langchain\n\u00a0\u00a0\u00a0\u00a0temp_file = \".\/temp.pdf\"\n\u00a0\u00a0\u00a0\u00a0with open(temp_file, \"wb\") as file:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file.write(uploaded_file.getvalue())\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file_name = uploaded_file.name\n\n\u00a0\u00a0\u00a0\u00a0# Load document and split it into chunks for efficient retrieval.\n\u00a0\u00a0\u00a0\u00a0chunks = load_document(temp_file)\n\n\u00a0\u00a0\u00a0\u00a0# Message user that document is being processed with time emoji\n\u00a0\u00a0\u00a0\u00a0st.write(\"Processing document... :watch:\")<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Machines understand numbers better than text, so in the end, we will have to provide the model with a database of numbers that it can compare and check for similarity when performing a query. That\u2019s where the <code>embeddings<\/code> will be useful to create the <code>vector_db<\/code>, in this next piece of code.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Generate embeddings\n\u00a0\u00a0\u00a0\u00a0# Embeddings are numerical vector representations of data, typically used to capture relationships, similarities,\n\u00a0\u00a0\u00a0\u00a0# and meanings in a way that machines can understand. They are widely used in Natural Language Processing (NLP),\n\u00a0\u00a0\u00a0\u00a0# recommender systems, and search engines.\n\u00a0\u00a0\u00a0\u00a0embeddings = OpenAIEmbeddings(openai_api_key=OPENAI_KEY,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0model=\"text-embedding-ada-002\")\n\n\u00a0\u00a0\u00a0\u00a0# Can also use HuggingFaceEmbeddings\n\u00a0\u00a0\u00a0\u00a0# from langchain_huggingface.embeddings import HuggingFaceEmbeddings\n\u00a0\u00a0\u00a0\u00a0# embeddings = HuggingFaceEmbeddings(model_name=\"sentence-transformers\/all-MiniLM-L6-v2\")\n\n\u00a0\u00a0\u00a0\u00a0# Create vector database containing chunks and embeddings\n\u00a0\u00a0\u00a0\u00a0vector_db = FAISS.from_documents(chunks, embeddings)<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Next, we create a retriever object to navigate in the <code>vector_db<\/code>.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Create a document retriever\n\u00a0\u00a0\u00a0\u00a0retriever = vector_db.as_retriever()\n\u00a0\u00a0\u00a0\u00a0llm = ChatOpenAI(model_name=\"gpt-4o-mini\", openai_api_key=OPENAI_KEY)<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Then, we will create the <code>system_prompt<\/code>, which is a set of instructions to the LLM on how to answer, and we will create a prompt template, preparing it to be added to the model once we get the input from the user.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\"># Create a system prompt\n\u00a0\u00a0\u00a0\u00a0# It sets the overall context for the model.\n\u00a0\u00a0\u00a0\u00a0# It influences tone, style, and focus before user interaction starts.\n\u00a0\u00a0\u00a0\u00a0# Unlike user inputs, a system prompt is not visible to the end user.\n\n\u00a0\u00a0\u00a0\u00a0system_prompt = (\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"You are a helpful assistant. Use the given context to answer the question.\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"If you don't know the answer, say you don't know. \"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"{context}\"\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0# Create a prompt Template\n\u00a0\u00a0\u00a0\u00a0prompt = ChatPromptTemplate.from_messages(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(\"system\", system_prompt),\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(\"human\", \"{input}\"),\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0# Create a chain\n\u00a0\u00a0\u00a0\u00a0# It creates a StuffDocumentsChain, which takes multiple documents (text data) and \"stuffs\" them together before passing them to the LLM for processing.\n\n\u00a0\u00a0\u00a0\u00a0question_answer_chain = create_stuff_documents_chain(llm, prompt)<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Moving on, we create the core of the RAG framework, pasting together the <code>retriever<\/code> object and the <code>prompt<\/code>. This object adds relevant documents from a data source (e.g., a vector database) and makes it ready to be processed using an LLM to generate a response.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Creates the RAG\n\u00a0\u00a0\u00a0\u00a0\u00a0chain = create_retrieval_chain(retriever, question_answer_chain)<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Finally, we create the variable <code>question<\/code> for the user input. If this question box is filled with a query, we pass it to the <code>chain<\/code>, which calls the LLM to process and return the response, which will be printed on the app\u2019s screen.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-python\"># Streamlit input for question\n\u00a0\u00a0\u00a0\u00a0question = st.text_input(\"Ask a question about the document:\")\n\u00a0\u00a0\u00a0\u00a0if question:\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# Answer\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0response = chain.invoke({\"input\": question})['answer']\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0st.write(response)<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Here is a screenshot of the result.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" data-dominant-color=\"16191f\" data-has-transparency=\"false\" style=\"--dominant-color: #16191f;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"699\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-3-1024x699.png?resize=1024%2C699&#038;ssl=1\" alt=\"Screenshot of the AI-Powered Document Q&amp;A\" class=\"wp-image-598625 not-transparent\" srcset=\"https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-3-1024x699.png 1024w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-3-300x205.png 300w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-3-768x525.png 768w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/LLM-RAG-3.png 1221w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><figcaption class=\"wp-element-caption\">Screenshot of the final app. Image by the author.<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">And this is a GIF for you to see the File Reader <a href=\"https:\/\/towardsdatascience.com\/tag\/ai-assistant\/\" title=\"Ai Assistant\">Ai Assistant<\/a> in action!<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"490\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/AI-Powered-Document-QA.gif?resize=893%2C490&#038;ssl=1\" alt=\"GIF of the File Reader AI Assistant in action\" class=\"wp-image-598626\"><figcaption class=\"wp-element-caption\">File Reader AI Assistant in action. Image by the author.<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\">Before you go<\/h2>\n<p class=\"wp-block-paragraph\">In this project, we learned what the RAG framework is and how it helps the <a href=\"https:\/\/towardsdatascience.com\/tag\/llm\/\" title=\"Llm\">Llm<\/a> to perform better and also perform well with specific knowledge.<\/p>\n<p class=\"wp-block-paragraph\">AI can be powered with knowledge from an instruction manual, databases from a company, some finance files, or contracts, and then become fine-tuned to respond accurately to domain-specific content queries. The knowledge base is <strong>augmented<\/strong> with a content store.<\/p>\n<p class=\"wp-block-paragraph\">To recap, this is how the framework works:<\/p>\n<p class=\"wp-block-paragraph\">1\ufe0f\u20e3 <strong>User Query<\/strong> \u2192 Input text is received.<\/p>\n<p class=\"wp-block-paragraph\">2\ufe0f\u20e3 <strong>Retrieve Relevant Documents<\/strong> \u2192 Searches a knowledge base (e.g., a database, vector store).<\/p>\n<p class=\"wp-block-paragraph\">3\ufe0f\u20e3 <strong>Augment Context<\/strong> \u2192 Retrieved documents are added to the input.<\/p>\n<p class=\"wp-block-paragraph\">4\ufe0f\u20e3 <strong>Generate Response<\/strong> \u2192 An LLM processes the combined input and produces an answer.<\/p>\n<h3 class=\"wp-block-heading\">GitHub repository<\/h3>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/gurezende\/Basic-Rag\">https:\/\/github.com\/gurezende\/Basic-Rag<\/a><\/p>\n<h3 class=\"wp-block-heading\">About me<\/h3>\n<p class=\"wp-block-paragraph\">If you liked this content and want to learn more about my work, here is my website, where you can also find all my contacts.<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gustavorsantos.me\/\">https:\/\/gustavorsantos.me<\/a><\/p>\n<h2 class=\"wp-block-heading\">References<\/h2>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/cloud.google.com\/use-cases\/retrieval-augmented-generation\">https:\/\/cloud.google.com\/use-cases\/retrieval-augmented-generation<\/a><\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.ibm.com\/think\/topics\/retrieval-augmented-generation\">https:\/\/www.ibm.com\/think\/topics\/retrieval-augmented-generation<\/a><\/p>\n<p class=\"wp-embed-aspect-16-9 wp-has-aspect-ratio wp-block-paragraph\"><a href=\"https:\/\/youtu.be\/T-D1OfcDW1M?si=G0UWfH5-wZnMu0nw\">https:\/\/youtu.be\/T-D1OfcDW1M?si=G0UWfH5-wZnMu0nw<\/a><\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/python.langchain.com\/docs\/introduction\">https:\/\/python.langchain.com\/docs\/introduction<\/a><\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.geeksforgeeks.org\/how-to-get-your-own-openai-api-key\">https:\/\/www.geeksforgeeks.org\/how-to-get-your-own-openai-api-key<\/a><\/p>\n<p>The post <a href=\"https:\/\/towardsdatascience.com\/llm-rag-creating-an-ai-powered-file-reader-assistant\/\">LLM + RAG: Creating an AI-Powered File Reader Assistant<\/a> appeared first on <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Gustavo Santos<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/llm-rag-creating-an-ai-powered-file-reader-assistant\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LLM + RAG: Creating an AI-Powered File Reader Assistant Introduction AI is everywhere.\u00a0 It is hard not to interact at least once a day with a Large Language Model (LLM). The chatbots are here to stay. They\u2019re in your apps, they help you write better, they compose emails, they read emails\u2026well, they do a lot. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[154,62,71,87,70,157,1648],"tags":[98,1910,871],"class_list":["post-2186","post","type-post","status-publish","format-standard","hentry","category-ai-assistant","category-aimldsaimlds","category-large-language-models","category-llm","category-machine-learning","category-python","category-retrieval-augmented","tag-ai","tag-don","tag-they"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2186"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=2186"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2186\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=2186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=2186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=2186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}