A newer version of the Streamlit SDK is available: 1.59.0
title: FabAgent
emoji: ๐ฆ
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.36.0
app_file: app.py
pinned: false
license: mit
short_description: ๋ฐ๋์ฒด ๊ณต์ ์ด์์ ํ์งยท์์ธยท์ํฅยท๋์์ ์๋ ๋ฉํฐ ์์ด์ ํธ ์ด์ ํ๋ซํผ
FabAgent
๋ฐ๋์ฒด ๊ณต์ ์ด์์ ํ์ง โ ์์ธ ๋ถ์ โ ์ํฅ ํ๊ฐ โ ๋์ ๊ถ๊ณ ๋ฅผ ํ๋์ ๋ฉํฐ ์์ด์ ํธ ํ์ดํ๋ผ์ธ์ผ๋ก ํตํฉํ๋ ์ด์ ํ๋ซํผ์ ๋๋ค.
๊ฐ Tier๊ฐ ์์จ ๋๊ตฌ ํธ์ถ(tool calling) ๊ณผ ์กฐ๊ฑด๋ถ ๋ผ์ฐํ ์ ํตํด ์์ฌ๊ฒฐ์ ์ ์งํํ๋ ์ง์ง LLM agent๋ก ๊ตฌ์ฑ๋์ด, ๋จ์ผ LLM ์ฑ๋ด๊ณผ ๋ฌ๋ฆฌ ์ถ์ ๊ฐ๋ฅํ๊ณ ๋ชจ๋ํ๋ ์์ฌ๊ฒฐ์ ํ๋ฆ๊ณผ auditableํ reasoning trace๋ฅผ ์ ๊ณตํฉ๋๋ค.
ํต์ฌ ํน์ง
- 4-Tier multi-agent system - ํ์ง(ML) ยท ์์ธ(agentic RAG) ยท ์ํฅ(tool-using) ยท ๋์(tool-using)
- Plan-and-Execute ํจํด (๊ธฐ๋ณธ) - Central Planner Agent๊ฐ ์ ์ฒด ์ํฌํ๋ก์ฐ plan์ 1ํ ์ฐ์ถ, Tier executor๊ฐ plan๋๋ก ์คํ โ ํต์ ์ค๋ฒํค๋ ์ต์ํ (LLM ํธ์ถ -60%, latency -54%)
- Tool-using agent (์ต์
) - 7๊ฐ ๋๋ฉ์ธ ๋๊ตฌ๋ฅผ LLM์ด ์์จ ์ ํยท๋ฐ๋ณต ํธ์ถ (
AGENT_MODE=autonomous) - Supervisor agent (autonomous ๋ชจ๋) - LLM์ด Tier 2 ๊ฒฐ๊ณผ๋ฅผ ๋ณด๊ณ ํ์ workflow path(proceed_full / fast_track / escalate) ๋์ ๊ฒฐ์
- ์กฐ๊ฑด๋ถ ๋ผ์ฐํ - LangGraph์์ severity gate + cause confidence retry + supervisor ๋ถ๊ธฐ (3๋จ๊ณ)
- CRAG self-correction - retrieval grader๊ฐ ๊ฒ์ ํ์ง ํ๊ฐ, ์๊ณ์น ๋ฏธ๋ฌ ์ ์ฟผ๋ฆฌ ์๋ ์ฌ์์ฑ
- LangSmith observability - ๋ชจ๋ LLMยทtoolยทagent ํธ์ถ ์๋ ํธ๋ ์ด์ค (production-grade)
- Production RAG - BM25 + FAISS + Reciprocal Rank Fusion (5๋จ๊ณ paradigm ablation์ผ๋ก ๊ฒ์ฆ)
- ์ค๋ฐ์ดํฐ ๊ธฐ๋ฐ - UCI SECOM (590 ์ต๋ช ์ผ์) + PHM 2016 CMP (25๊ฐ ๋ช ๋ช ์ผ์, ์ค์ธก)
- ์๊ฐ ํ์ต ๋ฃจํ - ์ด์์ ์น์ธ ์ ๋ถ์ ๊ฒฐ๊ณผ๊ฐ ์ธ์๋ํธ DB(.md)์ ์๋ ๊ธฐ๋ก โ ๋ค์ RAG์ ์ฆ์ ๋ฐ์
- ์ ๋ ๊ทผ๊ฑฐ - ํต์ฌ ์์ฌ๊ฒฐ์ ๋ง๋ค ablation/๋ฒค์น๋งํฌ/์ฐจํธ (
experiments/*/results.md)
์ํคํ ์ฒ
4-Tier Multi-Agent Pipeline
โโโโโโโโโโโโโโโโ
โ ์๋ ์ธ๋ฐ์ค โ ์ฌ์ด๋๋ฐ์์ ์๋ ์ ํ
โโโโโโโโฌโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ agents/orchestrator.py - LangGraph StateGraph (์กฐ๊ฑด๋ถ + LLM-driven ๋ผ์ฐํ
) โ
โ โ
โ START โ [detect] โโโโ score < 0.30 โโโ [noise] โ END (severity gate) โ
โ โ โ
โ โโโ score โฅ 0.30 โโโ [cause] โ
โ โ โ
โ โโโโโ max pct < 40% โโโโโโ [cause_retry] โโโ โ
โ โ (output threshold) โ โ
โ โโโโโ max pct โฅ 40% โโโ [supervisor] โโโโโโโ โ
โ โ โ
โ โโโโ LLM ๊ฒฐ์ โโโโโโโโโค โ
โ โ proceed_full โ โ
โ โ escalate โผ โ
โ โ [impact] โโโ โ
โ โ โผ โ
โ โ fast_track โโโ [fast_impact] โ [response] โ END โ
โ โ โฒ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Tier 1: IsolationForest (ML) - SECOM/PHM ๋ฐ์ดํฐ ๋ถ๊ธฐ โ
โ Tier 2: agentic RAG (tools: search_knowledge, lookup_incident, get_pm) โ
โ Supervisor (gpt-4o-mini): actionยทseverityยทreasoning์ LLM์ด ๊ฒฐ์ โ
โ Tier 3: tool-using (query_wip, get_downstream, get_yield_baseline, pm) โ
โ fast_impact: LLM ํธ์ถ ์๋ deterministic ๊ฒฝ๋ ์ฒ๋ฆฌ (fast_track ์ ์ฉ) โ
โ Tier 4: tool-using (search, lookup_incident, get_pm, check_pm_schedule) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TierData (๋จ์ผ ๊ณ์ฝ) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Streamlit UI (cascade) โ
โ Tier 4 ์น์ธ โ ์์
์ง์ โ
โ + ์๊ฐ ํ์ต ๋ฃจํ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
7๊ฐ Agent Tools
| ๋๊ตฌ | ๋ฐํ | ์ฌ์ฉ Tier |
|---|---|---|
search_knowledge |
INC/FMEA/SOP/FLOW ๋ฌธ์ hybrid ๊ฒ์ ๊ฒฐ๊ณผ | 2, 4 |
lookup_incident_history |
๊ณผ๊ฑฐ incident ๊ตฌ์กฐํ ๋ ์ฝ๋ (์์ธยทํด๊ฒฐ์ฑ ยทyield ํ๋ณต๋ฅ ) | 2, 4 |
get_pm_history |
์ฅ๋น ๋ง์ง๋ง PM ์ผ์ยท๊ฒฝ๊ณผ์ผยทoverdue ์ฌ๋ถ | 2, 3, 4 |
check_pm_schedule |
๋ค์ 7์ผ ๊ฐ์ฉ PM ์๋์ฐ | 4 |
query_wip_status |
์ํฅ ๋ฐ๋ WIP lot/wafer ์ | 3 |
get_downstream_steps |
ํ๊ณต์ ์์กด์ฑ (typical deltaยทseverity) | 3 |
get_yield_baseline |
๊ณต์ ์ต๊ทผ 30์ผ yield ๊ธฐ์ค์ (%) | 3 |
LLM์ด ์ด๋ค ๋๊ตฌ๋ฅผ ์ธ์ ํธ์ถํ ์ง ์์จ ๊ฒฐ์ ํฉ๋๋ค. ํธ์ถ ๋ก๊ทธ๊ฐ reasoning trace = production audit trail.
๋ฐ์ดํฐ & ๋ชจ๋ธ
| ์๋ | ๊ณต์ step | ๋ฐ์ดํฐ | ๋ชจ๋ธ / ๊ธฐ์ |
|---|---|---|---|
| A1 | Photo (๋ ธ๊ด) | UCI SECOM (590 ์ต๋ช ์ผ์) | IsolationForest + gpt-5-mini agent + Hybrid RAG |
| A2 | Etch (์๊ฐ) | UCI SECOM (๋ค๋ฅธ fail row) | IsolationForest + gpt-5-mini agent + Hybrid RAG |
| A3 | CMP (์ฐ๋ง) | PHM 2016 CMP (25๊ฐ ๋ช ๋ช ์ผ์, SLURRY_FLOW ๋ฑ) | IsolationForest + gpt-5-mini agent + Hybrid RAG |
SECOM์ ์ต๋ช ์ฒ๋ฆฌ๋ ํ์ค ๋ฒค์น๋งํฌ๋ผ ๊ณต์ step ๋ผ๋ฒจ์ด narrative์ ๋๋ค (ํ๊ณ ๋ช ์). PHM 2016 CMP๋ ์ค์ CMP ๊ณต์ ์ผ์ ๋ฐ์ดํฐ๋ก step-specific ์ถ๋ก ์ด ๊ฐ๋ฅํฉ๋๋ค.
์ ๋ ํ๊ฐ ์์ฝ
ํต์ฌ ์์ฌ๊ฒฐ์ ๋ง๋ค ablation ์คํ์ ์ํํ๊ณ ๊ฒฐ๊ณผยท์ฐจํธยท์ํ์ฐฉ์ค๋ฅผ ๊ธฐ๋กํ์ต๋๋ค. ์์ธ๋ experiments/README.md.
| ID | ์คํ | ๊ฒฐ์ | ํต์ฌ ์์น |
|---|---|---|---|
| D1 | Tier 1 ๋ชจ๋ธ ๋น๊ต | IsolationForest | PR-AUC 0.129 (LOF 0.089, OC-SVM 0.098, baseline 0.119) |
| D2 | Retrieval ๋ฐฑ์๋ latency | 4 backend ๊ฒ์ฆ | keyword 0.5ms / faiss 60ms / hybrid 54ms / +rerank 326ms |
| D5 | Multi vs Single LLM | Multi-Agent | ๋น์ฉ $0.018 vs $0.008 (2.2x), ๊ถ๊ณ ๊น์ด 1.6~1.9๋ฐฐ, ๋ชจ๋ํ ๊ฒฐ์ ์ |
| D6 | RAG paradigm 5๋จ๊ณ ablation | Hybrid ์ฑํ | faithfulness: No RAG 0.32 โ Hybrid 0.82 (2.5x). Hybrid๊ฐ ๋ชจ๋ ์งํ 1์ |
| D7 | Workflow vs Agentic ๋น๊ต | Agentic ์ฑํ | tool 0โ13, ์ธ์ฉ ๊น์ด +25%, ๋น์ฉ 2.6x, latency 2.3x, reasoning trace ํ๋ณด |
| D8 | CRAG (Self-correction) ON vs OFF | CRAG ํ์ฑ ์ ์ง (๊ด์ธก ๊ฐ์น) | ํ์ง ๋ณํ -0.1%p (๋๊ธ), refinement ๋ฐ๋๋ฅ 20%, relevance_score ๋ ธ์ถ, ๋น์ฉ +31% |
| D9 | ํ๊ตญ์ด reranker (Dongjin-kr/ko-reranker) vs ์์ด(BAAI) vs hybrid (12 docs) | ๋ ๋ค hybrid์ ๋ฏธ๋ฌ | hybrid 0.734 / BAAI 0.714 / ko 0.703 |
| D10 | D9 ํ์: ์ฝํผ์ค 12โ34 ํ์ฅ ํ reranker ์ฌํ๊ฐ | ๊ฐ์ค ๊ฒ์ฆ - ํจ๊ณผ ์์ ๋ฐ์ | hybrid 0.592 / BAAI 0.709 (+0.117) / ko 0.675 (+0.083) |
| D11 | Conductor (Plan-and-Execute) vs Autonomous (tool-using loop) | Conductor ์ฑํ | LLM -60%, Latency 131โ60์ด (-54%), ๋น์ฉ -58%, ์ธ์ฉ ๋๋ฑ(6.0) |
D6 ํต์ฌ ๊ทธ๋ํ
D7 ํต์ฌ ๊ทธ๋ํ
D8 ํต์ฌ ๊ทธ๋ํ
D10 ํต์ฌ ๊ทธ๋ํ (ํ์ฅ ์ฝํผ์ค์์ reranker ํจ๊ณผ ๋ฐ์ ๊ฒ์ฆ)
D11 ํต์ฌ ๊ทธ๋ํ (Conductor vs Autonomous)
์ํ์ฐฉ์ค
์ด ์์คํ ์ด ์ฒ์๋ถํฐ ์ด ๋ชจ์์ด์๋ ๊ฑด ์๋๋๋ค. ์ค์ ๋ก ๋ค์ ๋ค์ฏ ๋ฒ์ ํฐ ๋ฐฉํฅ ์ ํ์ ๊ฑฐ์ณค์ต๋๋ค.
1. ๋๋ฏธ ๋ฐ์ดํฐ โ ์ค๋ฐ์ดํฐ (M1~M3)
- ์์:
data/demo.TIER_DATA์ ํ๋์ฝ๋ฉ๋ Tier 1~4 ๊ฒฐ๊ณผ๋ก UI๋ง ์์ฐ - ๋ฌธ์ : ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ ์ด ์๋๋ผ "์๋๋ฆฌ์ค ์์"์ ๊ฐ๊น์. ์ธํฐ๋ทฐ ๋ถ์ ํฉ
- ํด๊ฒฐ: SECOM(A1ยทA2) + PHM 2016 CMP(A3) ์ค๋ฐ์ดํฐ ๋ก๋ ๊ตฌ์ถ, Tier 1์ IsolationForest๋ก ์ค์ ์ถ๋ก
2. ํค์๋ RAG โ Hybrid โ +Rerank โ ๋ค์ Hybrid (D2, D6)
- ์์: ์ฝํผ์ค๊ฐ ์์์(~10๋ฌธ์) ๋จ์ ํค์๋ ๋งค์นญ์ผ๋ก ์ถฉ๋ถ
- ์ถ๊ฐ: BM25(sparse) + FAISS(dense) + Reciprocal Rank Fusion ๊ฒฐํฉ. Anthropic Contextual Retrieval ํจํด ์ ์ฉ
- ์์ฌ: Cross-encoder rerank(
BAAI/bge-reranker-base)๊น์ง ์ถ๊ฐ, "production ์ ๋ฐ" ์ดํ ์๋ - ๋ฐ์ : 5๋จ๊ณ paradigm ablation (D6) ๊ฒฐ๊ณผ
Hybrid + Rerank๊ฐHybrid๋ณด๋ค ์คํ๋ ค ๋ชปํจHybridfaithfulness 0.821, answer_relevancy 0.394Hybrid + Rerankfaithfulness 0.819, answer_relevancy 0.167 (๋ํญ ํผ)
- ์์ธ ๋ถ์: โ ์ฝํผ์ค๊ฐ ~10๋ฌธ์๋ก ์์ Hybrid top-3์ด ์ด๋ฏธ ์ ๋ต์ ๊ทผ์ โก
bge-reranker-base๊ฐ ์์ด ํ์ต ๋ชจ๋ธ์ด๋ผ ํ๊ตญ์ด ๋๋ฉ์ธ ํ ์คํธ์์ ์ ์ ์ ํธ๊ฐ ์ก์ - ๊ตํ: production ํจํด์ ๋ธ๋ผ์ธ๋ ์ ์ฉํ๋ฉด ์ญํจ๊ณผ. ์ ๋ ํ๊ฐ(RAGAS) ์์ด 'rerank๊ฐ ์ข๋ค'๋ ํต๋ ์ ๊ทธ๋๋ก ๋๊ณ ๊ฐ ๋ปํจ
- ๊ฒฐ์ : ๊ธฐ๋ณธ backend๋ฅผ
hybrid_rerankโhybrid๋ก ๋ณ๊ฒฝ.Hybrid + Rerank๋ ํ๊ฒฝ๋ณ์ ์ต์ ์ผ๋ก ์ ์ง (์ฝํผ์ค 100+ ํ์ฅ ์ ์ฌํ๊ฐ ๊ถ์ฅ)
3. "์ด๊ฒ ์ง์ง agent์ธ๊ฐ?" ์๊ธฐ ๊ฒ์ฆ (M5)
- ์ํฉ: 4-Tier๊ฐ LLM ํธ์ถํ๋ multi-agent๋ผ๊ณ ์ฃผ์ฅํ๊ณ ์์์
- ๋์ ํ ์ ๊ฒ: Anthropic์ "Building Effective Agents" ์ ์ ๊ธฐ์ค์ผ๋ก ๋ณด๋ฉด ํ์ฌ๋ workflow (๊ฐ Tier๊ฐ ์ฌ์ ์ ์๋ RAG ํ ๋ฒ + LLM ํ ๋ฒ)
- agent์ ์ ์: LLM์ด ๋๊ตฌ๋ฅผ ์์จ ์ ํยท๋ฐ๋ณต ํธ์ถ, ์กฐ๊ฑด๋ถ ๋ถ๊ธฐ, reasoning loop
- ๊ฐญ: ๋๊ตฌ ํธ์ถ ์์ / ๋ฃจํ ์์ / ์กฐ๊ฑด๋ถ ๋ผ์ฐํ ์์
4. Workflow โ Agentic ์ ํ (ํ์ฌ)
- ๊ตฌํ: 7๊ฐ ๋๋ฉ์ธ ๋๊ตฌ ์ ์ (
agents/tools/), Tier 2/3/4๋ฅผ tool-calling loop + synthesis ํธ์ถ ํจํด์ผ๋ก ์ฌ์์ฑ - conditional routing: LangGraph์ severity gate (Tier 1 score < 0.3 โ noise) + cause confidence retry (max pct < 40 โ ํ ๋ฒ ์ฌ์๋) ๋ถ๊ธฐ ์ถ๊ฐ
- ์ ๋ ๊ฒ์ฆ (D7): workflow vs agentic 3 ์๋ ๋น๊ต
- LLM ํธ์ถ: 3 โ 9 (x3.0)
- Tool ํธ์ถ: 0 โ 13 (agentic์ reasoning trace)
- ์ ๋ํฌ ์ธ์ฉ: 4 โ 5 (+25%, ์์งํ ์ ๋นํ ์์ค)
- ๋น์ฉ: $0.012 โ $0.030 / ์๋ (x2.6)
- Latency: 83s โ 194s (x2.3)
- ์์งํ trade-off: ๋น์ฉ 2.6๋ฐฐ๊ฐ ์ ๋นํ๋๋ ์ด์ ๋ ์ธ์ฉ +25%๊ฐ ์๋๋ผ tool ํธ์ถ ๋ก๊ทธ ์์ฒด๊ฐ production audit trail. fab ํ๊ฒฝ์์ "์ด ๊ถ๊ณ ๊ฐ ์ ๋์๋๊ฐ"์ ๊ฐ์ฌ ์ถ์ ์ด ๊ฒฐ์ ์
5. LangGraph ๋์ (M4)
- ์ด์ : orchestrator๊ฐ ๊ฒฐ์ ๋ก ์ ํจ์ ํธ์ถ ์ํ์ค
- ํ์ฌ: LangGraph StateGraph +
lru_cache๋ก ์ปดํ์ผ๋ ๊ทธ๋ํ - ์ด๋: โ mermaid ๋ค์ด์ด๊ทธ๋จ ์๋ ์ถ์ถ โ ๋ถ๊ธฐ ์๊ฐํ โก ํฅํ ๋์ ๋ผ์ฐํ ยท์ฌ์๋ยท์ธํฐ๋ฝํธ ํ์ฅ ์ ๋์ผ ๊ตฌ์กฐ ์์์ ์ ์ง ๊ฐ๋ฅ
6. CRAG (Self-correction) ๋์ - ๋ ๋ฒ์งธ "์ ๋์ผ๋ก ํต๋ ๋ฐ๋ฐ" ์ฌ๋ก (D8)
- ์์: AnthropicยทLangChain์ด ์์ฃผ ์ธ๊ธํ๋ CRAG (Corrective RAG) ํจํด ๋์ . retrieval grader๊ฐ ๊ฒ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฒด ํ๊ฐํ๊ณ , ์๊ณ์น ๋ฏธ๋ฌ ์ ์ฟผ๋ฆฌ๋ฅผ ์ฌ์์ฑํด ์ฌ๊ฒ์
- ๊ตฌํ:
agents/rag/crag.py- gpt-4o-mini ๊ธฐ๋ฐ grader/refiner,search_knowledge๋๊ตฌ์ transparent ํตํฉ (ํ๊ฒฝ๋ณ์CRAG_ENABLEDํ ๊ธ) - smoke test ๊ฒฐ๊ณผ ์ธ์์ : gibberish ์ฟผ๋ฆฌ(
์์์์ xyzzy foobar)์ ๋ํด grader๊ฐ avg score 0.0 ๋ถ์ฌ โ LLM์ดCMP ๊ณต์ ์คํจ ๋ชจ๋ ๋ถ์ ๋ฐ ์ฌ๋ฌ๋ฆฌ ๊ด๋ฆฌ ์ ์ฐจ ๊ด๋ จ ์ ๋ณด๋ก ์๋ ์ฌ์์ฑ โ avg score 0.68 ํ๋ณต. ์ง์ง ์๊ฐ ์ ์ ๋ฉ์ปค๋์ฆ ์๋ - ๋ฐ์ : 3 ์๋ ์ ๋ ๋น๊ต(D8)์์ ํ์ง ์ฐจ์ด ์ฌ์ค์ ์์ (faithfulness -0.1%p, relevancy -3.3%p)
- ์์ธ ๋ถ์:
- ์ฝํผ์ค๊ฐ ~10๋ฌธ์๋ก ์์ hybrid ๊ฒ์์ด ์ด๋ฏธ ์ ์๋
- agentic loop ์์ฒด๊ฐ ์ด๋ฏธ self-correction ์ผ๋ถ ์ํ (LLM์ด ์ฒซ ๊ฒ์ ๊ฒฐ๊ณผ๊ฐ ๋ถ์กฑํ๋ฉด ๋ค๋ฅธ ์ฟผ๋ฆฌ๋ก ๋ค์ ํธ์ถ). CRAG์ ๋ถ๋ถ ์ค๋ณต
- Refinement ๋ฐ๋๋ฅ 20% (5๋ฒ ์ค 1๋ฒ) - ์ ์ ์ฟผ๋ฆฌ์์ ๋ฌด๋ฐ๋
- ๊ตํ: D6 (Rerank) ์ํ์ฐฉ์ค์ ๊ฐ์ ํจํด - production ํจํด์ ์์ ๋๋ฉ์ธ ์ฝํผ์ค์ ๋ธ๋ผ์ธ๋ ์ ์ฉํ๋ฉด ROI ๋ฎ์. ์ ๋ ํ๊ฐ ์์ด๋ "CRAG ๋์ ํ์" ๋ง์ผํ ์ผ๋ก ๋๋ฌ์ ๊ฒ
- ๊ฒฐ์ : CRAG ํ์ฑ ์ ์ง (
CRAG_ENABLED=true).- ํ์ง ํฅ์ ๋ฏธ๋ฏธํ์ง๋ง ์ธ์ฉ ์ ๋ขฐ๋(0~1 relevance_score) ๊ฐ์ํ๊ฐ production observability์ ๊ฐ์น
- ๋น์ฉ +31% ์ ๋๊ฐ ๋ฏธ๋ฏธ (1000 ์๋๋น +$2.90)
- ์ฝํผ์ค 100+ ํ์ฅ ๋๋ ํ๊ตญ์ด reranker ๋์ ์ ์ฌํ๊ฐ ๊ถ์ฅ
7. ํ๊ตญ์ด reranker ํ์ ํ๊ฐ - D6 ๊ฐ์ค ๊ฒ์ฆ (D9)
- ์์: D6์์ "์์ด ํ์ต reranker๊ฐ ํ๊ตญ์ด ์ฝํผ์ค์์ ํจ๊ณผ ์์" ๊ฐ์ค ์ ์.
Dongjin-kr/ko-reranker๋ก ๊ฒ์ฆ - ๋ฐฉ๋ฒ:
rerank.py์RERANK_MODELํ๊ฒฝ๋ณ์ ์ถ๊ฐ, 6๊ฐ ๋ํ ์ฟผ๋ฆฌ ร 3 ๋ชจ๋(hybrid / BAAI / ko-reranker)๋ก CRAG grader ์ฑ์ - ๊ฒฐ๊ณผ: hybrid 0.734 (baseline), BAAI 0.714 (-0.020), ko-reranker 0.703 (-0.031)
- ๋ฐ์ ์์ ๋ฐ์ : ์ฟผ๋ฆฌ๋ณ๋ก ๋ณด๋ฉด ko-reranker๊ฐ CMP(+0.10), ์๋ฏธ ์ฐํ 1(+0.083)์์ ์ฐ์. Etch(-0.18), ์๋ฏธ ์ฐํ 2(-0.20)์์ ์์ค. ์ ์ฒด ํ๊ท ์ ๋ฌด์น๋ถ
- ํด์: ํ๊ตญ์ด reranker๊ฐ ์์ด๋ณด๋จ ๋๋ฉ์ธ ์ ํฉ์ฑ ์ฝ๊ฐ ์ฐ์์ง๋ง, ๋ณธ ์ฝํผ์ค ๊ท๋ชจ(~10๋ฌธ์)์์ hybrid top-3์ด ์ด๋ฏธ ์ถฉ๋ถํ ์ ๋ฐํด ์ด๋ค reranker๋ ์๋ฏธ ์๋ ์ด๋ ์์
- ๊ฒฐ๋ก (์ ์ ): D6 ๊ฐ์ค ๋ถ๋ถ์ ์ฌํ์ธ - ์ฝํผ์ค ๊ท๋ชจ๊ฐ ์ง์ง ์์ธ์ด๋ผ๋ ๋ ํฐ ๊ฐ์ค์ ์ ์
8. Supervisor agent - LLM-driven ๋์ workflow routing
- ์์: ๊ธฐ์กด conditional edge๋ threshold ๊ธฐ๋ฐ(
score < 0.3โ skip,max pct < 40โ retry). "์ง์ง agent๋ผ๋ฉด LLM์ด ๋งฅ๋ฝ์ ๋ณด๊ณ ๊ฒฐ์ ํด์ผ ํ๋ค" - ๊ตฌํ:
agents/supervisor.py- Tier 2 ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์ 3๊ฐ์ง action ๊ฒฐ์ proceed_full(ํ์ค): Tier 3 โ Tier 4fast_track(๋จ์ผ ์์ธ ์ฐ์ธ): Tier 3 LLM skip, deterministic ๊ฒฝ๋ ์ฒ๋ฆฌ๋ก ๋น์ฉ ์ ๊ฐescalate(๊ณ ์ํ): ์ ์ ์งํ + human review ํ๋๊ทธ (Tier 4 immediate ์ฒซ ํญ๋ชฉ์ ๐จ prepend)
- ๋ชจ๋ธ: gpt-4o-mini (์์ฌ๊ฒฐ์ ์์์ , ๋น์ฉ ์ ๊ฐ)
- LangGraph ์๊ฐํ: 3๊ฐ ๋ถ๊ธฐ ๋ ธ๋ (detect, cause, supervisor) - ์ ์ + LLM-driven ๋ผ์ฐํ ์ ์กฐํฉ
- smoke test: A1 (medium severity, 3 causes) โ proceed_full, A2/A3 (high severity) โ proceed_full. ํ ๋ฐ์ดํฐ์์ ๋ชจ๋ ํ์ค ๊ฒฝ๋ก ์ ํ (์์ ํ ๊ธฐ๋ณธ)
9. LangSmith observability ํตํฉ
- ๋ชฉ์ : production-grade ํธ๋ ์ด์ค ๋์๋ณด๋. ์๋๋ณ LLM ํธ์ถ ํธ๋ฆฌ, tool ํธ์ถ ์ํ์ค, latencyยทtoken ๋ถ์
- ๊ตฌํ:
wrap_openai๋ก ๋ชจ๋ chat.completions.create ์๋ ํธ๋ ์ด์ค,@traceable๋ฐ์ฝ๋ ์ดํฐ๋ก 4-Tier agent + Supervisor + tool dispatcher๋ฅผ nested run์ผ๋ก ์๊ฐํ - ํ ๊ธ: ํ๊ฒฝ๋ณ์
LANGSMITH_TRACING=true/false๋ก on/off, ๋นํ์ฑ ์ no-op (์ฑ๋ฅยท๊ธฐ๋ฅ ์ํฅ ์์) - ํฌํธํด๋ฆฌ์ค ๊ฐ์น: ์ธํฐ๋ทฐ์์ "๊ฐ LLM ํธ์ถยทtool ํธ์ถยทtokenยทlatency ๋ค ๋ณด์ ๋๋ค" ํ ์ค๋ก production-grade ์ธ์
10. ์ฝํผ์ค 12 โ 34 ํ์ฅ + D10์ผ๋ก ๊ฐ์ค ๊ฒ์ฆ
- ์์: D9๊น์ง ๋์ ๋ ๊ฐ์ค "์ฝํผ์ค ๊ท๋ชจ๊ฐ reranker ํจ์ฉ์ ์ ๊ฒฐ์กฐ๊ฑด". ์ด๋ฅผ ์ ๋ ๊ฒ์ฆํ๋ ค๋ฉด ์ฝํผ์ค ํ์ฅ ํ์
- ๋ฐฉ๋ฒ: ํฉ๋ฒ์ ๊ณต๊ฐ ์๋ฃ๋ก 12๊ฐ โ 34๊ฐ ํ์ฅ
- ํ๊ตญ์ด ์ํค๋ฐฑ๊ณผ 12๊ฐ (๋ฐ๋์ฒด ๊ณต์ ์ ๋ฐ: Photo/Etch/CMP/์ด์จ์ฃผ์ /๋ฐ๋ง/ํฌํ ๋ ์ง์คํธ/EUV ๋ฑ)
- SKํ์ด๋์ค ๋ด์ค๋ฃธ 6๊ฐ (์ค์ ์ฐ์ ์ด์ ๊ด์ : ์๊ฐยทํฌํ ยทCMPยท์ธ์ )
- ์ผ์ฑ๋ฐ๋์ฒด ๊ณต์ 3๊ฐ (8๋ ๊ณต์ ยท์ฉ์ด์งยทEUV)
- SKC ์์ฌ 1๊ฐ, PHM Society 2016 ์ฑ๋ฆฐ์ง 1๊ฐ
- ๋ชจ๋ ์ถ์ฒ๋ CC BY-SA ๋๋ ๊ณต๊ฐ ์๋ฃ, ํ์ผ๋ณ attribution ๋ช ์
- D10 ๊ฒฐ๊ณผ (re-run D9 with 34 docs):
- hybrid: 0.734 โ 0.592 (-0.142, noise ์ฆ๊ฐ)
- BAAI: -0.020 โ +0.117 (๋ฐ์ !)
- ko-reranker: -0.031 โ +0.083 (๋ฐ์ !)
- ๊ฒ์ฆ ์๋ฃ: ๊ฐ์ค ์ ํํ ์ ์ฆ. ํ์ฅ ์ฝํผ์ค์์๋ BM25/FAISS๊ฐ ์ผ๋ฐ ์๋ฃ noise๋ฅผ ํก์ํ์ง๋ง cross-encoder๊ฐ ๊ทธ์ค์์ ์ ๋ต์ ๊ณจ๋ผ๋
- ๊ฒฐ์ : ์ฝํผ์ค 30+ ํ๊ฒฝ์์๋
RAG_BACKEND=hybrid_rerank๊ถ์ฅ. ๋ฐ๋ชจ์ฉ 12๊ฐ์์ hybrid ์ ์ง - ์๋ฆฌ์ฆ ์์: D6 โ D9 โ D10์ด portfolio narrative๋ก ์์ฑ. "ํต๋ โ ์ ๋ ๋ฐ๋ฐ โ ๊ฐ์ค โ ์ ๋ ๊ฒ์ฆ"์ ์ฌ์ดํด์ด ์ ๋ ํ๊ฐ์ ๊ฐ์น ์์ฒด๋ฅผ ์ฆ๋ช
11. Conductor ํจํด (Plan-and-Execute) ๋์ - "agentic โ conductor" ์ ํ
- ์ํฉ: 4-tier agentic ์์คํ (D7) ๋์ ํ ์๋๋น ์ฝ 3๋ถ(194์ด)ยทLLM 10~13ํ๋ก ๋ฐ๋ชจ UX ์ ํ. ์ฝํผ์ค ํ์ฅ(D10)์ผ๋ก ์ปจํ ์คํธ ๋ ๋ฌด๊ฑฐ์์ง
- ์ง๋จ: Anthropic์ Building Effective Agents๊ฐ ๋ช ์ํ๋ฏ "autonomous" ํจํด์ ์ ์์ฑ์ด ๊ฐ์ ์ด์ง๋ง ํต์ ์ค๋ฒํค๋(iteration ๋์ ยท์ฌ๊ท ํธ์ถ ์ํ) ํผ
- ์ ํ: Plan-and-Execute ํจํด - Central Planner Agent๊ฐ ์๋+Tier 1์ ๋ณด๊ณ ์ ์ฒด ์ํฌํ๋ก์ฐ(Tier 2/3/4 ๊ฐ tool ํธ์ถ plan)๋ฅผ 1ํ ์ฐ์ถ, ๊ฐ Tier executor๋ plan๋๋ก tool ์ง์ ์คํ + LLM 1ํ synthesis
- ๊ตฌํ:
agents/planner.py์ ๊ท +cause/impact/response.py์ conductor ๊ฒฝ๋ก ์ถ๊ฐ (autonomous๋ ์ต์ ์ ์ง). ํ๊ฒฝ๋ณ์AGENT_MODE=conductor(๊ธฐ๋ณธ) /autonomous๋ก ํ ๊ธ - D11 ์ ๋ ๊ฒฐ๊ณผ (3 ์๋, CRAG OFF ๋์ผ ์กฐ๊ฑด):
- LLM ํธ์ถ: 10.0 โ 4.0 (-60%, Planner 1 + Tierร3 synthesis)
- Latency: 131์ด โ 60์ด (-54%)
- ๋น์ฉ: $33.23 โ $13.80 / 1000์๋ (-58%)
- ์ธ์ฉ ๊น์ด: 6.0 โ 6.0 (๋๋ฑ, ํ์ง ์์ค ์์)
- ํต์ฌ narrative: D7(workflow โ agentic์ผ๋ก ์์จ์ฑ ํ๋ณด) โ D11(agentic โ conductor๋ก ํจ์จ ํ๋ณต). ๋ ๋จ๊ณ ๋ชจ๋ ์ ๋ ๋ฐ์ดํฐ ๊ธฐ๋ฐ ์์ฌ๊ฒฐ์ . autonomous์ ์์จ์ฑ vs conductor์ ํจ์จ์ฑ์ trade-off๋ก ๋ช ์ ์ฑํ
- ์ฌ๊ท ์ํ ์์ฒ ์ฐจ๋จ: ๊ธฐ์กด
MAX_TOOL_ITERATIONS=4์บก์ ์์กดํ๋ ๋ฌดํ๋ฃจํ ๋ฐฉ์ง๊ฐ plan ๊ณ ์ ์คํ์ผ๋ก ๋ณธ์ง์ ์ผ๋ก ํด๊ฒฐ
์คํ
๋ก์ปฌ
pip install -r requirements.txt
cp .env.example .env # OPENAI_API_KEY ์
๋ ฅ
streamlit run app.py --server.port 8501
PHM 2016 CMP ์บ์(data/phm2016/phm_cmp_features.csv)๋ ์ ์ฅ์์ ํฌํจ๋์ด ๋ณ๋ ๋ค์ด๋ก๋๊ฐ ํ์ ์์ต๋๋ค.
raw trajectory ๋ฐ์ดํฐ๋ฅผ ์ง์ ๋ค๋ฃจ๋ ค๋ฉด data/phm2016/README.md ์ฐธ๊ณ .
RAG ๋ฐฑ์๋ ์ ํ
RAG_BACKEND=hybrid streamlit run app.py # ๊ธฐ๋ณธ๊ฐ (์ค์ธก ๋ฐ์ดํฐ ๊ทผ๊ฑฐ ์ฑํ)
RAG_BACKEND=hybrid_rerank streamlit run app.py # ์ต์
: ์ฝํผ์ค ํ์ฅ ์
RAG_BACKEND=faiss streamlit run app.py # ์ต์
: ์๋ฏธ ์์ฃผ
RAG_BACKEND=keyword streamlit run app.py # ์ต์
: ์์กด์ฑ ์ต์
Agent ๋ชจ๋ ํ ๊ธ (D11)
AGENT_MODE=conductor streamlit run app.py # ๊ธฐ๋ณธ - Plan-and-Execute (๋น ๋ฅด๊ณ ์ ๋ ด, ํต์ ์ต์)
AGENT_MODE=autonomous streamlit run app.py # ์ต์
- tool-using agent loop (์ ์์ฑ ์ฐ์)
CRAG (Self-correction) ํ ๊ธ
CRAG_ENABLED=true streamlit run app.py # ๊ธฐ๋ณธ๊ฐ - retrieval grader + ์๋ refinement
CRAG_ENABLED=false streamlit run app.py # ๋นํ์ฑ - latency critical ์๋๋ฆฌ์ค
LangSmith Observability (์ ํ)
๋ชจ๋ LLMยทtoolยทagent ํธ์ถ์ด LangSmith ๋์๋ณด๋๋ก ์๋ ์ ์ก๋ฉ๋๋ค.
# .env ์ ์ถ๊ฐ (https://smith.langchain.com ์์ API ํค ๋ฐ๊ธ)
LANGSMITH_TRACING=true
LANGSMITH_API_KEY=lsv2_pt_...
LANGSMITH_PROJECT=fabagent
ํ์ฑ ์:
wrap_openai๊ฐ ๋ชจ๋chat.completions.createํธ์ถ์ ์๋ ํธ๋ ์ด์ค (Tier 2/3/4 agent, CRAG grader, RAGAS ํ๊ฐ ๋ฑ)@traceable๋ฐ์ฝ๋ ์ดํฐ๋ก 4-Tier orchestratorยท๊ฐ agentยทtool dispatcher๋ฅผ nested run์ผ๋ก ์๊ฐํ- production observability: ์๋๋ณ latency / ๋น์ฉ / tool ํธ์ถ ํธ๋ฆฌ / error ์ถ์
Hugging Face Spaces ๋ฐฐํฌ
- HF Space ์์ฑ (SDK: Streamlit)
- ๋ณธ ์ ์ฅ์ ์ฐ๊ฒฐ (๋๋ push)
- Space settings โ Variables and secrets โ
OPENAI_API_KEY์ถ๊ฐ - ์๋ ๋น๋ยท๋ฐฐํฌ
์๋จ frontmatter๊ฐ HF Space ์ค์ ์ผ๋ก ์๋ ์ธ์๋ฉ๋๋ค.
ํ์ผ ๊ตฌ์กฐ
fabagent/
โโโ app.py # Streamlit ์ํธ๋ฆฌํฌ์ธํธ
โโโ components/ # UI ์ปดํฌ๋ํธ (์ฌ์ด๋๋ฐยทํค๋ยทTier ์นด๋ยทcascade)
โโโ core/
โ โโโ schema.py # Tier1~4 TypedDict ๊ณ์ฝ
โ โโโ pipeline.py # ์๋ โ Tier ๋ฐ์ดํฐ ๋ผ์ฐํฐ
โโโ agents/
โ โโโ orchestrator.py # LangGraph StateGraph + ์กฐ๊ฑด๋ถ ๋ผ์ฐํ
โ โโโ detection.py # Tier 1 IsolationForest (SECOM/PHM ๋์คํจ์น)
โ โโโ planner.py # Central Planner Agent (Plan-and-Execute, conductor ๋ชจ๋)
โ โโโ cause.py # Tier 2 (conductor: plan ๋ฐ์ / autonomous: tool loop)
โ โโโ impact.py # Tier 3 (conductor / autonomous ์ ๋ชจ๋)
โ โโโ response.py # Tier 4 (conductor / autonomous ์ ๋ชจ๋)
โ โโโ supervisor.py # autonomous ๋ชจ๋ ์ ์ฉ LLM-driven router
โ โโโ llm.py # OpenAI ํด๋ผ์ด์ธํธ + LangSmith wrap_openai ํตํฉ
โ โโโ tools/ # 7๊ฐ agent ๋๊ตฌ
โ โ โโโ knowledge.py # search_knowledge (RAG ๊ฒ์)
โ โ โโโ incident.py # lookup_incident_history
โ โ โโโ equipment.py # get_pm_history, check_pm_schedule
โ โ โโโ process.py # query_wip_status, get_downstream_steps, get_yield_baseline
โ โโโ rag/
โ โโโ store.py # ๋ฐฑ์๋ dispatch (keyword/faiss/hybrid/hybrid_rerank)
โ โโโ faiss_store.py # FAISS ๋ฒกํฐ ๊ฒ์
โ โโโ hybrid_store.py # BM25 + FAISS + Reciprocal Rank Fusion
โ โโโ rerank.py # Cross-encoder ์ฌ์ ๋ ฌ (BAAI/bge-reranker-base)
โ โโโ crag.py # CRAG self-correction (grader + query refiner)
โ โโโ learn.py # ์๊ฐ ํ์ต ๋ฃจํ (INC-AUTO-*.md ์๋ ๊ธฐ๋ก)
โ โโโ knowledge/ # ๋๋ฉ์ธ ๋ฌธ์ (INC/FMEA/SOP/FLOW)
โโโ data/
โ โโโ demo.py # ์๋ ์ ์
โ โโโ wip.py # ์ํฅ WIP ๊ฒฐ์ ๋ก ๋ฐ์ดํฐ
โ โโโ secom/ # SECOM ๋ก๋ + ์ ์ฒ๋ฆฌ + raw .data
โ โโโ phm2016/ # PHM 2016 CMP ๋ก๋ + ์ฌ์ ์ง๊ณ CSV
โโโ experiments/ # ์ ๋ ๋น๊ต ์คํ + ์ฐจํธ
โ โโโ tier1_detection/ # D1: IsoForest / LOF / OC-SVM
โ โโโ retrieval_compare/ # D2: keyword / FAISS / hybrid / +rerank
โ โโโ multi_vs_single/ # D5: multi-agent vs single LLM
โ โโโ rag_eval/ # RAGAS ํ๊ฐ (hybrid vs hybrid_rerank)
โ โโโ rag_paradigm/ # D6: 5๋จ๊ณ paradigm ablation
โ โโโ agentic_vs_workflow/ # D7: workflow vs agentic ๋น๊ต
โ โโโ crag_eval/ # D8: CRAG self-correction ํจ๊ณผ ํ๊ฐ
โ โโโ reranker_compare/ # D9ยทD10: ํ๊ตญ์ด reranker + ํ์ฅ ์ฝํผ์ค ๊ฐ์ค ๊ฒ์ฆ
โ โโโ conductor_vs_autonomous/ # D11: Conductor vs Autonomous (latency -54%, ์ธ์ฉ ๋๋ฑ)
โโโ docs/orchestrator_graph.mmd # LangGraph ์๋ ์ถ์ถ mermaid
โโโ styles/main.css # ๋์์ธ ์์คํ
โโโ tests/
๊ธฐ์ ์คํ
- ํ๋ก ํธ: Streamlit 1.36+
- ๋ฐฑ์๋: OpenAI SDK (
gpt-5-mini, structured output + function calling) - Orchestration: LangGraph StateGraph (์กฐ๊ฑด๋ถ + LLM-driven ๋ผ์ฐํ , mermaid ์ถ์ถ)
- Observability: LangSmith (
wrap_openai+@traceable, ์ต์ ) - ML: scikit-learn (IsolationForest, LOF, OC-SVM)
- RAG: rank-bm25 + sentence-transformers + FAISS + RRF (์ต์ : cross-encoder rerank)
- ํ๊ฐ: RAGAS (faithfulness, answer_relevancy, context_precision) with gpt-4o-mini
- ๋ฐ์ดํฐ: pandas, UCI SECOM, PHM 2016 CMP Data Challenge
- Python: 3.11+
ํ๊ณ์ ํฅํ ํ์ฅ
- SECOM์ ์ต๋ช ์ฑ: 590๊ฐ ์ผ์๊ฐ ์ด๋ ๊ณต์ ยท๋ฌผ๋ฆฌ๋์ธ์ง ๋น๊ณต๊ฐ๋ผ A1/A2์ step ๋ผ๋ฒจ์ ์์ฐ์ฉ narrative
- knowledge ๋ฌธ์: ํฉ์ฑ 12๊ฐ + ๊ณต๊ฐ ์๋ฃ(์ํค/SKํ์ด๋์ค/์ผ์ฑ/SKC/PHM) 22๊ฐ = ์ด 34๊ฐ. ์ค fab ์์ฒ ๋ฌธ์ ๋๋น ์ฌ์ ํ ์์ง๋ง, D10์์ ์ฝํผ์ค ๊ท๋ชจ์ reranker ํจ์ฉ์ ๊ด๊ณ๋ ์ ๋ ๊ฒ์ฆ๋จ
- ๋๊ตฌ mock data: PM ์ด๋ ฅยทyield baselineยทdownstream ์์กด์ฑ์ in-memory mock (์ค fab์ MES/EAP/YMS ์ด๋ํฐ๋ก ๊ต์ฒด)
- ํ๊ตญ์ด reranker ๊ฒ์ฆ ์๋ฃ(D9): hybrid ๋จ๋ ์ ๋ฏธ๋ฌ, ์ฝํผ์ค ํ์ฅ์ด reranker ํจ์ฉ์ ์ ๊ฒฐ์กฐ๊ฑด์์ ํ์ธ
- Supervisor fast_track ์์ฐ ๋ถ์ฌ: ํ 3๊ฐ ๋ฐ๋ชจ ์๋์ ๋ชจ๋ proceed_full ์ ํ - fast_track/escalate ์์ฐ์ ์ํด์ ๋ ๋ค์ํ ์๋ ์๋๋ฆฌ์ค ํ์
- ๊ณ ๋ํ ๋ฐฉํฅ: GraphRAG(๊ณต์ ์์กด์ฑ ๋ ธ๋ ๊ทธ๋ํ) ยท ์ค MES/EAP/YMS ์ด๋ํฐ ยท ํ๊ตญ์ด reranker ์ ์ฉ fine-tuning ยท ๋ฉํฐ ์์ด์ ํธ negotiation (ํ์ฌ๋ supervisor๊ฐ ์ผ๋ฐฉํฅ ๋ผ์ฐํ )









