Skip to content
benzae1Public

About

yield analysis platform

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

YAP — Yield Analysis Platform

Explainable root-cause analysis for semiconductor yield loss.

An engineer uploads a wafer test dataset and a process manual. YAP ranks the most likely fault contributors, shows the statistical evidence behind each one, and answers natural-language RCA questions with a Bedrock-backed assistant grounded in both the fault evidence and the uploaded documentation.


The demo in one flow

  1. Log in with the pre-seeded demo account.
  2. Upload a yield CSV and a supporting manual PDF.
  3. Trigger analysis — the ML pipeline runs in the background.
  4. See ranked faults, each with a severity score.
  5. Click a fault to inspect its evidence (observed vs. baseline, z-score, yield correlation), affected wafers, and document citations.
  6. Ask an RCA question in plain language and get a grounded, cited answer.

Architecture

                 ┌──────────────┐        ┌─────────────────────────────┐
  Browser ─────▶ │  Frontend    │ /api ▶ │  Backend (FastAPI)          │
  (React SPA)    │  React+Vite  │        │  auth · files · analysis ·  │
                 │  nginx proxy │ ◀───── │  chat                       │
                 └──────────────┘        └──────────┬─────────┬────────┘
                                                     │         │
                                      run_analysis() │         │ retrieve / chat
                                                     ▼         ▼
                                           ┌──────────────┐  ┌──────────────────┐
                                           │  ML pipeline │  │  RAG + chatbot   │
                                           │  XGBoost ·   │  │  ChromaDB +      │
                                           │  SHAP ·      │  │  AWS Bedrock     │
                                           │  IsoForest   │  │  (Titan + Claude)│
                                           └──────────────┘  └──────────────────┘
                                                     │                 │
                                              SQLite (results)   Chroma vectors
Layer Stack
Frontend React, Vite, Tailwind, React Router, Recharts, Axios
Backend FastAPI, SQLAlchemy, SQLite, JWT auth
ML pandas, scikit-learn, XGBoost, SHAP, Isolation Forest
RAG / chat ChromaDB, AWS Bedrock — Titan Text Embeddings v2 + Claude Sonnet 4.6

Quick start (Docker — recommended)

# 1. Add AWS Bedrock credentials so embeddings and chat are live
cp backend/.env.example backend/.env   # then edit AWS_* values

# 2. Build and run
docker compose up --build
Service URL
Frontend http://localhost:3000
Backend API http://localhost:8000
API docs (Swagger) http://localhost:8000/docs
Status / health http://localhost:8000/api/status

Demo login (auto-created on first startup):

email:    demo@yap.dev
password: demo1234

On first boot the backend embeds the baseline document corpus into ChromaDB in the background — the API stays available the whole time. Track progress at /api/status; embeddings are cached in a Docker volume, so later restarts skip straight to ready.


Deploying live for a demo? See deploy/DEPLOY.md for a single-EC2 setup using this same Compose stack (no domain required).

Quick start (manual)

Backend

cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env   # add your AWS_* values
uvicorn app.main:app --reload

Frontend

cd frontend
npm install
npm run dev

Run the backend from the backend/ directory so it loads backend/.env. Note that OS-level AWS_* environment variables take precedence over the .env file.


AWS Bedrock

YAP uses Bedrock for real embeddings and chat:

  • Embeddings: amazon.titan-embed-text-v2:0
  • Chat: us.anthropic.claude-sonnet-4-6 (cross-region inference profile)

If credentials are missing or expired, the app degrades gracefully instead of crashing: embeddings fall back to zero vectors and chat returns a clearly-labelled placeholder. /api/status reports credentials_available and the live embedding state so you can confirm Bedrock is wired before the demo.


Project layout

backend/
  app/
    routers/      # auth, files, analysis, chat
    services/     # rag_service.py, chat_service.py (RAG/chatbot)
    ml/           # run_analysis() pipeline (ML team)
    models/       # SQLAlchemy tables
    schemas/      # request/response shapes
  scripts/        # smoke tests + demo helpers
  rag_seed/       # baseline document corpus seeded into ChromaDB
frontend/
  src/
    pages/        # Login, Upload, Dashboard
    components/   # FaultList, EvidencePanel, WaferHeatmap, ChatPanel, ...
    api/          # backend HTTP calls
    hooks/        # useAuth, useAnalysis (polling)
docs/             # team guides, plan, and onboarding

Verify it works (smoke tests)

cd backend
python scripts/ml_smoke.py     # ML pipeline returns ranked faults
python scripts/rag_smoke.py    # ingest → retrieve → chat
python scripts/rca_api_smoke.py  # full API happy path end to end

The shared fault contract

The ML pipeline's run_analysis(file_path) is the single entrypoint the backend calls, and every fault follows this shape (do not change it without backend, ML, and frontend agreeing):

{
  "fault_id": "ml-temperature_c",
  "name": "temperature_c process excursion",
  "severity_score": 82,
  "affected_wafer_ids": ["12", "45"],
  "evidence": {
    "metric": "temperature_c",
    "column_mean": 450.0,
    "column_std": 14.9,
    "observed_value": 462.5,
    "z_score": 3.93,
    "yield_correlation": -0.64
  },
  "rag_citations": [{ "text": "...", "source_file": "manual.pdf", "page": 11, "relevance_score": 0.82 }]
}

Team docs


Ground rules

  • JWT lives in memory in the frontend — never localStorage.
  • run_analysis() in backend/app/ml/pipeline.py is the only ML entrypoint the backend imports.
  • Routers stay thin; business logic lives in services or the ML pipeline.
  • The FaultResult JSON shape is a shared contract across all teams.

About

yield analysis platform

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages