Stay Ahead, Stay ONMINE

LLM + RAG: Creating an AI-Powered File Reader Assistant

Introduction AI is everywhere.  It is hard not to interact at least once a day with a Large Language Model (LLM). The chatbots are here to stay. They’re in your apps, they help you write better, they compose emails, they read emails…well, they do a lot. And I don’t think that that is bad. In fact, my opinion is the other way – at least so far. I defend and advocate for the use of AI in our daily lives because, let’s agree, it makes everything much easier. I don’t have to spend time double-reading a document to find punctuation problems or type. AI does that for me. I don’t waste time writing that follow-up email every single Monday. AI does that for me. I don’t need to read a huge and boring contract when I have an AI to summarize the main takeaways and action points to me! These are only some of AI’s great uses. If you’d like to know more use cases of LLMs to make our lives easier, I wrote a whole book about them. Now, thinking as a data scientist and looking at the technical side, not everything is that bright and shiny.  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’t make the cutoff date, that is when the models won’t be that useful if used out-of-the-box – meaning, they will not know the answer. Thus, it will need adjustments. Training an LLM model can take months and millions of dollars. What is even worse is that if we don’t adjust and tune the model to our purpose, there will be unsatisfactory results or hallucinations (when the model’s response doesn’t make sense given our query). So what is the solution, then? Spending a lot of money retraining the model to include our data? Not really. That’s when the Retrieval-Augmented Generation (RAG) becomes useful. 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. Let’s learn more about RAG next. What is RAG? Let me tell you a story to illustrate the concept. 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.  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. When we enhance the LLM with a content store where it can go and retrieve data to augment (increase) its knowledge base, that is the RAG framework in action. RAG is like creating a content store where the model can enhance its knowledge and respond more accurately. User prompt about Content C. LLM retrieves external content to aggregate to the answer. Image by the author. Summarizing: Uses search algorithms to query external data sources, such as databases, knowledge bases, and web pages. Pre-processes the retrieved information. Incorporates the pre-processed information into the LLM. Why use RAG? Now that we know what the RAG framework is let’s understand why we should be using it. Here are some of the benefits: Enhances factual accuracy by referencing real data. RAG can help LLMs process and consolidate knowledge to create more relevant answers  RAG can help LLMs access additional knowledge bases, such as internal organizational data  RAG can help LLMs create more accurate domain-specific content  RAG can help reduce knowledge gaps and AI hallucination 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. Well. All of that is very interesting. But let’s see an application of RAG. We will learn how to create an AI-powered PDF Reader Assistant. Project 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.  The app uses Streamlit as the front end. Langchain, OpenAI’s GPT-4 model, and FAISS (Facebook AI Similarity Search) for document retrieval and question answering in the backend. Let’s break down the steps for better understanding: Loading a PDF file and splitting it into chunks of text. This makes the data optimized for retrieval Present the chunks to an embedding tool. 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. Next, we put those chunks of text and embeddings in the same DB for retrieval. Finally, we make it available to the LLM. Data preparation Preparing a content store for the LLM will take some steps, as we just saw. So, let’s start by creating a function that can load a file and split it into text chunks for efficient retrieval. # Imports from langchain_community.document_loaders import PyPDFLoader from langchain.text_splitter import RecursiveCharacterTextSplitter def load_document(pdf): # Load a PDF “”” Load a PDF and split it into chunks for efficient retrieval. :param pdf: PDF file to load :return: List of chunks of text “”” loader = PyPDFLoader(pdf) docs = loader.load() # Instantiate Text Splitter with Chunk Size of 500 words and Overlap of 100 words so that context is not lost text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100) # Split into chunks for efficient retrieval chunks = text_splitter.split_documents(docs) # Return return chunks Next, we will start building our Streamlit app, and we’ll use that function in the next script. Web application We will begin importing the necessary modules in Python. Most of those will come from the langchain packages. FAISS is used for document retrieval; OpenAIEmbeddings transforms the text chunks into numerical scores for better similarity calculation by the LLM; ChatOpenAI is what enables us to interact with the OpenAI API; create_retrieval_chain is what actually the RAG does, retrieving and augmenting the LLM with that data; create_stuff_documents_chain glues the model and the ChatPromptTemplate. Note: You will need to generate an OpenAI Key to be able to run this script. If it’s the first time you’re 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’s API. An option is using Hugging Face’s Embedding.  # Imports from langchain_community.vectorstores import FAISS from langchain_openai import OpenAIEmbeddings from langchain.chains import create_retrieval_chain from langchain_openai import ChatOpenAI from langchain.chains.combine_documents import create_stuff_documents_chain from langchain_core.prompts import ChatPromptTemplate from scripts.secret import OPENAI_KEY from scripts.document_loader import load_document import streamlit as st This first code snippet will create the App title, create a box for file upload, and prepare the file to be added to the load_document() function. # Create a Streamlit app st.title(“AI-Powered Document Q&A”) # Load document to streamlit uploaded_file = st.file_uploader(“Upload a PDF file”, type=”pdf”) # If a file is uploaded, create the TextSplitter and vector database if uploaded_file :     # Code to work around document loader from Streamlit and make it readable by langchain     temp_file = “./temp.pdf”     with open(temp_file, “wb”) as file:         file.write(uploaded_file.getvalue())         file_name = uploaded_file.name     # Load document and split it into chunks for efficient retrieval.     chunks = load_document(temp_file)     # Message user that document is being processed with time emoji     st.write(“Processing document… :watch:”) 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’s where the embeddings will be useful to create the vector_db, in this next piece of code. # Generate embeddings     # Embeddings are numerical vector representations of data, typically 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.     embeddings = OpenAIEmbeddings(openai_api_key=OPENAI_KEY,                                   model=”text-embedding-ada-002″)     # Can also use HuggingFaceEmbeddings     # from langchain_huggingface.embeddings import HuggingFaceEmbeddings     # embeddings = HuggingFaceEmbeddings(model_name=”sentence-transformers/all-MiniLM-L6-v2″)     # Create vector database containing chunks and embeddings     vector_db = FAISS.from_documents(chunks, embeddings) Next, we create a retriever object to navigate in the vector_db. # Create a document retriever     retriever = vector_db.as_retriever()     llm = ChatOpenAI(model_name=”gpt-4o-mini”, openai_api_key=OPENAI_KEY) Then, we will create the system_prompt, 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. # Create a system prompt     # It sets the overall context for the model.     # It influences tone, style, and focus before user interaction starts.     # Unlike user inputs, a system prompt is not visible to the end user.     system_prompt = (         “You are a helpful assistant. Use the given context to answer the question.”         “If you don’t know the answer, say you don’t know. ”         “{context}”     )     # Create a prompt Template     prompt = ChatPromptTemplate.from_messages(         [             (“system”, system_prompt),             (“human”, “{input}”),         ]     )     # Create a chain     # It creates a StuffDocumentsChain, which takes multiple documents (text data) and “stuffs” them together before passing them to the LLM for processing.     question_answer_chain = create_stuff_documents_chain(llm, prompt) Moving on, we create the core of the RAG framework, pasting together the retriever object and the prompt. 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. # Creates the RAG      chain = create_retrieval_chain(retriever, question_answer_chain) Finally, we create the variable question for the user input. If this question box is filled with a query, we pass it to the chain, which calls the LLM to process and return the response, which will be printed on the app’s screen. # Streamlit input for question     question = st.text_input(“Ask a question about the document:”)     if question:         # Answer         response = chain.invoke({“input”: question})[‘answer’]         st.write(response) Here is a screenshot of the result. Screenshot of the final app. Image by the author. And this is a GIF for you to see the File Reader Ai Assistant in action! File Reader AI Assistant in action. Image by the author. Before you go In this project, we learned what the RAG framework is and how it helps the Llm to perform better and also perform well with specific knowledge. 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 augmented with a content store. To recap, this is how the framework works: 1️⃣ User Query → Input text is received. 2️⃣ Retrieve Relevant Documents → Searches a knowledge base (e.g., a database, vector store). 3️⃣ Augment Context → Retrieved documents are added to the input. 4️⃣ Generate Response → An LLM processes the combined input and produces an answer. GitHub repository https://github.com/gurezende/Basic-Rag About me 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. https://gustavorsantos.me References https://cloud.google.com/use-cases/retrieval-augmented-generation https://www.ibm.com/think/topics/retrieval-augmented-generation https://python.langchain.com/docs/introduction https://www.geeksforgeeks.org/how-to-get-your-own-openai-api-key

