Skip to content

Enterprise AI without sending data outside: the architecture I am using to turn Excel into evidence

How I designed a local pipeline for sensitive corporate data: irregular Excel files, normalization, local AI, verifiable rules, human correction and Power BI without making a chatbot the source of truth.

By 7 min read
  • local ai
  • power bi
  • excel
  • enterprise data
  • architecture

The project started with one constraint that eliminated half the fashionable solutions

The business requirement was simple to state and difficult to satisfy:

Passage link

corporate data must not leave the controlled environment.

Passage link

That immediately changes the architecture.

Passage link

A workflow that casually uploads spreadsheets to an external model endpoint, sends traces to a public observability SaaS or stores prompts in a third-party analytics service is no longer acceptable just because the model itself is "private".

Passage link

The boundary has to include data, inference, logs, temporary files, embeddings, backups and support tooling.

Passage link

This is the kind of requirement that turns AI from a feature into infrastructure.

Passage link

Starting with a chatbot would have been the wrong move

The source data was a continuously maintained Excel workbook with many worksheets, merged cells, formulas, color conventions and inconsistent layouts.

Passage link

The useful business questions were analytical:

Passage link
  • what problem increased?
  • since when?
  • on which products, lots or lines?
  • what operational event happened around the same period?
  • what hypothesis exists?
  • what evidence supports it?

A chat interface cannot compensate for a weak data foundation.

Passage link

So the first version of the architecture was not "Excel → LLM → answer". It was closer to:

Passage link
txt
Excel
  ↓
raw extraction
  ↓
normalized records
  ↓
canonical business model
  ↓
AI enrichment / grouping
  ↓
human correction
  ↓
curated analytical tables
  ↓
Power BI
Passage link

Before AI comes ingestion engineering

Messy spreadsheets are semi-structured interfaces built for humans.

Passage link

Merged cells may carry hierarchy. Blank rows may separate sections. Colors may encode status. Formulas may be more valuable than their current displayed value.

Passage link

A robust extractor therefore needs to understand more than pandas.read_excel() followed by dropna().

Passage link

I want to capture, when relevant:

Passage link
  • worksheet name;
  • row and column coordinates;
  • raw cell value;
  • formula;
  • formatted value;
  • fill/style signals used by the business;
  • merged-range membership;
  • source file version or hash.

That metadata gives me a way to trace a normalized record back to its origin.

Passage link

I like creating an almost untouched raw layer

The raw layer is not pretty. That is the point.

Passage link

Its job is to preserve enough of the source to let me reprocess later when extraction rules improve.

Passage link
txt
raw_file
raw_sheet
raw_cell / raw_row
      ↓
normalization version N
      ↓
canonical record
Passage link

Without that layer, every parser improvement requires trusting the already-transformed data or asking someone to upload old workbooks again.

Passage link

Reproducibility starts before the model.

Passage link

The canonical model is the least glamorous and most valuable part

The spreadsheet may express the same idea differently across tabs or years.

Passage link

The analytical layer should not inherit every layout quirk.

Passage link

I prefer mapping source variations into stable concepts such as:

Passage link
ts
type ComplaintRecord = {
  id: string
  occurredAt: Date | null
  productCode?: string
  lot?: string
  productionLine?: string
  category?: string
  description: string
  confirmed: boolean
  source: SourceReference
}
Passage link

Once this layer exists, Power BI, rules and AI all consume the same vocabulary.

Passage link

That is what makes future changes cheaper.

Passage link

Color is data when the business decided color is data

Engineers often treat formatting as cosmetic noise.

Passage link

In operational spreadsheets, that assumption can destroy meaning.

Passage link

If red fill means "confirmed", yellow means "under investigation" and green means "closed", fill color is effectively an undocumented enum.

Passage link

The long-term goal should be to migrate meaning into explicit fields. But during ingestion, I still have to preserve what the source actually uses.

Passage link

A good data pipeline respects reality before improving it.

Passage link

AI works better after the structure is stable

Free-text complaints are a good fit for AI because people describe similar problems with different words.

Passage link

The model can help with:

Passage link
  • semantic grouping;
  • category suggestions;
  • entity extraction;
  • summarizing recurring descriptions;
  • linking similar cases for review.

But I do not let the model decide whether a complaint was confirmed if confirmation already exists as a business field.

Passage link

The AI enriches the canonical record. It does not overwrite authoritative facts.

Passage link

Hypothesis and fact need different types

One of the most important decisions is to stop putting everything in a single text answer.

Passage link

I want a result to distinguish:

