LLM-Powered Multi-Tool Architecture for Oil & Gas Data Exploration

dxc · Energy · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Oil and gas data exploration

DXC and AWS needed an assistant that could answer oil-and-gas questions over scattered, non-standard data sources spanning text, tables, file systems, and LAS well-log formats.

Constraints:

Architecture

DXC built an Amazon Bedrock/Claude assistant with a router, data-type-specific tools, S3-backed data access, Bedrock Knowledge Bases for semantic search, custom table and LAS code-writing tools, and a query-rewriting layer for conversational follow-ups. Smaller Claude variants handle routing while stronger models handle code generation and tool-specific reasoning.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Query_rewriter["Context-aware query rewriter"] --> Router["Claude router"]
  Router --> File_search["File search tool"]
  Router --> Semantic_search["Semantic search tool"]
  Router --> Tables_tool["Tables tool"]
  Router --> LAS_tool["LAS tool"]
  S3_store["S3 data store"] --> File_search
  S3_store --> Semantic_search
  S3_store --> Tables_tool
  S3_store --> LAS_tool
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Context-aware query rewriter Adds missing conversational context or answers simple rewrite/translation requests without tool use. Claude router
Claude router Categorizes user questions and routes them to specialized oil-and-gas tools. Context-aware query rewriter, File search tool, Semantic search tool, Tables tool, LAS tool
S3 data store Stores the underlying files and provides signed URLs for resources shown in the UI. File search tool, Semantic search tool, Tables tool, LAS tool
File search tool Searches file names/extensions using LLM-extracted keywords and extensions. Claude router, S3 data store
Semantic search tool Uses Amazon Bedrock Knowledge Bases to retrieve and answer over text content. Claude router, S3 data store
Tables tool Generates and runs Python code over CSV/Excel data for production and directional-survey questions. Claude router, S3 data store
LAS tool Uses LLM-generated Python with lasio and a Python REPL to inspect well-log files. Claude router, S3 data store

Data flow

A user query first goes through a context-aware query-rewriting layer when chat history matters. The router classifies the rewritten query into file, production, directional-survey, LAS, knowledge-base, or unrelated categories, then dispatches to the appropriate tool. Tools retrieve or compute over S3-backed data, return structured outputs/resources, and the UI presents the final answer.

3 supporting quotes
“The router analyzes the user query and routes it to the appropriate tool”article, stated
“The data is indexed by relevant tools when deploying the solution, and we use signed S3 URLs to provide access to the relevant data sources in the UI.”article, stated
“we added another layer before the router that takes the user query and the conversation history and rewrites the user query with context that might be missing from it.”article, stated

Why this architecture

The assistant uses multiple specialized tools because oil-and-gas questions differ by data type: some require file-name filtering, some semantic document retrieval, some tabular computation, and some LAS-specific parsing. Separating query rewriting from routing keeps each LLM task simpler and improves follow-up behavior at the cost of about one second of latency.

3 supporting quotes
“The way to deal with each of these questions requires different processing steps.”article, stated
“we built specialized tools. The tools that we built are data-type specific (text, tables, and LAS), except for the file search tool”article, stated
“we find that it’s more straightforward for LLMs to perform tasks separately, because they can get overwhelmed when faced with too many instructions.”article, stated

Models used: Anthropic Claude v2.1 · Anthropic Claude Haiku · Amazon Bedrock Knowledge Bases · LangChain XML agent · Python REPL

Scale

Alternatives considered (roads not taken)

Single generic agent for every data type

Rejected because: DXC split tools by file name, semantic content, tables, and LAS because each question type required different processing.

“To optimally handle the variety of tasks for the chatbot, we built specialized tools.”article, stated

LangChain/Pandas-style final answer generation after code execution

Rejected because: Sending large DataFrames back to the LLM adds latency and hallucination risk, so DXC returns Python outputs directly.

“Having an LLM generate the response as an extra step after the code execution introduces both latency and a risk for hallucination.”article, stated
“we wanted the LLM to generate code that we could run to obtain the desired output directly”article, stated

Combining query rewriting and routing in one prompt

Rejected because: The team found separate tasks more straightforward for LLMs than one overloaded prompt.