Introduction

AI is everywhere. 

It is hard not to interact at least once a day with a Large Language Model (LLM). The chatbots are here to stay. They’re in your apps, they help you write better, they compose emails, they read emails…well, they do a lot.

And I don’t think that that is bad. In fact, my opinion is the other way – at least so far. I defend and advocate for the use of AI in our daily lives because, let’s agree, it makes everything much easier.

I don’t have to spend time double-reading a document to find punctuation problems or type. AI does that for me. I don’t waste time writing that follow-up email every single Monday. AI does that for me. I don’t need to read a huge and boring contract when I have an AI to summarize the main takeaways and action points to me!

These are only some of AI’s great uses. If you’d like to know more use cases of LLMs to make our lives easier, I wrote a whole book about them.

Now, thinking as a data scientist and looking at the technical side, not everything is that bright and shiny. 

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’t make the cutoff date, that is when the models won’t be that useful if used out-of-the-box – meaning, they will not know the answer. Thus, it will need adjustments.

Training an LLM model can take months and millions of dollars. What is even worse is that if we don’t adjust and tune the model to our purpose, there will be unsatisfactory results or hallucinations (when the model’s response doesn’t make sense given our query).

So what is the solution, then? Spending a lot of money retraining the model to include our data?

Not really. That’s when the Retrieval-Augmented Generation (RAG) becomes useful.

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.

Let’s learn more about RAG next.

What is RAG?

Let me tell you a story to illustrate the concept.

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. 

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.

When we enhance the LLM with a content store where it can go and retrieve data to augment (increase) its knowledge base, that is the RAG framework in action.

RAG is like creating a content store where the model can enhance its knowledge and respond more accurately.

Diagram: User prompts and content using LLM + RAG
User prompt about Content C. LLM retrieves external content to aggregate to the answer. Image by the author.

Summarizing:

  1. Uses search algorithms to query external data sources, such as databases, knowledge bases, and web pages.
  2. Pre-processes the retrieved information.
  3. Incorporates the pre-processed information into the LLM.

Why use RAG?

Now that we know what the RAG framework is let’s understand why we should be using it.

Here are some of the benefits:

  • Enhances factual accuracy by referencing real data.
  • RAG can help LLMs process and consolidate knowledge to create more relevant answers 
  • RAG can help LLMs access additional knowledge bases, such as internal organizational data 
  • RAG can help LLMs create more accurate domain-specific content 
  • RAG can help reduce knowledge gaps and AI hallucination

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.