Passage link
ts
type InvestigationFinding = {
  observation: string
  evidenceIds: string[]
  hypothesis?: string
  confidence?: number
  humanStatus: 'unreviewed' | 'accepted' | 'rejected' | 'edited'
}
Passage link

"Complaints increased after the sealer change" is a much stronger statement than "complaints increased in the same period as the sealer change".

Passage link

The first implies causality. The second describes temporal evidence.

Passage link

A useful system should preserve that distinction instead of letting fluent text erase it.

Passage link

Human correction is not a patch; it is part of the product

The domain specialist needs to be able to say things such as:

Passage link
  • this category is wrong;
  • line 3 does not use this machine;
  • these two descriptions are equivalent;
  • this hypothesis is not operationally possible;
  • this source row was interpreted incorrectly.

Those corrections should not disappear into a chat history.

Passage link

I store them as structured feedback tied to the record, rule or model output they modify.

Passage link

Then the next processing run can reuse known corrections instead of making the specialist teach the system the same fact again.

Passage link

I would not fine-tune as the first response

When an AI classification is wrong, fine-tuning is only one possible solution and usually not the first one I want.

Passage link

First I ask:

Passage link
  • is the source ambiguous?
  • is the canonical schema missing a field?
  • does a deterministic rule solve this better?
  • is retrieval missing relevant context?
  • is the prompt unclear?
  • is this actually a stable pattern worth learning?

Many enterprise AI errors are data and workflow errors wearing an AI costume.

Passage link

A local model still needs evaluation

Running inference on-premises reduces one class of data-exposure risk. It does not make the output correct.

Passage link

I still need a benchmark built from reviewed real cases.

Passage link

For each task—classification, grouping, extraction, hypothesis suggestion—I can compare model output with a specialist-approved reference set and track precision, recall or task-specific acceptance metrics.

Passage link

That makes model replacement a measurable engineering decision instead of a demo contest.

Passage link

"Data does not leave" has to include logs

This is one of the easiest boundaries to accidentally break.

Passage link

An application can run the model locally and still send:

Passage link
  • stack traces containing row values;
  • prompts to an external tracing platform;
  • screenshots to remote support tooling;
  • backups to an uncontrolled bucket;
  • analytics events containing identifiers.

So I treat observability and support as part of the security model.

Passage link

Redaction, local log retention and strict egress policies matter as much as the inference server.

Passage link

Power BI belongs at the end, not as the source of truth

Power BI is excellent for exploration, filtering and executive communication.

Passage link

I do not want the semantic corrections and AI state to live only inside a report.

Passage link

The pipeline should publish curated tables that Power BI consumes.

Passage link

That keeps transformations testable and makes another visualization layer possible later without recreating the domain logic.

Passage link

The on-premises gateway is a boundary decision, not a checkbox

Microsoft's on-premises data gateway can bridge local data sources with Power BI services.

Passage link

That is useful, but it matters to understand the boundary: using the gateway still involves communication with Microsoft's cloud services.

Passage link

If an organization's policy literally means no corporate data may leave the local environment, the architecture must validate whether that usage is allowed instead of assuming "gateway" means "fully local".

Passage link

Security requirements have to be translated into network and data-flow diagrams, not product names.

Passage link

An evidence table changes the quality of the dashboard

Instead of a chart ending in a number, I like being able to drill down to the records that produced it.

Passage link
txt
metric
  ↓
cluster/category
  ↓
individual cases
  ↓
source workbook / sheet / row
Passage link

That traceability makes executive analytics more credible and gives the specialist a way to challenge a conclusion.

Passage link

The dashboard becomes a view over evidence rather than a collection of untraceable AI summaries.

Passage link

The final product is not the AI; it is an investigation system

The real questions are not "what did the model say?".

Passage link

They are:

Passage link
  • what increased?
  • since when?
  • on which products?
  • which lots or lines?
  • was there a nearby operational event?
  • what hypothesis exists?
  • which evidence supports it?
  • what did the specialist correct?

AI matters because free text is difficult to group and interpret at scale.

Passage link

But the value appears when that ability is placed inside a chain of data engineering, rules, review and evidence.

Passage link

That is increasingly how I see Enterprise AI: less chatbot at the center and more verifiable intelligence layer between operational data and human decisions.

Passage link

References

Reference with source and version

Download BibTeX

Suggest a correction

https://lagrotti.dev/blog/local-enterprise-ai-excel-power-bi-evidence · EN

Your text stays in this form until you prepare and open the draft. You review and publish the issue on GitHub.

Which topic should go deeper?

Results are unavailable right now

Share this article

LinkedInWhatsAppXEmail

Need someone for a challenge like this one?

I work end to end: architecture, development and running in production. I'm open to remote roles and custom projects.