Problem
Oil and gas companies keep data in spreadsheets, seismic files, documents and industry formats such as Log ASCII Standard (LAS) well logs. An analyst who wants one fact must find the right file, then filter a table or parse the format by hand. For the largest companies, one day less to first oil changes costs and revenue by millions of dollars. One prompt or one retrieval index does not suit questions this different.
Example from the article: "How much oil did API 490251069400 produce on March 2001?" needs a filter by well number and a sum over the oil column.
Solution in brief
An assistant on Claude models in Amazon Bedrock classifies each question with a router prompt. The router sends it to a tool made for that data type: file-name search, semantic search, a code-writing tool per table, or one for LAS files. A layer before the router rewrites follow-ups using the chat history. The code-writing tools return the generated code's output directly.
Questions this case answers
- How to answer natural-language questions over heterogeneous data (documents, tables, specialized file formats) when one prompt or one retrieval method cannot handle every question type
- How to keep an LLM that analyses tabular data from retyping or inventing large results when the answer is a filtered table
- How to build an LLM assistant that answers questions over files, spreadsheets and domain-specific file formats at once
- How to route each user question to the right tool when the data comes in different types
Tools and methods
- Router prompt (Claude v2.1) — classifies a question into a tool category and returns XML.
- Amazon Bedrock Knowledge Bases — managed retrieval over the S3 bucket for content questions.
- Tables tool — LLM writes Python for one CSV or Excel file.
- LAS tool — LangChain XML agent with a Python REPL, prompted with lasio usage.
- Query rewriting layer — makes follow-ups self-contained.
Google or a one-time email code. No password.