Well. All of that is very interesting. But let’s see an application of RAG. We will learn how to create an AI-powered PDF Reader Assistant.

Project

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. 

  • The app uses Streamlit as the front end.
  • Langchain, OpenAI’s GPT-4 model, and FAISS (Facebook AI Similarity Search) for document retrieval and question answering in the backend.

Let’s break down the steps for better understanding:

  1. Loading a PDF file and splitting it into chunks of text.
    1. This makes the data optimized for retrieval
  2. Present the chunks to an embedding tool.
    1. 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.
  3. Next, we put those chunks of text and embeddings in the same DB for retrieval.
  4. Finally, we make it available to the LLM.

Data preparation

Preparing a content store for the LLM will take some steps, as we just saw. So, let’s start by creating a function that can load a file and split it into text chunks for efficient retrieval.

# Imports
from  langchain_community.document_loaders import PyPDFLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter

def load_document(pdf):
    # Load a PDF
    """
    Load a PDF and split it into chunks for efficient retrieval.

    :param pdf: PDF file to load
    :return: List of chunks of text
    """

    loader = PyPDFLoader(pdf)
    docs = loader.load()

    # Instantiate Text Splitter with Chunk Size of 500 words and Overlap of 100 words so that context is not lost
    text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100)
    # Split into chunks for efficient retrieval
    chunks = text_splitter.split_documents(docs)

    # Return
    return chunks

Next, we will start building our Streamlit app, and we’ll use that function in the next script.

Web application

We will begin importing the necessary modules in Python. Most of those will come from the langchain packages.

FAISS is used for document retrieval; OpenAIEmbeddings transforms the text chunks into numerical scores for better similarity calculation by the LLM; ChatOpenAI is what enables us to interact with the OpenAI API; create_retrieval_chain is what actually the RAG does, retrieving and augmenting the LLM with that data; create_stuff_documents_chain glues the model and the ChatPromptTemplate.

Note: You will need to generate an OpenAI Key to be able to run this script. If it’s the first time you’re 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’s API. An option is using Hugging Face’s Embedding. 

# Imports
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
from langchain.chains import create_retrieval_chain
from langchain_openai import ChatOpenAI
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain_core.prompts import ChatPromptTemplate
from scripts.secret import OPENAI_KEY
from scripts.document_loader import load_document
import streamlit as st

This first code snippet will create the App title, create a box for file upload, and prepare the file to be added to the load_document() function.

# Create a Streamlit app
st.title("AI-Powered Document Q&A")

# Load document to streamlit
uploaded_file = st.file_uploader("Upload a PDF file", type="pdf")

# If a file is uploaded, create the TextSplitter and vector database
if uploaded_file :

    # Code to work around document loader from Streamlit and make it readable by langchain
    temp_file = "./temp.pdf"
    with open(temp_file, "wb") as file:
        file.write(uploaded_file.getvalue())
        file_name = uploaded_file.name

    # Load document and split it into chunks for efficient retrieval.
    chunks = load_document(temp_file)

    # Message user that document is being processed with time emoji
    st.write("Processing document... :watch:")

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’s where the embeddings will be useful to create the vector_db, in this next piece of code.

# Generate embeddings
    # Embeddings are numerical vector representations of data, typically 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.
    embeddings = OpenAIEmbeddings(openai_api_key=OPENAI_KEY,
                                  model="text-embedding-ada-002")

    # Can also use HuggingFaceEmbeddings
    # from langchain_huggingface.embeddings import HuggingFaceEmbeddings
    # embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")

    # Create vector database containing chunks and embeddings
    vector_db = FAISS.from_documents(chunks, embeddings)

Next, we create a retriever object to navigate in the vector_db.

# Create a document retriever
    retriever = vector_db.as_retriever()
    llm = ChatOpenAI(model_name="gpt-4o-mini", openai_api_key=OPENAI_KEY)

Then, we will create the system_prompt, 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.

# Create a system prompt
    # It sets the overall context for the model.
    # It influences tone, style, and focus before user interaction starts.
    # Unlike user inputs, a system prompt is not visible to the end user.

    system_prompt = (
        "You are a helpful assistant. Use the given context to answer the question."
        "If you don't know the answer, say you don't know. "
        "{context}"
    )

    # Create a prompt Template
    prompt = ChatPromptTemplate.from_messages(
        [
            ("system", system_prompt),
            ("human", "{input}"),
        ]
    )

    # Create a chain
    # It creates a StuffDocumentsChain, which takes multiple documents (text data) and "stuffs" them together before passing them to the LLM for processing.

    question_answer_chain = create_stuff_documents_chain(llm, prompt)

Moving on, we create the core of the RAG framework, pasting together the retriever object and the prompt. 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.

# Creates the RAG
     chain = create_retrieval_chain(retriever, question_answer_chain)

Finally, we create the variable question for the user input. If this question box is filled with a query, we pass it to the chain, which calls the LLM to process and return the response, which will be printed on the app’s screen.

# Streamlit input for question
    question = st.text_input("Ask a question about the document:")
    if question:
        # Answer
        response = chain.invoke({"input": question})['answer']
        st.write(response)

Here is a screenshot of the result.

Screenshot of the AI-Powered Document Q&A
Screenshot of the final app. Image by the author.

And this is a GIF for you to see the File Reader Ai Assistant in action!

GIF of the File Reader AI Assistant in action
File Reader AI Assistant in action. Image by the author.

Before you go

