# halyn1130/medai-agent architecture

> Architecture diagram of the GitHub repository halyn1130/medai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/halyn1130/medai-agent
- Repository: https://github.com/halyn1130/medai-agent

## Overview

MedAI-Agent는 의료 AI 스타트업을 평가해 적격 기업을 선정하고 근거·후속 실사 질문을 담은 보고서를 만드는 멀티 에이전트 시스템입니다. 문서화된 주 흐름은 입력 정규화 후 임상·인허가, 시장·사업성, 실적·성장성, Risk를 병렬 분석하고 투자 심사에서 검증·보완·채점·선정하는 것입니다. README는 전체 실행 진입점이 아직 구현 중이라고 명시합니다. 세부 연결은 SOURCE INDEX의 참조와 README에 근거하며, 일부 내부 단계는 sampled source가 없어 생략했습니다.

Main entry points: [`agents/investment_review/nodes.py`](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/nodes.py) (심사 통합), [`agents/orchestrator/graph.py`](https://github.com/halyn1130/medai-agent/blob/main/agents/orchestrator/graph.py) (분석 조정), [`agents/clinical_regulatory/agent.py`](https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/agent.py) (임상·인허가 평가), [`agents/investment_review/inputs.py`](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/inputs.py) (입력 정규화)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["입력·조정"]
  node_input_normalization["입력 정규화<br/>[inputs.py]"]
  node_orchestrator["분석 조정<br/>[graph.py]"]
  node_routing["재실행 라우팅<br/>[routing.py]"]
end

subgraph group_analysis["분석 에이전트"]
  node_clinical_collection["임상 자료 수집<br/>[collect.py]"]
  node_clinical_analysis["임상·인허가 평가<br/>[agent.py]"]
  node_clinical_schema["임상 결과 계약<br/>[schema.py]"]
  node_market_worker["시장·사업성 평가<br/>[agent.py]"]
  node_market_schema["시장 결과 계약<br/>[schema.py]"]
  node_traction_collection["실적 자료 수집<br/>[collect.py]"]
  node_traction_evaluation["실적·성장성 평가<br/>[evaluator.py]"]
  node_risk_collection["Risk 자료 수집<br/>[collect.py]"]
  node_risk_evaluation["Risk 평가<br/>[evaluator.py]"]
end

subgraph group_market_data["시장 데이터"]
  node_market_dataset["시장 데이터 색인<br/>[build_index.py]"]
  node_market_retriever["시장 데이터 검색<br/>[retriever.py]"]
  node_market_embeddings["문서 임베딩<br/>[embeddings.py]"]
end

subgraph group_review["투자 심사"]
  node_review_nodes["심사 통합<br/>[nodes.py]"]
  node_review_contract["심사 결과 계약<br/>[contract.py]"]
  node_review_policy["평가 정책<br/>[policy.py]"]
  node_review_validation["근거 검증<br/>[validate.py]"]
  node_review_requests["보완 요청<br/>[review_requests.py]"]
  node_review_selection["점수·기업 선정<br/>[selection.py]"]
end

subgraph group_reporting["보고서"]
  node_report_context["보고서 맥락 구성<br/>[context_builder.py]"]
  node_report_writer["보고서 생성<br/>[writer.py]"]
end

node_analyst(("투자 검토자"))

node_analyst -->|"입력 제공"| node_input_normalization
node_input_normalization -.->|"정규화 입력 전달"| node_orchestrator
node_orchestrator -->|"병렬 실행"| node_clinical_analysis
node_orchestrator -->|"병렬 실행"| node_market_worker
node_orchestrator -->|"병렬 실행"| node_traction_evaluation
node_orchestrator -->|"병렬 실행"| node_risk_evaluation
node_clinical_analysis -.->|"자료 수집"| node_clinical_collection
node_clinical_analysis -->|"결과 계약 사용"| node_clinical_schema
node_market_worker -->|"결과 계약 사용"| node_market_schema
node_traction_evaluation -.->|"수집 결과 평가"| node_traction_collection
node_risk_evaluation -.->|"고정 자료 활용"| node_risk_collection
node_market_dataset -.->|"색인 제공"| node_market_retriever
node_market_retriever -->|"임베딩 활용"| node_market_embeddings
node_orchestrator -->|"분석 결과 전달"| node_review_nodes
node_review_nodes -->|"계약 사용"| node_review_contract
node_review_nodes -->|"정책 사용"| node_review_policy
node_review_nodes -->|"근거 검증 호출"| node_review_validation
node_review_nodes -->|"보완 요청 생성"| node_review_requests
node_review_nodes -->|"선정 처리"| node_review_selection
node_review_nodes -.->|"재실행 조정"| node_routing
node_review_nodes -.->|"보고서 자료 전달"| node_report_context
node_report_context -.->|"보고서 맥락 제공"| node_report_writer
node_report_writer -.->|"평가 보고서 반환"| node_analyst

click node_input_normalization "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/inputs.py"
click node_orchestrator "https://github.com/halyn1130/medai-agent/blob/main/agents/orchestrator/graph.py"
click node_routing "https://github.com/halyn1130/medai-agent/blob/main/agents/orchestrator/routing.py"
click node_clinical_collection "https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/collection/collect.py"
click node_clinical_analysis "https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/agent.py"
click node_clinical_schema "https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/schema.py"
click node_market_worker "https://github.com/halyn1130/medai-agent/blob/main/agents/market/agent.py"
click node_market_schema "https://github.com/halyn1130/medai-agent/blob/main/agents/market/schema.py"
click node_traction_collection "https://github.com/halyn1130/medai-agent/blob/main/agents/traction_growth/collect.py"
click node_traction_evaluation "https://github.com/halyn1130/medai-agent/blob/main/agents/traction_growth/evaluator.py"
click node_risk_collection "https://github.com/halyn1130/medai-agent/blob/main/agents/risk/collection/collect.py"
click node_risk_evaluation "https://github.com/halyn1130/medai-agent/blob/main/agents/risk/evaluator.py"
click node_market_dataset "https://github.com/halyn1130/medai-agent/blob/main/rag/market/build_index.py"
click node_market_retriever "https://github.com/halyn1130/medai-agent/blob/main/rag/market/retriever.py"
click node_market_embeddings "https://github.com/halyn1130/medai-agent/blob/main/rag/market/embeddings.py"
click node_review_nodes "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/nodes.py"
click node_review_contract "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/contract.py"
click node_review_policy "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/policy.py"
click node_review_validation "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/validate.py"
click node_review_requests "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/review_requests.py"
click node_review_selection "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/selection.py"
click node_report_context "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/report/context_builder.py"
click node_report_writer "https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/report/writer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_input_normalization,node_orchestrator,node_routing toneBlue
class node_clinical_collection,node_clinical_analysis,node_clinical_schema,node_market_worker,node_market_schema,node_traction_collection,node_traction_evaluation,node_risk_collection,node_risk_evaluation toneAmber
class node_market_dataset,node_market_retriever,node_market_embeddings toneMint
class node_review_nodes,node_review_contract,node_review_policy,node_review_validation,node_review_requests,node_review_selection toneRose
class node_report_context,node_report_writer,node_analyst toneIndigo
```

## Components

### 입력·조정

- [입력 정규화](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/inputs.py): `agents/investment_review/inputs.py`
- [분석 조정](https://github.com/halyn1130/medai-agent/blob/main/agents/orchestrator/graph.py): `agents/orchestrator/graph.py`
- [재실행 라우팅](https://github.com/halyn1130/medai-agent/blob/main/agents/orchestrator/routing.py): `agents/orchestrator/routing.py`

### 분석 에이전트

- [임상 자료 수집](https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/collection/collect.py): `agents/clinical_regulatory/collection/collect.py`
- [임상·인허가 평가](https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/agent.py): `agents/clinical_regulatory/agent.py`
- [임상 결과 계약](https://github.com/halyn1130/medai-agent/blob/main/agents/clinical_regulatory/schema.py): `agents/clinical_regulatory/schema.py`
- [시장·사업성 평가](https://github.com/halyn1130/medai-agent/blob/main/agents/market/agent.py): `agents/market/agent.py`
- [시장 결과 계약](https://github.com/halyn1130/medai-agent/blob/main/agents/market/schema.py): `agents/market/schema.py`
- [실적 자료 수집](https://github.com/halyn1130/medai-agent/blob/main/agents/traction_growth/collect.py): `agents/traction_growth/collect.py`
- [실적·성장성 평가](https://github.com/halyn1130/medai-agent/blob/main/agents/traction_growth/evaluator.py): `agents/traction_growth/evaluator.py`
- [Risk 자료 수집](https://github.com/halyn1130/medai-agent/blob/main/agents/risk/collection/collect.py): `agents/risk/collection/collect.py`
- [Risk 평가](https://github.com/halyn1130/medai-agent/blob/main/agents/risk/evaluator.py): `agents/risk/evaluator.py`

### 시장 데이터

- [시장 데이터 색인](https://github.com/halyn1130/medai-agent/blob/main/rag/market/build_index.py): `rag/market/build_index.py`
- [시장 데이터 검색](https://github.com/halyn1130/medai-agent/blob/main/rag/market/retriever.py): `rag/market/retriever.py`
- [문서 임베딩](https://github.com/halyn1130/medai-agent/blob/main/rag/market/embeddings.py): `rag/market/embeddings.py`

### 투자 심사

- [심사 통합](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/nodes.py): `agents/investment_review/nodes.py`
- [심사 결과 계약](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/contract.py): `agents/investment_review/contract.py`
- [평가 정책](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/policy.py): `agents/investment_review/policy.py`
- [근거 검증](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/validate.py): `agents/investment_review/validate.py`
- [보완 요청](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/review_requests.py): `agents/investment_review/review_requests.py`
- [점수·기업 선정](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/selection.py): `agents/investment_review/selection.py`

### 보고서

- [보고서 맥락 구성](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/report/context_builder.py): `agents/investment_review/report/context_builder.py`
- [보고서 생성](https://github.com/halyn1130/medai-agent/blob/main/agents/investment_review/report/writer.py): `agents/investment_review/report/writer.py`

### Other components

- **투자 검토자**

## Connections

- 투자 검토자 → 입력 정규화: 입력 제공 (evidence: `README.md`)
- 입력 정규화 → 분석 조정: 정규화 입력 전달 (evidence: `README.md`)
- 분석 조정 → 임상·인허가 평가: 병렬 실행 (evidence: `agents/orchestrator/graph.py`)
- 분석 조정 → 시장·사업성 평가: 병렬 실행 (evidence: `agents/orchestrator/graph.py`)
- 분석 조정 → 실적·성장성 평가: 병렬 실행 (evidence: `agents/orchestrator/graph.py`)
- 분석 조정 → Risk 평가: 병렬 실행 (evidence: `agents/orchestrator/graph.py`)
- 임상·인허가 평가 → 임상 자료 수집: 자료 수집
- 임상·인허가 평가 → 임상 결과 계약: 결과 계약 사용 (evidence: `agents/clinical_regulatory/agent.py`)
- 시장·사업성 평가 → 시장 결과 계약: 결과 계약 사용 (evidence: `agents/market/agent.py`)
- 실적·성장성 평가 → 실적 자료 수집: 수집 결과 평가 (evidence: `README.md`)
- Risk 평가 → Risk 자료 수집: 고정 자료 활용 (evidence: `README.md`)
- 시장 데이터 색인 → 시장 데이터 검색: 색인 제공 (evidence: `README.md`)
- 시장 데이터 검색 → 문서 임베딩: 임베딩 활용 (evidence: `rag/market/retriever.py`)
- 분석 조정 → 심사 통합: 분석 결과 전달 (evidence: `agents/orchestrator/graph.py`)
- 심사 통합 → 심사 결과 계약: 계약 사용 (evidence: `agents/investment_review/nodes.py`)
- 심사 통합 → 평가 정책: 정책 사용 (evidence: `agents/investment_review/nodes.py`)
- 심사 통합 → 근거 검증: 근거 검증 호출 (evidence: `agents/investment_review/nodes.py`)
- 심사 통합 → 보완 요청: 보완 요청 생성 (evidence: `agents/investment_review/nodes.py`)
- 심사 통합 → 점수·기업 선정: 선정 처리 (evidence: `agents/investment_review/nodes.py`)
- 심사 통합 → 재실행 라우팅: 재실행 조정
- 심사 통합 → 보고서 맥락 구성: 보고서 자료 전달 (evidence: `README.md`)
- 보고서 맥락 구성 → 보고서 생성: 보고서 맥락 제공 (evidence: `README.md`)
- 보고서 생성 → 투자 검토자: 평가 보고서 반환 (evidence: `README.md`)
