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

Department of Energy Announces American Nuclear Supply Chain Loans

WASHINGTON—The U.S. Department of Energy’s (DOE) Office of Energy Dominance Financing (EDF) issued a conditional loan commitment to finance the purchase of long-lead time items needed to rebuild America’s commercial nuclear supply chain. The $17.5 billion American Nuclear Supply Chain Loans will help finance five eligible projects sponsored by utilities and energy companies nationwide to accelerate the deployment of 10 large-scale commercial nuclear reactors across the United States by up to three years. The project marks a major step toward advancing President Trump’s Executive Order, Reinvigorating the Nuclear Industrial Base, by supporting the objective of having 10 new large nuclear reactors with complete designs under construction by 2030. “Just over one year ago, President Trump directed the Energy Department and its agency partners to unleash the next American nuclear renaissance,” U.S. Energy Secretary Chris Wright said. “To accomplish that mission, these conditional loans will play an important role in reviving the supply chain needed for America to once again build large-scale commercial reactors. They will also help accelerate the timeline of building those large-scale reactors by up to three years, lowering construction costs and ensuring the United States is able to deliver on President Trump’s bold and ambitious energy addition agenda.” Westinghouse’s AP1000® units are the only licensed large-scale advanced commercial reactors operating in the United States today. Long-lead items are complex components of a nuclear power plant that require the longest time for manufacturing and delivery.   EDF financing will support up to five loans, each loan supporting two reactors at a project site. Westinghouse will partner with up to five eligible utilities and energy companies nationwide to procure the long-lead items at a fixed price. Each project will be jointly owned by Westinghouse and a utility or energy company partner. Both Westinghouse and the partner are required to

Read More »

FPSO ready for Santos-led Barossa LNG project

BW Offshore completed the Interim Performance Test (IPT) for the BW Opal floating production, storage, and offloading vessel (FPSO) as part of the commissioning program for the Santos Ltd.-operated Barossa LNG project about 285 km offshore from Darwin in the Northern Territory of Australia. The milestone is part of early-stage technical testing and adjustments following  first gas from the FPSO in September and the beginning of flow from subsea wells. BW Offshore confirmed that key production, processing, and utility systems on the FPSO were operating in an integrated manner and capable of delivering stable performance under production conditions. Following the restart of production in early May, BW Opal has continued gas production and export. Production is being managed in close coordination with Santos during this phase of the ramp-up and commissioning program. BW Opal contains a 358-m hull and accommodation for up to 140 personnel. It has gas handling capacity of 850 MMscfd and condensate handling capacity of 11,000 b/d. The FPSO will feed the Darwin LNG plant for the next two decades. The Barossa LNG project consists of the FPSO, a subsea production system, supporting in-field subsea infrastructure, a gas export pipeline, and a Darwin pipeline duplication. Up to eight subsea wells are planned (six wells from three drill centers) with contingency plans for an additional two wells. Gas and condensate is gathered from the wells through the subsea production system and then brought to the FPSO via a network of subsea infrastructure. Santos operates the Barossa LNG project (50%) with joint venture partners PRISM Energy International Australia Pty Ltd. (37.5%) and JERA Australia (12.5%).

Read More »

Equinor mulls additional Johan Sverdrup development phase

Equinor Energy AS is considering further development of the Johan Sverdrup area resources in the North Sea. Production from discoveries in Tonjer west and east and Geitungen would form the basis for the maturation of a potential phase 4 development in the northern part of the field. The volumes would be developed via subsea tieback to existing Johan Sverdrup infrastructure. Tonjer lies in the northernmost part of the Geitungen terrace in the Johan Sverdrup area. Oil was discovered in the area, but volumes and potential have been uncertain. The drilling of two appraisal wells and a sidetrack have provided a more precise assessment of the resource base.  Preliminary estimates for Tonjer and Geitungen combined are 20-30 MMboe. Further analyses of subsurface data will form the basis for more precise resource estimates. Phase 4 is now being matured towards an investment decision with a possible production start-up in 2029. Johan Sverdrup Johan Sverdrup, which accounts for about one third of Norwegian oil production, lies on the Utsira High (Utsirahøyden) in the central part of the North Sea, 65 km northeast of Sleipner field in water depths of 115 m. The main reservoir contains oil in Upper Jurassic intra-Draupne sandstone. The reservoir depth is 1,900 m. The quality of the main reservoir is excellent with very high permeability. The remaining oil resources are in sandstone in the Upper Triassic Statfjord Group and Middle to Upper Jurassic Vestland Group, as well as in spiculites in the Upper Jurassic Viking Group. Oil was also proven in Permian Zechstein carbonates. Equinor is operator of Johan Sverdrup (42.62%) with partners Aker BP (31.57%), Petoro (17.36%), and TotalEnergies (8.44%).