In this project, we learned what the RAG framework is and how it helps the Llm to perform better and also perform well with specific knowledge.

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 augmented with a content store.

To recap, this is how the framework works:

1️⃣ User Query → Input text is received.

2️⃣ Retrieve Relevant Documents → Searches a knowledge base (e.g., a database, vector store).

3️⃣ Augment Context → Retrieved documents are added to the input.

4️⃣ Generate Response → An LLM processes the combined input and produces an answer.

GitHub repository

https://github.com/gurezende/Basic-Rag

About me

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.

https://gustavorsantos.me

References

https://cloud.google.com/use-cases/retrieval-augmented-generation

https://www.ibm.com/think/topics/retrieval-augmented-generation

https://youtu.be/T-D1OfcDW1M?si=G0UWfH5-wZnMu0nw

https://python.langchain.com/docs/introduction

https://www.geeksforgeeks.org/how-to-get-your-own-openai-api-key

Shape
Shape
Stay Ahead

Explore More Insights

Stay ahead with more perspectives on cutting-edge power, infrastructure, energy,  bitcoin and AI solutions. Explore these articles to uncover strategies and insights shaping the future of industries.

Shape

Fortinet adds AI protections to endpoint security platform

“FortiEndpoint provides centralized visibility into AI applications and agents operating across managed endpoints. Security teams can identify sanctioned and unsanctioned tools, detect shadow AI, monitor adoption trends, and understand user activity through unified dashboards,” wrote Ankit Gupta, product and marketing leader for Fortinet, in a blog post about the enhancements.

Read More »

ISC2: AI raises accountability demands for cybersecurity teams

Artificial intelligence is changing how cybersecurity teams work, with security professionals spending more time validating AI-generated recommendations and deciding when to trust AI outputs, according to new research from ISC2. The ISC2 survey of 856 cybersecurity professionals found that 65% spent more time deciding when to trust or act on

Read More »

Governments to enterprises: Improve your router security hygiene

Actors have exploited, at the very least, CVE-2018-0171 (published in 2018) and CVE-2008-4128 (published in 2008), according to the bulletin. Both of these targeted Cisco routers, giving remote, unauthenticated attackers the ability to execute arbitrary code, take unauthorized actions, or cause a denial of service (DoS). Notable groups using this

Read More »

Routine maintenance as a failure vector in modern networks

Pre-checks should include both control-plane and data-plane evidence. Control-plane checks confirm configuration, synchronization, device health, routing tables, interface status and object availability. Data-plane checks validate real traffic movement: TCP handshakes, TLS negotiation, HTTP status codes, API responses, session persistence, source NAT behavior and return-path consistency. During the change, monitoring should

Read More »

Energy Secretary Secures Mid-Atlantic Grid Ahead of Period of Hot Weather

WASHINGTON—The U.S. Department of Energy (DOE) today issued an emergency order to mitigate blackout risks in the Mid-Atlantic ahead of the forecasted hot weather conditions and expected system load increase. The order directs PJM Interconnection, L.L.C. (PJM) to dispatch specified units and to order their operation as needed to maintain reliability. The order also authorizes PJM to direct backup generation resources to operate as a last resort before declaring an Energy Emergency Alert (EEA) 3 or during an EEA 3. PJM is authorized to call upon its Transmission Owners and Electric Distribution Companies to implement the order as needed. The order was issued pursuant to an application from PJM submitted on July 13, 2026. “Maintaining affordable, reliable, and secure power in the PJM service territory is non-negotiable,” said U.S. Secretary of Energy Chris Wright. “The previous administration’s energy subtraction policies weakened the grid, leaving Americans more vulnerable during events like this. Thanks to President Trump’s leadership, we are reversing those failures and using every available tool ensuring Americans in the Mid-Atlantic have continued access to affordable, reliable, and secure energy to power and cool their homes.” DOE estimates more than 35 GW of unused backup generation remains available nationwide. On day one, President Trump declared a national energy emergency after the Biden administration’s energy subtraction agenda left behind a grid increasingly vulnerable to risks of blackouts. According to the North American Electric Reliability Corporation’s (NERC) 2026 Summer Reliability Assessment, the peak electricity demand in PJM occurs during the summer season. NERC further notes that “if extreme high temperatures are experienced, PJM anticipates the need for demand-response resources to help reduce load.”  Power outages cost the American people $44 billion per year, according to data from DOE’s National Laboratories. This order will mitigate the possibility of power outages in the Mid-Atlantic and highlights the common sense policies of the Trump Administration to ensure Americans have access to affordable, reliable,

Read More »

DOE Alternative Fuels and Feedstocks Office Announces Intent to Advance Innovative Chemical Technologies

Proposed DOE funding will accelerate domestic chemical production WASHINGTON—The U.S. Department of Energy’s (DOE) Alternative Fuels and Feedstocks Office (AFFO) today announced its intent to fund the advancement of novel, high-impact chemical technologies. The proposed funding opportunity, Accelerating Scale-up and Pre-piloting of Emerging Chemical Technologies (ASPECT), will advance technologies for producing chemicals from alternative and waste feedstocks. In accordance with President Trump’s Executive Order Unleashing American Energy, this funding opportunity will strengthen domestic supply chains, reduce reliance on foreign imports, and accelerate American technology innovation. More than 96% of manufactured goods rely on products from the U.S. chemical sector, which directly employs more than half a million Americans. The ASPECT funding opportunity will reinforce domestic manufacturing and chemical supply chains by expanding the use of alternative feedstocks. Funding provided through ASPECT will target chemical technologies that improve performance, reduce costs, and show large market growth potential. AFFO expects to issue a notice of funding opportunity (NOFO) in August 2026, making up to $58 million available for projects that address the following topic areas: Topic Area 1: Bench ASPECT – to support the development and adoption of new technologies for producing chemicals from alternative feedstocks, moving beyond proof-of-concept to bench and pre-pilot scale. Topic Area 2: Pre-pilot ASPECT – to accelerate the development and market entry of strategically valuable, domestically produced chemicals. Following the NOFO announcement, AFFO will host an informational webinar to discuss a new, streamlined application and review process. Learn more about the topic areas, applicant eligibility and registration requirements, and the Teaming Partner List. Visit DOE eXCHANGE to view the full NOI.

