Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

MCP server for manufacturing defect investigation using knowledge graphs and graph analytics. Enables LLM agents to retrieve context, find similar cases, and generate investigation reports from manufacturing data.

README.md

Explainable Manufacturing Defect Investigation Using Knowledge Graphs, Neo4j GDS, MCP, and Agentic AI

A manufacturing investigation platform that combines Computer Vision outputs, Knowledge Graphs, Graph Data Science (GDS), Model Context Protocol (MCP), and Local LLM Agents to support defect analysis and engineering investigations.

The system extends traditional defect detection by providing contextual information, graph analytics, graph-based machine learning, and natural language access to manufacturing knowledge.

---

Overview

Traditional defect detection systems answer:

Is the product defective?

Quality engineers typically require additional context:

  • Which machine produced it?
  • Which supplier provided the materials?
  • Have similar defects occurred before?
  • Are there recurring defect patterns?
  • What actions should be investigated?

This project combines manufacturing telemetry, traceability data, graph analytics, and LLM reasoning to generate explainable investigation reports.

---

System Architecture

AI4I Telemetry Dataset
            +
MVTec Transistor Dataset
            +
Synthetic Traceability Data
            ↓
Data Integration Pipeline
            ↓
Manufacturing Dataset
            ↓
Neo4j Knowledge Graph
            ↓
Neo4j Graph Data Science
            ↓
FastAPI + MCP Server
            ↓
LLM Investigation Agent
            ↓
Investigation Report

---

Core Components

Knowledge Graph

Manufacturing entities are represented as graph nodes.

Node Types

  • ProductCase
  • Machine
  • Supplier
  • Batch
  • MaterialLot
  • Operator
  • Shift
  • ProductionLine
  • Defect
  • FailureType
  • Document

Relationships

(ProductCase)-[:PRODUCED_BY]->(Machine)
(ProductCase)-[:SUPPLIED_BY]->(Supplier)
(ProductCase)-[:BELONGS_TO_BATCH]->(Batch)
(ProductCase)-[:HAS_DEFECT]->(Defect)
(ProductCase)-[:EXHIBITS_FAILURE]->(FailureType)
(ProductCase)-[:WORKED_IN_SHIFT]->(Shift)
(ProductCase)-[:MENTIONED_IN]->(Document)

---

Graph Analytics

Implemented using Neo4j Graph Data Science.

PageRank Centrality

Identifies machines that are most influential within the manufacturing network.

Endpoint:

GET /analytics/centrality

Example Insight:

Machine M5 exhibits the highest centrality score.

---

Louvain Community Detection

Groups machines and suppliers with similar manufacturing behavior.

Endpoint:

GET /analytics/communities

Example Insight:

Machines and suppliers within the same community
share similar defect patterns.

---

Graph Machine Learning

Node Classification

Uses Neo4j GDS Node Classification Pipeline.

Workflow:

ProductCase Nodes
        ↓
FastRP Embeddings
        ↓
Logistic Regression
        ↓
Defect Classification

Training Endpoint:

POST /ml/train

Prediction Endpoint:

GET /ml/predict/{uid}

---

FastRP Embeddings

Generates graph embeddings for ProductCase nodes.

Endpoint:

POST /ml/embeddings

Embedding Size:

64 dimensions

Stored as:

pc.embedding

---

Similar Case Retrieval

Uses cosine similarity between FastRP embeddings.

Example:

MATCH (target:ProductCase)
MATCH (other:ProductCase)

WITH target, other,
gds.similarity.cosine(
    target.embedding,
    other.embedding
) AS similarity

Endpoint:

GET /ml/similar/{uid}

Purpose:

  • Historical defect comparison
  • Similar case retrieval
  • Context-aware investigations

---

Text-to-Cypher

Natural language queries are converted into Cypher using a local LLM.

Example:

Which machines have the highest defect rates?

Generated Query:

MATCH ...
RETURN ...

Endpoint:

POST /text-to-cypher

---

Graph Builder

Documents can be ingested into the Knowledge Graph.

Supported Examples:

  • Maintenance logs
  • SOP documents
  • Engineering reports

Endpoint:

POST /ingest-document

Generated Knowledge:

Machine
    ↓
MENTIONED_IN
    ↓
Document

---

MCP Investigation Agent

The MCP server exposes graph operations as tools.

Examples:

  • get_case_context
  • find_similar_cases
  • calculate_machine_centrality
  • detect_defect_communities
  • text_to_cypher

The LLM agent invokes these tools to collect evidence and generate investigation reports.

---

Example Investigation Workflow

UID000001
      ↓
Retrieve Context
      ↓
Find Similar Cases
      ↓
Analyze Graph Patterns
      ↓
Collect Evidence
      ↓
Generate Investigation Report

Example Report Sections:

  • Case Summary
  • Evidence
  • Hypothesis
  • Recommendations

---

REST API

Data

POST /sync

---

Investigation

POST /investigate/{uid}

---

Graph Analytics

GET /analytics/centrality

GET /analytics/communities

---

Graph Machine Learning

POST /ml/train

POST /ml/embeddings

GET /ml/predict/{uid}

GET /ml/similar/{uid}

---

Knowledge Graph Querying

POST /text-to-cypher

---

Graph Builder

POST /ingest-document

---

Technology Stack

  • FastAPI
  • Neo4j
  • Neo4j Graph Data Science
  • MCP
  • Ollama
  • Qwen 2.5
  • Python
  • Docker
  • PatchCore
  • OpenCV

---

Project Goal

This project demonstrates how Knowledge Graphs, Graph Analytics, Graph Machine Learning, MCP, and LLM Agents can be combined to transform manufacturing defect detection into explainable manufacturing investigations.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.