Read More »

Beacon advances deepwater Gulf developments with Monument, Zephyrus field work

Beacon Offshore Energy LLC is advancing two deepwater Gulf of Mexico developments, having drilled the first development well at Monument field and brought a second production well online at Zephyrus field. At Monument in Walker Ridge Block 315, the first development well reached a total depth of 32,250 ft and encountered 245 ft of net pay (true vertical thickness) in Lower Wilcox reservoirs, confirming pre-drill expectations for reservoir quality, the operator said. Beacon will continue drilling a second development well before completing the initial two-well program. First oil from the Wilcox development is expected before yearend 2026. Monument is being developed through a two-well, 17-mile subsea tieback to the Beacon-operated Shenandoah floating production system, which was designed as a regional host platform for developments in the northwestern Walker Ridge area, including Shenandoah, Monument, and Shenandoah South fields. Partners are Navitas Petroleum and Talos Energy Inc. At Zephyrus in Mississippi Canyon Block 759, production from the Zephyrus #2 well began in late April after the well was completed in first-quarter 2026. The well is producing from Miocene sands.  Combined with Zephyrus #1, which started production in late 2025, the field is expected to reach peak production of more than 20,000 boe/d. The Zephyrus development is tied back to the Shell plc-operated West Boreas subsea infrastructure, with production processed on the Olympus tension-leg platform in the Mars corridor. Partners are Houston Energy, HEQ II, Red Willow Offshore, Westlawn Americas Offshore, and Murphy Exploration & Production.

Read More »

Greece approves Chevron’s farm-in for offshore Block 10

Greece approved Chevron Corp.’s farm-in to offshore Block 10, clearing the way for the US major to complete its acquisition of a 70% interest and operatorship from HELLENiQ Energy. Greece’s Ministry of Environment and Energy and the Hellenic Hydrocarbon and Energy Resources Management Co. (HHRE) said June 15 that all administrative approvals have been completed for the transfer of the interest and operatorship. Chevron and HELLENiQ submitted the request for approval May 28. The companies also requested a 15-month extension of the second exploration phase for the block, which lies offshore the Kyparissia Gulf in the southern Ionian Sea. Following completion of the transfer, Chevron will hold a 70% interest and serve as operator, while HELLENiQ will retain the remaining 30%. Geological, geophysical, and environmental studies have been completed on the concession, including acquisition of 1,210 km of 2D seismic data in 2022 followed by 2,416 sq km of 3D seismic covering 88% of the block. The partners will use the seismic data to evaluate potential drilling targets before deciding whether to proceed to a third exploration phase, which includes an exploratory well. Chevron and HELLENiQ are already partners in four offshore concessions south of Crete and the Peloponnese, making Block 10 their fifth joint offshore license in Greece. Chevron said the agreement advances its strategy of expanding its exploration portfolio in the Eastern Mediterranean. Greek officials said the investment reflects confidence in the country’s offshore licensing framework and supports its long-term goal of strengthening Greece’s role in regional energy supply if exploration proves successful.

Read More »

Comstock farms out minority interest in midstream subsidiary for $600 million

@import url(‘https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap’); .ebm-page__main h1, .ebm-page__main h2, .ebm-page__main h3, .ebm-page__main h4, .ebm-page__main h5, .ebm-page__main h6 { font-family: Inter; } body { line-height: 150%; letter-spacing: 0.025em; } button, .ebm-button-wrapper { font-family: Inter; } .label-style { text-transform: uppercase; color: var(–color-grey); font-weight: 600; font-size: 0.75rem; } .caption-style { font-size: 0.75rem; opacity: .6; } #onetrust-pc-sdk [id*=btn-handler], #onetrust-pc-sdk [class*=btn-handler] { background-color: #c19a06 !important; border-color: #c19a06 !important; } #onetrust-policy a, #onetrust-pc-sdk a, #ot-pc-content a { color: #c19a06 !important; } #onetrust-consent-sdk #onetrust-pc-sdk .ot-active-menu { border-color: #c19a06 !important; } #onetrust-consent-sdk #onetrust-accept-btn-handler, #onetrust-banner-sdk #onetrust-reject-all-handler, #onetrust-consent-sdk #onetrust-pc-btn-handler.cookie-setting-link { background-color: #c19a06 !important; border-color: #c19a06 !important; } #onetrust-consent-sdk .onetrust-pc-btn-handler { color: #c19a06 !important; border-color: #c19a06 !important; } Comstock Resources Inc. sold a minority equity interest in its midstream subsidiary, Pinnacle Gas Services LLC, to certain funds managed by investment firm Sixth Street. Pinnacle provides gathering and treating services for Comstock’s Western Haynesville production through 246 miles of high-pressure pipeline and two gas treating plants. The infrastructure supports development of Comstock’s 540,000-net-acre Western Haynesville position, part of its 1,074,868 gross-acre (806,980 net) Haynesville/Bossier portfolio in Texas and Louisiana. Comstock is operating four rigs in the Western Haynesville this year as it continues delineating the play and expects to drill 21 wells and bring 20 online in 2026. The company also plans to operate five rigs in its legacy Haynesville position, where it expects to drill 50 wells and bring 48 online to support production growth through 2027. <!–> –><!–> –> Oct. 31, 2023 Sixth Street invested $600 million for a 27% equity interest in Pinnacle Gas Services, while Comstock Resources retains a 73% controlling interest and continues to manage and operate Pinnacle under a management services agreement. Under the terms of deal, Sixth Street’s ownership will be reduced to 19.5% when certain return thresholds are met, with Comstock’s interest increasing to 80.5%. Comstock chief