Read More »

PTTEP achieves Thailand’s first wellhead platform reuse in Gulf of Thailand

PTT Exploration and Production Public Co. Ltd. (PTTEP) has completed Thailand’s first total wellhead platform reuse project by redeploying an entire decommissioned petroleum wellhead platform as a complete structure in Funan field in the Gulf of Thailand. The reuse project comes as part of PTTEP’s program to maximize value and extend utilization of wellhead platforms that remain structurally sound and safe after depleting resources at a location by redeploying the platform as a complete structure. The first implementation was carried out at the Jakrawan K wellhead platform (JKWK), in Funan field under the G1/61 Project. As part of the project, PTTEP adopted the wet-tow method to relocate the jacket, helping curb energy consumption and minimize impacts on marine life attached to the platform structure, supporting a balance between energy production and marine environmental stewardship. The topside, jacket, and selected pile sections were relocated and reinstalled for use within the same field, reducing the overall construction and installation period to only 6 months, down from about 20 months for a newly built platform.  Additionally, the approach cut construction costs by about 35–50% compared with construction of an entirely new wellhead platform. PTTEP said it expects the initiative to also reduce greenhouse gas emissions by about 3,270 tonnes of CO2e/platform by limiting the use of steel and other equipment required for construction of new platforms. PTTEP is operator of the G1/61 project (60%) with partner Mubadala Investment Co. (40%).

Read More »

Trump declares Iran ceasefire over; oil surges on renewed supply risk

US President Donald Trump said the ceasefire and memorandum of understanding (MOU) reached with Iran last month is effectively over following a fresh exchange of strikes, reigniting supply concerns and sending crude prices sharply higher. Speaking alongside NATO Secretary-General Mark Rutte at the alliance’s summit in Ankara, Pres. Trump said Washington no longer sees value in maintaining the ceasefire framework with Tehran, though he left open the possibility of continued talks. He added that further US military action against Iran remains likely after strikes overnight. Stay updated on oil price volatility, shipping disruptions, LNG market analysis, and production output at OGJ’s Iran war content hub. The escalation was triggered by alleged Iranian attacks on three commercial vessels transiting the Strait of Hormuz on July 7. US Central Command said it responded with strikes on more than 80 Iranian targets, including air defense systems, command-and-control infrastructure, anti-ship missile capabilities, and over 60 Islamic Revolutionary Guard Corps (IRGC) fast boats operating in and near the strait. US Central Command described the tanker attacks as a clear violation of the June 17 agreement. Iran’s Foreign Ministry called the US strikes a breach of the MOU and said Tehran would continue to defend its sovereignty. The IRGC said it retaliated with drone and missile strikes targeting US military facilities in Bahrain and Kuwait. Authorities in both countries reported intercepting incoming projectiles, with no material damage confirmed. Trump said on July 8 the US is considering reinstating a naval blockade targeting Iranian ports and vessels. He also raised the possibility of strikes on civilian infrastructure, including electric plants and desalination facilities, as well as a potential move to take control of Kharg Island, home to the bulk of Iran’s crude export infrastructure. He said Tuesday’s strikes had reached the island but had not targeted its

Read More »

US EIA forecasts declining oil prices as supply disruptions ease

In its July 7 Short-Term Energy Outlook (STEO) report, the US Energy Information Administration (EIA) said it expects global oil prices to decline as supply disruptions linked to the Strait of Hormuz ease and production recovers.  On June 18, the US and Iran signed a memorandum of understanding to end the conflict and reopen the strait, which had been largely closed since Feb. 28. The disruption to this critical oil transit chokepoint constrained global flows, driving major price volatility. Brent crude averaged $85/bbl in June, down $22/bbl from May and $32/bbl below its April peak. Prices fell below $70/bbl on July 1 as tanker traffic through the strait increased sharply, easing supply concerns. EIA now expects most shut-in crude production to return to near pre-conflict levels by yearend, with full restoration largely to be completed by first-quarter 2027.  Despite the recovery in flows, global inventories remain significantly depleted following earlier draws. EIA estimates oil inventories declined by an average of 5.1 million b/d in second-quarter 2026 and will fall by a further 2.2 million b/d in third-quarter 2026, as much of the recent tanker movement reflects previously stranded cargoes. As a result, the market is expected to remain relatively tight through most of third-quarter 2026 before shifting back into oversupply. EIA forecasts global oil consumption will decline by 1.2 million b/d in 2026, led by a 0.8 million b/d drop in non-OECD demand, particularly in the Asia Pacific. Demand is expected to rebound in 2027 as prices ease and supply normalizes, with consumption rising by 2.0 million b/d to 104.8 million b/d.  As supply growth outpaces demand, inventories are projected to build by 2.7 million b/d in fourth-quarter 2026 and by 5.0 million b/d in 2027. This shift is expected to place sustained downward pressure on prices. EIA forecasts Brent

