Knowledge architecture

RAG, Knowledge Graph or Both? Choosing an AI Knowledge Layer for Manufacturing

Two different jobs

Teams often compare retrieval-augmented generation (RAG) and knowledge graphs as if they were competing products. In practice they solve different problems.

  • Retrieval finds relevant passages in unstructured text and gives them to a language model as context. It is strong when the answer is written down somewhere: an SOP, a manual, an earlier investigation.
  • A knowledge graph (or any explicit object model) represents things and how they relate: this lot was consumed by this batch on this line during this window, and this rule applies to that combination. It is strong when the answer depends on the current state of production.

Where retrieval alone struggles in a plant

Consider the question "Can batch 2417 be released?" A retrieval-only assistant will find release procedures and maybe similar past cases. What it cannot reliably do is:

  • identify which material lots, tests and deviations belong to batch 2417;
  • apply the correct site-specific rule version;
  • notice that one required test result is missing rather than negative;
  • explain which record each part of the answer came from.

These are relationship and state questions. Text similarity is the wrong tool for them, and a fluent answer can hide the gap.

Where a graph alone struggles

A graph without retrieval is precise but narrow. It knows that a deviation is linked to a piece of equipment; it does not know what the maintenance technician wrote in the free-text field, or what the supplier's certificate says. Operators also ask "how do I…" questions that are answered by documents, not by data.

A combined pattern that works

Question type Primary layer Supporting layer
What does the procedure say? Retrieval over SOPs and manuals Graph to pick the right document version for this line
What is the state of this batch? Graph and live system views Retrieval for related notes
Which rule applies here? Versioned rules linked to objects Retrieval for the rule's rationale
Have we seen this before? Graph to find comparable cases Retrieval over investigation reports

The model's role is to interpret the question, call the right layer, and write an answer that cites both structured facts and retrieved passages. When the graph says a fact is missing, the answer must say so.

How to build the structured layer without a big-bang ontology

  1. Start from one workflow. List the objects it touches and the identifiers the existing systems use for them.
  2. Map identifiers across systems. The same "batch" may have different keys in MES, LIMS and ERP. Reconciling these is often the most valuable step.
  3. Model time explicitly. Most production questions depend on windows: when the lot was consumed, when the test was valid.
  4. Encode rules separately and test them. Use rule tables, constraint languages such as SHACL, or code with unit tests, and version every change.
  5. Keep evaluation cases. Store questions with known answers, including cases with missing data, and rerun them when the model, rules or data change.

Signs you are on the right track

  • An answer lists the records and rule versions it used.
  • Removing a source makes the assistant ask for review instead of improvising.
  • Swapping the language model does not require rebuilding the knowledge layer.
  • Domain experts can read and correct the rules without reading prompts.

Where to start

If your team already has a document assistant, the next step is usually to add a small object model for one high-value decision and route state questions through it. If you have neither, start with discovery on one workflow. Our industrial walkthrough shows how a source decision is preserved as a versioned asset and what happens when it is retired.

Questions & answers

Is RAG enough for a manufacturing assistant?

For document questions such as 'what does the SOP say about this step', often yes. For questions that depend on live production objects, time windows and rules, retrieval alone tends to return plausible text that does not match the actual batch or equipment.

Do we need a full enterprise ontology first?

No. Start with the handful of objects and relationships one workflow needs, for example batch, material lot, operation, equipment, test result and status. Extend the model as new workflows are added.

Where do the rules live?

In versioned, testable structures such as rule tables, SHACL shapes or code with tests, linked to the objects they apply to. Not in prompts.

Can we change the language model later?

Yes, if the graph, rules and evaluation cases are kept independent of the model. That separation is the main reason to build the structured layer at all.

LET’S START A CONVERSATION

Let’s start with your workflow.

Tell us what you want to improve and which systems you use. We will reply within one business day with questions, a view on fit and a practical next step.

Discuss a project