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.
- Log in with the pre-seeded demo account.
- Upload a yield CSV and a supporting manual PDF.
- Trigger analysis — the ML pipeline runs in the background.
- See ranked faults, each with a severity score.
- Click a fault to inspect its evidence (observed vs. baseline, z-score, yield correlation), affected wafers, and document citations.
- Ask an RCA question in plain language and get a grounded, cited answer.
┌──────────────┐ ┌─────────────────────────────┐
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 |
# 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).
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 --reloadFrontend
cd frontend
npm install
npm run devRun the backend from the
backend/directory so it loadsbackend/.env. Note that OS-levelAWS_*environment variables take precedence over the.envfile.
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.
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
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 endThe 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 }]
}- Two-day hackathon plan
- Project onboarding
- Repository structure & branch guide
- Backend team guide
- ML team guide
- RAG & chatbot team guide
- Frontend team guide
- Frontend style guide
- JWT lives in memory in the frontend — never
localStorage. run_analysis()inbackend/app/ml/pipeline.pyis the only ML entrypoint the backend imports.- Routers stay thin; business logic lives in services or the ML pipeline.
- The
FaultResultJSON shape is a shared contract across all teams.