Read More »

Eni lets EPCI contract for Kutei North Hub field FPSO

Eni North Ganal has let an engineering, procurement, construction, and installation (EPCI) contract to a joint venture between PT Saipem Indonesia and PT Tripatra Engineers and Constructors for a floating production, storage, and offloading (FPSO) unit for the Kutei North Hub Field Development Project in Kutei basin, offshore Indonesia, about 70 km off East Kalimantan. The project execution, with an estimated duration of 48 months, includes project management, engineering, procurement of materials, fabrication, construction and installation activities, as well as commissioning and start-up of the FPSO unit. The contract is valued at about $2 billion for Saipem’s share. The Kutei FPSO project is part of the Kutei North Hub Development, which comprises a subsea development tied back to the new FPSO, a dedicated gas export pipeline to the Bontang LNG plant, and domestic gas users via the existing East Kalimantan System. Eni North Ganal is controlled by Searah Ltd., which was formed through a strategic partnership between Eni and Petronas.

Read More »

Google Cloud configuration update disrupts VMware Engine stretched clusters

“Google made a network setting change that accidentally broke the connection between the two data center zones in VMware Engine. The virtual machines themselves kept running fine, but nobody could reach them, and there was a risk that some machines might lose the ability to save data properly. This indicates that even managed cloud infrastructure can experience failures in critical shared network components,” said Pareekh Jain, CEO at  EIIRTrend & Pareekh Consulting. Neil Shah, vice president at Counterpoint Research, said the real culprit here is the SDN orchestration control plane, where a routine internal network update or configuration tweak introduced routing failure across multiple zones. “While most of the physical nodes are distributed for exactly this redundancy purpose, they are still tightly coupled to a singular shared orchestration fabric, so if that control plane crashes, then everything comes crashing down, and the physical distributed nodes become irrelevant.” Stretched clusters fall short Although the outage did not bring down virtual machines, the incident undermined the primary reason enterprises deploy stretched clusters.

Read More »

AI’s Future Must Return to the Edge: How Power Constraints and Local Politics Are Redefining AI Infrastructure

Over the past two years, AI build plans have driven a sharp escalation in projected data center power demand. One recent assessment1 found that the U.S. disclosed data center development pipeline reached roughly 241 gigawatts by the end of 2025—an increase of about 159% in a single year—illustrating the unprecedented pace at which AI infrastructure demand is expanding. Forecasts from major analysts indicate that total data center power consumption could grow at least 50% by 2027 and potentially as much as 165% by 2030, with AI training and inference responsible for most of the incremental load.2 At this pace, planned AI capacity is growing faster than electric infrastructure can realistically be expanded. In many markets, available land and fiber are not the limiting factors; dependable megawatt delivery is.3 At the facility level, AI hardware is moving standard designs into new ranges. Power densities that once centered around 10–20 kW per rack are being replaced by configurations nearer 40 kW, with dense AI racks pushing toward 85 kW today and credible roadmaps to 200–250 kW per rack by 2030, though we’ve all seen the reports of even larger. These levels do not only affect cooling and white‑space layouts; they materially change the electrical infrastructure required per room and per building, and by extension the strain on local grids. On the power‑system side, constraints are now explicit. Transmission operators and regulators are stating that current generation, interconnection, and build‑out timelines are not sufficient to accommodate another decade of large demand centers in their present form. Analysts tracking AI data center energy demand point to electricity, grid access, and firm capacity as the primary constraints on new builds, with grid bottlenecks and transmission limitations flagged as risks for up to 20% of planned projects.4, 5  At the facility level, AI hardware is moving

Read More »

Data Center Frontier Trends Summit 2026 Preview

The Hidden Constraints of Delivery If power gets the headlines, supply chain and logistics often decide the schedule. Kleyman notes that a seemingly small missing component can delay a multibillion-dollar facility. A busway, switchgear component, cooling element, or logistics failure can ripple through construction sequencing, commissioning, customer handoff, and revenue recognition. “The weakest link may not be the most expensive component,” he says. That reality receives sustained attention across the Summit agenda. Day One’s “Beyond the Dashboard: Active Exception Management for Hyperscale AI” features CargoSense CEO Rich Kilmer in a live case study examining how organizations are moving beyond passive shipment visibility toward active exception management. For hyperscale AI projects, supply chain disruption is not simply about delayed shipments. It can affect site readiness, construction sequencing, commissioning windows, and the ability to bring capacity online as planned. Day Two’s “The Hidden Constraint: Supply Chains in the Age of AI Infrastructure” continues the discussion, examining how global supply chains are becoming a defining constraint and differentiator in AI data center delivery. The execution lens sharpens again on Day Three with “The Last 90 Days: Solving the Final Infrastructure Bottlenecks Before Go-Live.” This session focuses on the phase where projects can be won or lost: generator delivery, electrical integration, controls validation, startup sequencing, fuel systems, utility coordination, commissioning, and operational readiness. Even projects that have secured power, capital, customers, and equipment can face costly delays if the final stretch is not executed with precision. In the AI infrastructure era, the last 90 days may determine whether a project becomes energized capacity—or another delayed announcement. Capital Meets Execution Reality The Summit also examines whether capital is moving in step with what can actually be built. Day Two’s investment panel, “AI Infrastructure Investment: Bubble, Breakthrough, or Both?” will assess how investors are underwriting risk