Read More »

KKR Bets Big on AI Infrastructure With Helix Launch, Tapping Former AWS CEO Adam Selipsky to Build a New Hyperscale Model

To close industry watchers, it’s really no secret that the AI infrastructure race has entered another phase; one where capital formation itself may become as strategically important as GPUs, power procurement, or liquid cooling. And in launching Helix Digital Infrastructure, investment giant KKR is making a calculated wager that hyperscalers no longer simply need developers or financiers. They need a partner capable of orchestrating capital, energy, connectivity, and data center execution as a unified platform. The significance of that strategy is underscored by the executive chosen to lead it. Adam Selipsky, the former CEO of Amazon Web Services and one of the industry’s most experienced cloud operators, will serve as Co-Founder and CEO of Helix, bringing firsthand experience from the very class of customers the new venture intends to serve. A New Model for AI Infrastructure Helix launches with more than $10 billion in long-duration committed capital from founding investors including KKR, the Kuwait Investment Authority (KIA), NVIDIA, and Vistra. But the headline number tells only part of the story. The company has been structured around an increasingly important thesis: that AI infrastructure can no longer be assembled piecemeal. Rather than treating data centers, electrical supply, transmission capacity, and fiber connectivity as separate procurement exercises, Helix proposes a vertically coordinated approach in which a single organization manages and finances the entire infrastructure stack. According to KKR, the objective is to reduce execution risk and accelerate deployment for hyperscale customers facing unprecedented AI demand. As AI factories grow from hundreds of megawatts toward gigawatt-scale campuses, synchronization among land acquisition, utility planning, financing, construction, and technology deployment has emerged as one of the industry’s defining challenges. Helix is effectively positioning itself as an operating platform designed to simplify that complexity. Why Selipsky Matters The appointment of Adam Selipsky may be the announcement’s

Read More »

Beyond Hyperscale: Why Enterprise Data Centers Still Matter in the AI Era

“The enterprise data centers, even the new ones, tend to be far, far smaller than new hyperscale deployments,” Killian said. “Not uncommon to see enterprises deploy a quarter meg or one meg or two, maybe up to 10 megs. Whereas the hyperscale guys are deploying 40 up to 300 meg facilities.” But scale alone does not tell the story. For every one of the roughly 20 hyperscale users that dominate headlines, Killian noted, there may be 50 to 100 times as many large and mid-sized enterprise users. Those companies run critical business systems, purchase hardware, software, telecom and services, employ large data center teams, and often operate multiple facilities across domestic, edge, EMEA and Asia-Pacific footprints. In other words, enterprise demand may be smaller in unit size, but it remains massive in aggregate. And as AI shifts from training to inference, the enterprise data center could become newly strategic. Enterprise AI Is Not Hyperscale AI Killian’s central point is that enterprise infrastructure requirements differ materially from hyperscale requirements. Hyperscalers are primarily optimizing for massive scale and speed to market. Enterprises, by contrast, tend to prioritize reliability, flexibility, integration into broader IT systems, and audit and compliance. That difference has major implications for developers and colocation providers. “The real industry opportunity is to take some of the innovation and the economies of scale that we’re seeing from the hyperscale builds to deliver smaller chunks of data center capacity,” Killian said. That might mean adapting lessons from 40 MW or 100 MW campuses into enterprise-ready deployments of 2 MW, 4 MW or 8 MW. Killian pointed to providers such as DataBank and Flexential as examples of companies working to deliver hyperscale-derived efficiencies in smaller enterprise increments. He also noted that QTS and other large campus developers may reserve portions of multi-building campuses

Read More »

Revolutionizing Data Center Cooling: Innovations for AI and HPC Growth

