Multi-Agent Conversation(MAC) 프레임워크로 의료 진단 능력 강화하기
Enhancing diagnostic capability with multi-agents conversational large language models
TL;DR Highlight
여러 AI 의사 에이전트가 MDT 회의처럼 협업하여 희귀 질환 진단 정확도를 GPT-4 단독보다 높인다.
Who Should Read
의료 AI 솔루션을 개발하는 백엔드 개발자 또는 멀티 에이전트 시스템을 설계 중인 AI 엔지니어. 특히 LLM 단독 추론의 한계를 느끼고 에이전트 협업 구조를 고민하는 분들.
Core Mechanics
- 임상 다학제팀(MDT, 여러 전문의가 모여 논의하는 방식)을 모방한 MAC 프레임워크 설계 — 여러 Doctor 에이전트가 토론하고 Supervisor 에이전트가 최종 판단
- 302개 희귀 질환 케이스로 GPT-3.5, GPT-4, MAC 세 가지 비교 — 초진과 추가 상담 모두에서 MAC이 단독 모델 대비 진단 정확도와 검사 제안 정확도 모두 우세
- 최적 구성은 Doctor 에이전트 4명 + Supervisor 에이전트 1명, 베이스 모델은 GPT-4
- CoT(Chain of Thought, 단계별 추론), Self-Refine(스스로 답 수정), Self-Consistency(여러 번 답하고 다수결) 등 기존 프롬프트 기법들과 비교했을 때 MAC이 정확도와 출력 토큰 수 모두에서 앞섬
- 반복 실행 시 결과 일관성이 높아 실제 임상 적용 가능성 있음
Evidence
- MAC은 GPT-4 단독 대비 초진 및 추가 상담 진단 정확도 모두에서 더 높은 수치 달성 (논문 내 희귀질환 302케이스 기준)
- CoT, Self-Refine, Self-Consistency 대비 MAC이 더 높은 진단 정확도 + 더 많은 출력 토큰(근거 서술 풍부) 기록
- Doctor 에이전트 수를 1→4명으로 늘릴수록 성능 향상, 4명에서 최적점 도달
How to Apply
- 복잡한 분류/판단 태스크에서 단일 LLM 호출 대신, 역할이 다른 에이전트(예: 전문가 A, 전문가 B, 검토자)를 병렬로 돌리고 Supervisor 에이전트가 최종 결론 내리는 구조로 바꿔보면 정확도 향상 기대 가능
- GPT-4 기반으로 에이전트를 구성할 때 4~5개 에이전트가 최적 — 에이전트가 너무 많으면 비용과 지연이 증가하고 성능 향상이 둔화되므로 이 범위 참고
- 의료 외에도 법률 검토, 코드 리뷰, 요구사항 분석처럼 여러 관점이 필요한 도메인에 동일한 MDT 패턴 적용 가능 — 각 에이전트에 다른 전문 역할 페르소나를 부여하면 됨
Code Example
# OpenAI API를 활용한 간단한 MAC 패턴 예시
import openai
client = openai.OpenAI()
def doctor_agent(case: str, specialty: str) -> str:
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": f"You are an experienced {specialty} physician. Analyze the case and suggest a diagnosis with reasoning."},
{"role": "user", "content": case}
]
)
return response.choices[0].message.content
def supervisor_agent(case: str, doctor_opinions: list[str]) -> str:
opinions_text = "\n\n".join([f"Doctor {i+1}: {op}" for i, op in enumerate(doctor_opinions)])
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a senior supervising physician. Review all doctor opinions and provide a final integrated diagnosis."},
{"role": "user", "content": f"Case:\n{case}\n\nDoctor Opinions:\n{opinions_text}\n\nProvide the final diagnosis."},
]
)
return response.choices[0].message.content
# 사용 예시
case = "28-year-old patient with progressive muscle weakness, fatigue, and elevated CK levels..."
specialties = ["neurologist", "rheumatologist", "internal medicine specialist", "geneticist"]
# 4명의 Doctor 에이전트 실행
opinions = [doctor_agent(case, s) for s in specialties]
# Supervisor가 최종 진단
final_diagnosis = supervisor_agent(case, opinions)
print(final_diagnosis)Terminology
관련 논문
adamsreview: Claude Code용 멀티 에이전트 PR 코드 리뷰 파이프라인
Claude Code에서 최대 7개의 병렬 서브 에이전트가 각각 다른 관점으로 PR을 리뷰하고, 자동 수정까지 해주는 오픈소스 플러그인이다. 기존 /review나 CodeRabbit보다 실제 버그를 더 많이 잡는다고 주장하지만 커뮤니티에서는 복잡도와 실효성에 대한 회의론도 나왔다.
Claude를 User Space IP Stack으로 써서 Ping에 응답시키면 얼마나 빠를까?
Claude Code에게 IP 패킷을 직접 파싱하고 ICMP echo reply를 구성하도록 시켜서 실제로 ping에 응답하게 만든 실험으로, 'Markdown이 곧 코드이고 LLM이 프로세서'라는 아이디어를 네트워크 스택 수준까지 밀어붙인 재미있는 사례다.
AI Agent를 위한 Git: re_gent
AI 코딩 에이전트(Claude Code 등)가 수행한 모든 툴 호출을 자동으로 추적하고, 어떤 프롬프트가 어느 코드 줄을 작성했는지 blame까지 가능한 버전 관리 도구다.
Agent-Native CLI를 위한 설계 원칙 10가지
AI 에이전트가 CLI 도구를 더 잘 사용할 수 있도록 설계하는 원칙들을 정리한 글로, 에이전트가 CLI를 도구로 활용하는 빈도가 높아지면서 이 설계 방식이 실용적으로 중요해지고 있다.
Agent-harness-kit: MCP 기반 멀티 에이전트 워크플로우 오케스트레이션 프레임워크
여러 AI 에이전트가 서로 역할을 나눠 협업할 수 있도록 조율하는 scaffolding 도구로, Vite처럼 설정 없이 빠르게 멀티 에이전트 파이프라인을 구성할 수 있다.
Tilde.run – AI Agent를 위한 트랜잭션 기반 버전 관리 파일시스템 샌드박스
AI 에이전트가 실제 프로덕션 데이터를 건드려도 롤백할 수 있는 격리된 샌드박스 환경을 제공하는 도구로, GitHub/S3/Google Drive를 하나의 버전 관리 파일시스템으로 묶어준다.
Original Abstract (Expand)
Large Language Models (LLMs) show promise in healthcare tasks but face challenges in complex medical scenarios. We developed a Multi-Agent Conversation (MAC) framework for disease diagnosis, inspired by clinical Multi-Disciplinary Team discussions. Using 302 rare disease cases, we evaluated GPT-3.5, GPT-4, and MAC on medical knowledge and clinical reasoning. MAC outperformed single models in both primary and follow-up consultations, achieving higher accuracy in diagnoses and suggested tests. Optimal performance was achieved with four doctor agents and a supervisor agent, using GPT-4 as the base model. MAC demonstrated high consistency across repeated runs. Further comparative analysis showed MAC also outperformed other methods including Chain of Thoughts (CoT), Self-Refine, and Self-Consistency with higher performance and more output tokens. This framework significantly enhanced LLMs’ diagnostic capabilities, effectively bridging theoretical knowledge and practical clinical application. Our findings highlight the potential of multi-agent LLMs in healthcare and suggest further research into their clinical implementation.