“Another way to handle this would have been to combine the query rewriting and the router in a single prompt”article, stated
“LLMs to perform tasks separately, because they can get overwhelmed when faced with too many instructions.”article, stated

Patterns

tool-use-orchestration (orchestration)

The router directs each user question to file, text, table, or LAS tools optimized for the relevant data type.

“The AI assistant is powered by an intelligent agent that routes user questions to specialized tools that are optimized for different data types”article, stated

model-routing (cost-performance)

DXC uses smaller faster Claude models for routing and more powerful Claude variants for code generation.

“We used smaller, faster models for basic tasks such as routing, and more powerful models for complex processes such as code generation.”article, stated

rag-retrieval (retrieval)

Semantic content search uses Amazon Bedrock Knowledge Bases to retrieve relevant documents before Claude answers.

“Use the retrieve API from Amazon Bedrock Knowledge Bases to retrieve documents semantically close to the query.”article, stated

query-rewriting (context)

A pre-router layer rewrites follow-up questions with missing context from prior conversation turns.

“If the query needs context from previous questions,  rewrite the query so the expert can understand it, otherwise, forward the query as-is.”article, stated

structured-output-contract (guardrails)

Router and tools require XML tags so downstream code can parse categories, answers, resources, and new queries.

“Using XML tags in the output allows you to parse out the right category for the question.”article, stated

Tradeoffs

Use query rewriting before routing

Chose separate rewrite layer over combining rewrite and routing in one prompt.

Rationale: The separate layer adds about one second but improves follow-up context and keeps tasks simpler for the model.

“This query rewriting step adds an extra second in terms of latency, and could be toggled off, but it greatly enhances user experience”article, stated

Return computed table output directly

Chose direct Python result output over LLM-authored final response over the DataFrame.

Rationale: Direct output reduces latency and avoids hallucinating or truncating large tabular results.

“after the code is run, we return the output, whereas with traditional agents, this output is passed back to the agent to generate the final response.”article, stated

Use smaller models for routing and larger models for code generation

Chose task-specific Claude model variants over one model for all subtasks.

Rationale: The article directly frames routing as basic and code generation as complex, supporting a cost/latency split.

“We used smaller, faster models for basic tasks such as routing, and more powerful models for complex processes such as code generation.”article, stated

Gotchas (what bit them)

Sending large computed DataFrames back to an LLM can introduce hallucination and context-window risk.

Root cause: Traditional code agents run code and then ask the LLM to rewrite the output as a final response.

Resolution: Return the Python output directly to the user interface for table tasks.

“passing the DataFrame back to the agent to generate the final response would have the LLM rewrite that large DataFrame with risk of either exceeding the context window or hallucinating some of the data.”article, stated

Follow-up questions lose essential API numbers or years without conversation context.

Root cause: The basic router is stateless and only handles one user query at a time.

Resolution: Add a query-rewriting layer before routing.

“The basic router handles a single user query and isn’t aware of chat history. However, conversational context is an essential part of the user experience.”article, stated

Too many retrieved resources can cut off the answer.

Root cause: LLMs have limited input and output tokens when many files match a query.

Resolution: Add controls to limit retrieved context and output size.

“we also implement controls to make sure the retrieved context isn’t too large and that the LLM’s answer isn’t cut off”article, stated

Evaluation

The case demonstrates tool behavior with concrete sample questions over file search, semantic search, production tables, LAS files, and conversational follow-ups; it reports qualitative workflow speedup from hours to minutes.

Metrics: hours reduced to minutes for data exploration · one extra second latency for query rewriting · multiple sample tool flows over Teapot Dome data

“The following is an example of a conversational flow. The user first asks about the measurements for a given API, which requires the LAS tool.”article, stated
“Data exploration tasks that took hours can now be achieved in just a few minutes”article, stated

Outcomes

The assistant is framed for DXC's oil-and-gas customers, where even one day faster time to first oil can affect costs and revenue by millions of dollars.

“The end-to-end solution showcases how LLMs can transform data exploration workflows through the use of specialized tools and conversational interfaces.”article, stated
“dramatically reducing time to first oil for DXC’s customers.”article, stated