RAG-based Chatbot for Utility Operations and Customer Service

xcel_energy · Energy · 2024 · source Agentic: no · 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: Utility operations document review and customer-service knowledge access

Xcel Energy needed to speed up rate-case review, legal contract review, and earnings-call analysis over large regulated document corpora while preserving governance for sensitive utility data.

Constraints:

Architecture

Xcel Energy built a Databricks Mosaic AI RAG chatbot. Unity Catalog governs structured and unstructured documents, Databricks notebooks and Apache Spark ingest and prepare large datasets, Vector Search stores embeddings, Foundation Model APIs route prompts to LLMs, and MLflow tracks experiments. The team iterated across Llama 2, DBRX, Mixtral 8x7b, and Claude Sonnet 3.5 via AWS Bedrock while using the platform to answer questions over rate cases, contracts, earnings calls, energy price reports, and regulations.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  utility-document-corpus["Utility document corpus"] --> databricks-ingestion-pipeline["Databricks ingestion pipeline"]
  utility-document-corpus["Utility document corpus"] --> unity-catalog["Unity Catalog"]
  databricks-ingestion-pipeline["Databricks ingestion pipeline"] --> unity-catalog["Unity Catalog"]
  databricks-ingestion-pipeline["Databricks ingestion pipeline"] --> vector-search["Vector Search"]
  unity-catalog["Unity Catalog"] --> rag-chatbot["RAG chatbot"]
  vector-search["Vector Search"] --> rag-chatbot["RAG chatbot"]
  rag-chatbot["RAG chatbot"] --> foundation-model-apis["Foundation Model APIs"]
  foundation-model-apis["Foundation Model APIs"] --> model-candidates["Model candidates"]
  foundation-model-apis["Foundation Model APIs"] --> aws-bedrock-claude-sonnet["AWS Bedrock Claude Sonnet"]
  model-candidates["Model candidates"] --> mlflow-experiment-tracking["MLflow experiment tracking"]
  rag-chatbot["RAG chatbot"] --> business-reviewers["Business reviewers"]
  business-reviewers["Business reviewers"] --> mlflow-experiment-tracking["MLflow experiment tracking"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Utility document corpus Rate-case documents, regulations, earnings reports, contracts, invoices, and other source materials. Databricks ingestion pipeline, Unity Catalog
Databricks ingestion pipeline Notebook and Spark processing layer for preparing large document datasets. Utility document corpus, Unity Catalog, Vector Search
Unity Catalog Governance and fine-grained access-control layer for structured and unstructured data. Utility document corpus, Databricks ingestion pipeline, RAG chatbot
Vector Search Embedding index used to retrieve relevant document chunks for a question. Databricks ingestion pipeline, RAG chatbot
RAG chatbot User-facing retrieval-augmented question-answering system for utility operations and review workflows. Unity Catalog, Vector Search, Foundation Model APIs, Business reviewers
Foundation Model APIs Model access layer used to call selected LLMs for answer generation. RAG chatbot, Model candidates, AWS Bedrock Claude Sonnet
Model candidates Candidate LLMs and embedding configurations tested during development. Foundation Model APIs, MLflow experiment tracking
AWS Bedrock Claude Sonnet Selected Claude Sonnet 3.5 model path after earlier experiments. Foundation Model APIs
MLflow experiment tracking Tracks experiments across embeddings, language models, and quality iterations. Model candidates, Business reviewers
Business reviewers Rate-case, legal, and earnings-call users who consume chatbot answers and validate usefulness. RAG chatbot, MLflow experiment tracking

Data flow

Utility documents from government websites, legal contracts, invoices, earnings calls, and internal sources are ingested with Databricks notebooks and Spark. Unity Catalog manages the governed corpus and access controls. Prepared text is embedded and stored in Vector Search. A user question reaches the RAG chatbot, which retrieves relevant chunks, passes the context through Foundation Model APIs to a selected LLM, returns an answer with document grounding, and records experiments and model iterations in MLflow.

3 supporting quotes
“The solution leveraged Unity Catalog for data governance, Vector Search for embedding storage, Foundation Model APIs for LLM access, and MLflow for experiment tracking.”summary, stated
“the team leveraged Databricks Notebooks and Apache Spark for processing large datasets from diverse sources including government websites, legal documents, and internal invoices.”summary, stated
“The team experimented with multiple LLMs including Llama 2, DBRX, and Mixtral 8x7b before switching to Claude Sonnet 3.5 via AWS Bedrock”summary, stated

Why this architecture

The Databricks stack let Xcel combine governed data access, scalable ingestion, vector retrieval, model-provider flexibility, and experiment tracking in one platform. That mattered because the same chatbot needed to work across sensitive legal documents, regulatory materials, and large PDF-heavy review workflows, while the team was still experimenting with model and embedding choices.

3 supporting quotes
“A critical foundation for the project was establishing robust data governance practices.”summary, stated
“Databricks made it easy for us to experiment with different embeddings and language models to achieve the best performance possible.”article, stated
“before switching to Claude Sonnet 3.5 via AWS Bedrock, demonstrating the platform's flexibility for model iteration.”summary, stated

Models used: Llama 2 · DBRX · Mixtral 8x7b · Claude Sonnet 3.5 · Databricks Foundation Model APIs · AWS Bedrock

Scale

Alternatives considered (roads not taken)

Manual document search and review

Rejected because: Rate cases and earnings-call analysis required searching large document sets and could take months.

“Leadership also wanted faster access to insights from earnings call reports without manually searching through hundreds of pages of PDFs”summary, stated

Infrastructure built from scratch

Rejected because: Databricks integrated with internal data sources and dashboard tools so the team could focus on quality.

“allowing our team to focus on improving quality rather than setting up infrastructure from scratch.”article, stated

Stay on the initial open-source model experiments

Rejected because: The platform allowed model iteration and the team ultimately moved to Claude Sonnet 3.5 via AWS Bedrock.

“before switching to Claude Sonnet 3.5 via AWS Bedrock”summary, stated

Ungoverned document access

Rejected because: Sensitive legal contracts and proprietary materials required fine-grained controls.

“Unity Catalog provided fine-grained access controls to ensure data remained secure and compliant”summary, stated

Patterns

rag-retrieval (retrieval)

The chatbot retrieves relevant chunks from governed utility documents and feeds them to an LLM for context-aware answers.

“developed a RAG-based chatbot using Databricks Mosaic AI to streamline rate case reviews, legal contracts reviews, and earnings call analysis.”summary, stated

privacy-preserving-processing (governance)

Unity Catalog provides access control for public and sensitive legal/proprietary materials in the same RAG corpus.

“As a utility provider handling both public documents (earnings reports) and sensitive materials (legal contracts)”summary, stated

model-routing (model-selection)

The platform let Xcel test multiple LLMs and switch the answer-generation path to Claude Sonnet 3.5.

“The team experimented with multiple LLMs including Llama 2, DBRX, and Mixtral 8x7b before switching to Claude Sonnet 3.5”summary, stated

eval-driven-development (quality)

MLflow and model/embedding experiments gave the team a way to compare retrieval and generation quality.

“MLflow for experiment tracking.”summary, stated

Tradeoffs

Use an integrated Databricks stack

Chose Unity Catalog, Vector Search, Foundation Model APIs, and MLflow over Custom-built RAG infrastructure.

Rationale: The integrated stack reduced setup work and let the team focus on retrieval quality and workflow impact.

“streamlined every phase of the development, from data governance and model integration to monitoring and deployment.”article, stated

Use RAG over document corpora

Chose Context-aware chatbot answers over Manual document search across PDFs and reports.

Rationale: RAG reduced time spent finding relevant regulatory and business information.

“The chatbot reduced rate case review time from up to 6 months to 2 weeks by enabling context-aware responses from large document corpora including energy price reports and government regulations.”summary, stated

Keep model access flexible

Chose Foundation Model APIs and AWS Bedrock integration over A single fixed model backend.

Rationale: The team could evaluate Llama 2, DBRX, Mixtral, and Claude Sonnet 3.5 without redesigning the RAG app.

“The team experimented with multiple LLMs including Llama 2, DBRX, and Mixtral 8x7b before switching to Claude Sonnet 3.5 via AWS Bedrock, demonstrating the platform's flexibility for model iteration.”summary, stated

Gotchas (what bit them)

RAG over utility documents requires governance before retrieval quality matters.

Root cause: The corpus mixes public reports with sensitive legal contracts and internal materials.

Resolution: Use Unity Catalog for centralized management and fine-grained access controls.

“including the document corpus that serves as the chatbot's knowledge base. Unity Catalog provided fine-grained access controls”summary, stated

Manual review workflows scale poorly over PDF-heavy regulatory material.

Root cause: Rate cases and earnings reports involve complex documentation and hundreds of pages of PDFs.

Resolution: Use retrieval-augmented answers to surface relevant context from the corpus.

“Leadership also wanted faster access to insights from earnings call reports without manually searching through hundreds of pages of PDFs, while the legal team sought quick access to details from customer contracts.”summary, stated

Initial model choices may not remain best as requirements sharpen.

Root cause: Different embeddings and language models perform differently for governed document QA.

Resolution: Keep model access and experiment tracking flexible enough to switch providers.

“Additionally, Databricks made it easy for us to experiment with different embeddings and language models to achieve the best performance possible.—Blake Kleinhans, Senior Data Scientist, Xcel Energy”article, stated

Evaluation

Xcel used MLflow and Databricks platform capabilities to iterate across embeddings and language models, with business impact measured by review-time reduction.

Metrics: rate-case review time · model performance · embedding performance · time to value · data-governance compliance

“MLflow for experiment tracking.”summary, stated
“Databricks enabled rapid development and deployment of our RAG-based chatbots, significantly improving our time to value.”article, stated

Outcomes

Concrete anchors include 3.4 million electricity customers, 1.9 million natural gas customers, eight U.S. states, four named model families, and review-time reduction from 6 months to 2 weeks.

“Now, rate cases based on a review of complex documentation, including energy price reports and government regulations, take 2 weeks instead of up to 6 months.”article, stated
“The team experimented with multiple LLMs including Llama 2, DBRX, and Mixtral 8x7b before switching to Claude Sonnet 3.5”summary, stated