This is a crucial point for AI infrastructure. In some markets, water can be as politically and operationally difficult as power. Evaporative cooling and cooling towers can consume large volumes of water, while discharge permits can slow projects or limit operations. Gradiant claims HyperSolved can expand access to alternative sources such as municipal reuse and impaired supplies, reduce reliance on freshwater, protect cooling performance through integrated treatment and AI-enabled operations, and minimize discharge through high-recovery concentration and reuse. The platform uses containerized systems for immediate or temporary capacity while also supporting permanent infrastructure and lifecycle operations from commissioning onward. That fits the AI data center buildout, where developers may need bridge capacity during construction, phased water infrastructure, or interim systems while permanent treatment plants are completed. This can address the speed of deployment issue that plagues many data center solutions. Water is becoming a siting and scaling variable that has to be addressed. A site may have land and power prospects, but if water sourcing, reuse, or discharge cannot be solved, the project will face higher costs, delays, and local opposition. Gradiant is positioning itself as the managed water layer for hyperscale AI, similar to how power providers, cooling vendors, and network suppliers each own critical infrastructure domains. The Pattern: Hybridization, Standardization, and Industrial Scale The announcements included here make it clear that cooling is seeing significant attention from technology vendors, and not just state-of-the-art new technologies such as direct-to-chip, but also traditional data center air cooling. T-Global and SiPearl are working on high-conductivity materials and two-phase modules for HPC chips. Castrol is providing fluids for direct-to-chip and immersion environments. These are technologies aimed at the heat source itself, where higher chip power and rack density are overwhelming conventional approaches. The reference design offerings from Johnson Controls acknowledges the importance

Read More »

Building the AI Factory: Power, Cooling, and Execution at Scale Meets the Deployment Reality Gap – Q2 Executive Roundtable

At Data Center Frontier, we rely on industry leaders not only to help us understand the most urgent challenges reshaping digital infrastructure, but also to illuminate the broader technological, operational, and market forces driving the industry’s evolution. And in the Second Quarter of 2026, those challenges increasingly revolve around a fundamental shift in emphasis: the industry is moving beyond discussing AI infrastructure in theory and into the far more demanding work of deploying, operating, and scaling it in production.  The era when hyperscale announcements and GPU roadmaps dominated the conversation is giving way to one defined by execution; where power availability, thermal management, construction schedules, supply chains, and operational discipline determine whether ambitious plans become functioning AI factories. That transition is exposing new realities. Rack densities continue to climb, liquid cooling is becoming mainstream, electrical architectures are evolving, and project timelines are compressing even as capital commitments reach unprecedented levels.  Success increasingly depends not on optimizing individual systems in isolation but on orchestrating tightly integrated environments where compute, power, cooling, networking, and facility operations function as a unified whole. At the same time, moving from pilot deployments to industrial-scale AI infrastructure introduces an entirely different class of challenges around reliability, maintainability, commissioning, and repeatable execution. For our Q2 Executive Roundtable, we brought together senior leaders whose expertise spans AI infrastructure design, mission-critical deployment, advanced thermal management, and engineering innovation to examine where the industry stands today, and what it will take to bridge the gap between AI ambition and AI deployment at scale. Drawing on perspectives from hyperscale execution, liquid cooling, and next-generation power and facility engineering, their insights explore the practical realities of building the AI factory at industrial scale.

Read More »

Upscale AI readies Skyhammer scale-up networking tech, raises new funding

Khemani said that unlike commodity data center chips repurposed for AI, Skyhammer is being developed specifically for AI scale‑up use cases and is tightly coupled to Upscale’s broader full‑stack strategy, which spans silicon, systems and software. Khemani declined to share detailed timelines, but he said Upscale expects to reveal product details on Skyhammer later this year, with actual deployment synced to when GPU and XPU vendors are ready. “The Skyhammer product doesn’t work by itself,” he explained. “It works in conjunction with XPUs and GPUs, and so for us to be deployed, the XPUs and GPUs need to incorporate scale‑up capabilities to interoperate with us.” Nvidia, Spectrum X, and strategic capital Nvidia sits at the center of Upscale AI’s story, both as a technology partner and now as a strategic investor. 

Read More »

Edge networks a particular challenge for summer power, IT staffing needs

Power failures continue to dominate data center outage causes, accounting for 45% of impactful outages in Uptime Institute’s recently released 2026 Annual Outage Analysis report. While that figure declined from the previous year, it remains significantly higher than any other category. Within power-related incidents, UPS failures, transfer switch failures, and generator failures are the leading root causes. Uptime analysts said growing grid instability, power constraints, and high-density compute deployments are creating new pressure points for operators already running closer to capacity limits, according to a recent story on the report in Network World. Beyond power issues, hardware failures—particularly related to storage—also contribute to downtime. He noted that a lack of routine updates, especially to firmware, can make these problems worse, even when the underlying hardware is still functional.

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 »

A man of many words

Brian Sietsema has a favorite word. It’s somewhat surprising that he can choose just one. He’s the person spellers rely on to confirm pronunciations and

Read More »