






# Document Pipeline
DocumentParser → 파일별 텍스트 추출 + 메타데이터
InformationExtractor → LLM 기반 정보 추출:
├── 메타데이터 (제목, 키워드, 저자 등)
├── 온톨로지 관계 (엔티티-관계 트리플)
└── 구조화 데이터 (테이블, 목록 등)
self.ENTITY_TYPES = {
# 일반 엔티티 타입 (4개)
"Organization", "Person", "Country", "Location",
# 제품 및 자재 (9개)
"Product", "Material", "Component", "Chemical", "Precursor",
"Dopant", "Batch", "Lot",
# 공정 및 설비 (12개)
"Equipment", "Process", "ProcessLine", "Instrument", "Tool",
"Sensor", "Filter", "Valve", "Mesh", "Tank", "Feeder", "Mixer",
# 문제 및 품질 (8개)
"Defect", "FailureMode", "RootCause", "Parameter", "Specification",
"Quality", "Contaminant", "ForeignMaterial",
# 측정 및 분석 (4개)
"TestMethod", "AnalysisResult", "Measurement", "SamplePoint",
# 기타 (8개)
"Technology", "Policy", "Event", "Industry", "Market",
"Maintenance", "Issue", "Solution", "Timeline"
}RELATIONSHIPS = [
# 기본 관계 (4개)
"related", "include", "contains", "belongs_to",
# 인과 관계 (4개)
"caused_by", "resulted_in", "affected_by", "contributes_to",
# 비즈니스/제조 관계 (6개)
"competes_with", "supply_to", "receive_from", "manufactured_by",
"processed_in", "distributed_to",
# 장비/공정 관계 (8개)
"used_in", "part_of", "connected_to", "measured_by",
"controlled_by", "operates_with", "feeds_into", "processes",
# 품질/문제 관계 (7개)
"detected_in", "improved_by", "failed_due_to", "contaminated_by",
"exceeds_limit", "below_limit", "causes_defect",
# 물질/화학적 관계 (4개)
"reacts_with", "dissolves_in", "precipitates_from", "catalyzes",
# 유지보수/관리 관계 (6개)
"maintained_by", "replaced_by", "calibrated_by", "cleaned_by",
"regulated_by", "inspected_by",
# 시간/순서 관계 (4개)
"precedes", "follows", "occurs_during", "scheduled_for",
# 분석/테스트 관계 (4개)
"analyzed_with", "tested_by", "sampled_from", "verified_by",
# 비즈니스/규제 관계 (4개)
"invested_in", "complies_with", "certified_by", "approved_by"
]# EmbeddingManager - 다층 검색 지원
similarity_search(query, k=5) # 기본 의미 검색
filter_search(query, metadata_filter, k=5) # 메타데이터 필터링
# OntologyGenerator - TTL 기반 SPARQL 검색
get_entity_relations(entity) # 엔티티 관계망 조회
get_entities_by_type(entity_type) # 타입별 엔티티 검색
check_entity_exists(entity_name) # 엔티티 존재 확인
class AdvisorAgent:
tools = [
"search_documents", # 벡터 검색
"search_with_filter", # 조건부 검색
"query_ontology", # 온톨로지 조회
"get_entity_relationships", # 관계망 분석
"generate_report" # 보고서 생성
]
# 일반 RAG
query → embedding → vector_search → context → LLM
# DX-AI Advisor
query → {
vector_search(semantic_similarity),
ontology_search(entity_relations),
metadata_filter(domain_specific),
entity_expansion(knowledge_graph)
} → integrated_context → domain_expert_LLM