LLM agents & retrieval · Manufacturing client

On-Premise Manufacturing Quality Assistant

Quality engineers hold two bodies of knowledge that should talk to each other but do not: PFMEA documents describing what could fail and how it is controlled, and 8D reports describing what actually failed. Reconciling them means reading scattered XML, Excel and PDF files by hand. This system makes that corpus searchable, and automatically judges whether a failure mode from an 8D report is already covered by the PFMEA.

The problem

An 8D report lands describing a failure in the field. The question is immediate and unglamorous: did our PFMEA anticipate this? If yes, the control failed and the control needs revisiting. If no, the analysis has a gap.

Answering it manually means cross-checking a failure description against hundreds of PFMEA rows spread across file formats and sites — hours per report, and the quality of the answer depends on who is looking.

What I built

Retrieval engine

  • Hybrid search combining BM25 lexical matching with dense BGE-M3 embeddings, fused by reciprocal rank fusion and refined by a cross-encoder reranker. Quality documents are full of part numbers and process codes, where pure semantic search quietly fails.
  • An indexer that parses the client's XML and Excel quality formats into a consistent record model, with a header-extraction agent for the inconsistent metadata blocks at the top of real-world documents.
  • A DuckDB query engine over the structured side of the corpus, so questions that are really aggregations get answered by SQL instead of by a language model guessing.

Agent layer

  • A tool-calling agent loop with a supervisor and an evaluator stage, so answers are checked before they reach the engineer rather than streamed out unconditionally.
  • The 8D ↔ PFMEA cross-reference: given a failure report, retrieve candidate PFMEA rows and judge coverage explicitly, with the supporting rows cited.
  • A row recommender that suggests PFMEA entries when drafting a new analysis, grounded in what the company has already documented.
  • Server-sent-event streaming throughout, so long answers appear as they are produced.

Frontend and deployment

  • React / TypeScript interface: search, chat, cross-reference, document browser, draft editor, XML and Excel viewers, index diagnostics and settings.
  • Trilingual UI (English, Italian, German) via i18next, matching the client's site distribution.
  • Docker Compose deployment behind Traefik, Alembic migrations and CI workflows — all on customer hardware, with Ollama serving open-weight models locally.

Outcome

About 2,090 quality records are indexed and queryable in natural language, with coverage judgements produced automatically instead of by manual cross-checking.

The architectural constraint that shaped everything: confidential customer quality data cannot leave the network. Local model serving and on-premise deployment were not a preference here — they were the condition for the project existing.

Estimate, not a logged metric: hours of document cross-checking per 8D report reduced to a single automated job.

Stack

Note: this case study is deliberately written without client names, product names or customer data. Record counts and commit shares come from the repository; the time saving is an engineering estimate.