Read More »

DCF Poll: How Much of the AI Data Center Pipeline Will Actually Get Built?

Matt Vincent is Editor in Chief of Data Center Frontier, where he leads editorial strategy and coverage focused on the infrastructure powering cloud computing, artificial intelligence, and the digital economy. A veteran B2B technology journalist with more than two decades of experience, Vincent specializes in the intersection of data centers, power, cooling, and emerging AI-era infrastructure. Since assuming the EIC role in 2023, he has helped guide Data Center Frontier’s coverage of the industry’s transition into the gigawatt-scale AI era, with a focus on hyperscale development, behind-the-meter power strategies, liquid cooling architectures, and the evolving energy demands of high-density compute, while working closely with the Digital Infrastructure Group at Endeavor Business Media to expand the brand’s analytical and multimedia footprint. Vincent also hosts The Data Center Frontier Show podcast, where he interviews industry leaders across hyperscale, colocation, utilities, and the data center supply chain to examine the technologies and business models reshaping digital infrastructure. Since its inception he serves as Head of Content for the Data Center Frontier Trends Summit. Before becoming Editor in Chief, he served in multiple senior editorial roles across Endeavor Business Media’s digital infrastructure portfolio, with coverage spanning data centers and hyperscale infrastructure, structured cabling and networking, telecom and datacom, IP physical security, and wireless and Pro AV markets. He began his career in 2005 within PennWell’s Advanced Technology Division and later held senior editorial positions supporting brands such as Cabling Installation & Maintenance, Lightwave Online, Broadband Technology Report, and Smart Buildings Technology. Vincent is a frequent moderator, interviewer, and keynote speaker at industry events including the HPC Forum, where he delivers forward-looking analysis on how AI and high-performance computing are reshaping digital infrastructure. He graduated with honors from Indiana University Bloomington with a B.A. in English Literature and Creative Writing and lives in southern New Hampshire with

Read More »

Powering Canada’s AI Future: Electricity, Policy, and the Race for Data Center Leadership

Alberta represents the biggest point of contention in Canada’s data center strategy. The province is aggressively pursuing data center development with its Artificial Intelligence Data Center Strategy. It has abundant natural gas, large land parcels, a deregulated power market, experienced energy developers and political leaders actively courting AI infrastructure. That makes it attractive to data center operators that care most about speed to power. Alberta has also promoted “bring your own generation” models, where data center developers pair facilities with dedicated generation rather than relying entirely on the public grid. But Alberta’s electricity system is much more carbon-intensive than Québec, British Columbia, Manitoba or Ontario. The same feature that makes it attractive for development, potential  large AI build-outs powered primarily by natural gas, would undercut Canada’s claim that its data centers can run on some of the cleanest power in the world. Saskatchewan illustrates another version of the opportunity. Bell Canada’s planned 300-megawatt AI data center in the Rural Municipality of Sherwood near Regina is a major signal that large-scale AI infrastructure can move beyond the traditional Toronto-Montreal-Calgary corridor. The project combines domestic telecom infrastructure, sovereign compute ambitions, hyperscale tenants, fiber partnerships, Indigenous procurement participation and closed-loop cooling. It also shows why power availability is now the deciding factor in site selection. At 300 megawatts, a single facility becomes a grid-planning event, not merely a real estate development. British Columbia, meanwhile, is trying to prioritize power among competing industrial demands. Data centers are arriving at the same time as mining, LNG, manufacturing, forestry, hydrogen and electrification projects. The province has moved toward limiting and screening certain high-load uses, including data centers and cryptocurrency mining, so that scarce clean electricity is allocated to projects with the strongest public benefit. This seems to be a preview of the future for these industrial

Read More »

DC Byte’s Colby Cox Talks Power, Density and the AI Data Center Map

For much of the past two years, the data center industry’s central question was whether artificial intelligence demand could sustain the unprecedented scale of infrastructure being announced in its name. That is no longer the most urgent question. The more immediate concern is whether developers can assemble the power, land, cooling systems, interconnections, capital, political support and community acceptance required to convert that demand into operating capacity. “AI infrastructure has moved from being a fast-growing demand segment to becoming the organizing principle of data center development,” said Colby Cox, Managing Director for the Americas at DC Byte, during a recent appearance on the Data Center Frontier Show podcast. The phrase captures a fundamental shift. AI is no longer simply one workload category competing for space inside the conventional data center market. It is beginning to determine where facilities are built, how campuses are financed, how electrical and mechanical systems are designed, and which regions can realistically participate in the next phase of digital infrastructure growth. The market has also moved beyond incremental expansion. Campuses planned around hundreds of megawatts—and increasingly multiple gigawatts—are no longer treated strictly as outliers. They are being conceived from the beginning around GPU density, liquid cooling, accelerated deployment and enormous concentrations of electrical load. Behind that transformation lies a second, increasingly decisive reality: Demand may be abundant, but deployable power is not. Executable Power Separates Announcements From Infrastructure From DC Byte’s market-intelligence vantage point, the dividing line between announced capacity and capacity likely to reach operation is increasingly straightforward. Has the power been secured? When can it be energized? Can the grid—or an onsite alternative—support the project’s intended phasing? “The market is no longer constrained primarily by demand or capital,” Cox said. “It is constrained by executable power.” That distinction matters because a headline capacity figure

Read More »

Microsoft will invest $80B in AI data centers in fiscal 2025

And Microsoft isn’t the only one that is ramping up its investments into AI-enabled data centers. Rival cloud service providers are all investing in either upgrading or opening new data centers to capture a larger chunk of business from developers and users of large language models (LLMs).  In a report published in October 2024, Bloomberg Intelligence estimated that demand for generative AI would push Microsoft, AWS, Google, Oracle, Meta, and Apple would between them devote $200 billion to capex in 2025, up from $110 billion in 2023. Microsoft is one of the biggest spenders, followed closely by Google and AWS, Bloomberg Intelligence said. Its estimate of Microsoft’s capital spending on AI, at $62.4 billion for calendar 2025, is lower than Smith’s claim that the company will invest $80 billion in the fiscal year to June 30, 2025. Both figures, though, are way higher than Microsoft’s 2020 capital expenditure of “just” $17.6 billion. The majority of the increased spending is tied to cloud services and the expansion of AI infrastructure needed to provide compute capacity for OpenAI workloads. Separately, last October Amazon CEO Andy Jassy said his company planned total capex spend of $75 billion in 2024 and even more in 2025, with much of it going to AWS, its cloud computing division.

Read More »

John Deere unveils more autonomous farm machines to address skill labor shortage

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More Self-driving tractors might be the path to self-driving cars. John Deere has revealed a new line of autonomous machines and tech across agriculture, construction and commercial landscaping. The Moline, Illinois-based John Deere has been in business for 187 years, yet it’s been a regular as a non-tech company showing off technology at the big tech trade show in Las Vegas and is back at CES 2025 with more autonomous tractors and other vehicles. This is not something we usually cover, but John Deere has a lot of data that is interesting in the big picture of tech. The message from the company is that there aren’t enough skilled farm laborers to do the work that its customers need. It’s been a challenge for most of the last two decades, said Jahmy Hindman, CTO at John Deere, in a briefing. Much of the tech will come this fall and after that. He noted that the average farmer in the U.S. is over 58 and works 12 to 18 hours a day to grow food for us. And he said the American Farm Bureau Federation estimates there are roughly 2.4 million farm jobs that need to be filled annually; and the agricultural work force continues to shrink. (This is my hint to the anti-immigration crowd). John Deere’s autonomous 9RX Tractor. Farmers can oversee it using an app. While each of these industries experiences their own set of challenges, a commonality across all is skilled labor availability. In construction, about 80% percent of contractors struggle to find skilled labor. And in commercial landscaping, 86% of landscaping business owners can’t find labor to fill open positions, he said. “They have to figure out how to do

Read More »

2025 playbook for enterprise AI success, from agents to evals

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More 2025 is poised to be a pivotal year for enterprise AI. The past year has seen rapid innovation, and this year will see the same. This has made it more critical than ever to revisit your AI strategy to stay competitive and create value for your customers. From scaling AI agents to optimizing costs, here are the five critical areas enterprises should prioritize for their AI strategy this year. 1. Agents: the next generation of automation AI agents are no longer theoretical. In 2025, they’re indispensable tools for enterprises looking to streamline operations and enhance customer interactions. Unlike traditional software, agents powered by large language models (LLMs) can make nuanced decisions, navigate complex multi-step tasks, and integrate seamlessly with tools and APIs. At the start of 2024, agents were not ready for prime time, making frustrating mistakes like hallucinating URLs. They started getting better as frontier large language models themselves improved. “Let me put it this way,” said Sam Witteveen, cofounder of Red Dragon, a company that develops agents for companies, and that recently reviewed the 48 agents it built last year. “Interestingly, the ones that we built at the start of the year, a lot of those worked way better at the end of the year just because the models got better.” Witteveen shared this in the video podcast we filmed to discuss these five big trends in detail. Models are getting better and hallucinating less, and they’re also being trained to do agentic tasks. Another feature that the model providers are researching is a way to use the LLM as a judge, and as models get cheaper (something we’ll cover below), companies can use three or more models to

Read More »

OpenAI’s red teaming innovations define new essentials for security leaders in the AI era

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More OpenAI has taken a more aggressive approach to red teaming than its AI competitors, demonstrating its security teams’ advanced capabilities in two areas: multi-step reinforcement and external red teaming. OpenAI recently released two papers that set a new competitive standard for improving the quality, reliability and safety of AI models in these two techniques and more. The first paper, “OpenAI’s Approach to External Red Teaming for AI Models and Systems,” reports that specialized teams outside the company have proven effective in uncovering vulnerabilities that might otherwise have made it into a released model because in-house testing techniques may have missed them. In the second paper, “Diverse and Effective Red Teaming with Auto-Generated Rewards and Multi-Step Reinforcement Learning,” OpenAI introduces an automated framework that relies on iterative reinforcement learning to generate a broad spectrum of novel, wide-ranging attacks. Going all-in on red teaming pays practical, competitive dividends It’s encouraging to see competitive intensity in red teaming growing among AI companies. When Anthropic released its AI red team guidelines in June of last year, it joined AI providers including Google, Microsoft, Nvidia, OpenAI, and even the U.S.’s National Institute of Standards and Technology (NIST), which all had released red teaming frameworks. Investing heavily in red teaming yields tangible benefits for security leaders in any organization. OpenAI’s paper on external red teaming provides a detailed analysis of how the company strives to create specialized external teams that include cybersecurity and subject matter experts. The goal is to see if knowledgeable external teams can defeat models’ security perimeters and find gaps in their security, biases and controls that prompt-based testing couldn’t find. What makes OpenAI’s recent papers noteworthy is how well they define using human-in-the-middle

Read More »