팟캐스트모드 에이전트 가이드
문서 버전: v2.2 | 작성일: 2026-04-13 | 최종 수정: 2026-04-17 11:30 | 상태: 최신화 완료 ✅
개요
팟캐스트 파이프라인 12개 에이전트 가이드 — Mind-Log 팟캐스트 파이프라인은 TIER 0~4 + 비동기 후처리 구조로 구성된 총 12개 에이전트(TIER 0~4의 9개 + 독립 2개 + Learning Agent 1개)로 이루어집니다. Orchestrator 없이 LangGraph StateGraph가 TIER 흐름을 조율하며, 에이전트 간 공유 상태는 AgentState(TypedDict)로 통합됩니다.
에이전트 구성 (12개)
| # | 에이전트 | TIER | 모델 | 파일 위치 |
|---|---|---|---|---|
| 01 | Intent Classifier | TIER 0 | Haiku | src/agents/podcast/intent_classifier.py |
| 02 | Safety Agent | TIER 1 (병렬) | Sonnet 3.7 | src/agents/podcast/safety.py |
| 03 | Emotion Agent | TIER 1 (병렬) | Haiku | src/agents/podcast/emotion.py |
| 04 | Content Analyzer | TIER 1 (병렬) | Haiku | src/agents/podcast/content_analyzer.py |
| 05 | Podcast Reasoning | TIER 1 (병렬) | Sonnet 3.7 | src/agents/podcast/podcast_reasoning.py |
| 06 | Episode Memory | 독립 (DI) | Sonnet 3.5 | src/agents/podcast/episode_memory.py |
| 07 | Knowledge Agent | 독립 (DI) | Sonnet 3.5 | src/agents/podcast/knowledge.py |
| 08 | Script Generator | TIER 2 (병렬) | Haiku | src/agents/podcast/script_generator.py |
| 09 | Visualization | TIER 2 (병렬) | Haiku + Bedrock Titan | src/agents/podcast/visualization.py |
| 10 | Batch Validator | TIER 3 | Haiku | src/agents/podcast/batch_validator.py |
| 11 | Script Personalizer | TIER 4 | Sonnet 3.7 | src/agents/podcast/script_personalizer.py |
| 부가 | Learning Agent | 비동기 | Sonnet 3.5 | src/agents/shared/learning.py |
프롬프트 버전 (settings.yaml 2026-04-14 동기화 기준)
config/settings.yaml의 prompts.versions 섹션에서 에이전트별 사용 버전을 핀닝합니다. 다음은 2026-04-14 기준 운영 핀닝 버전입니다.
| 에이전트 | 프롬프트 버전 | 비고 |
|---|---|---|
| Content Analyzer | v2.2.0 | 4-키 emotional_journey(climax/closing) 복원, target_duration/narrative_structure 복원 |
| Podcast Reasoning | v3.2.0 | Phase별 컨텍스트 주입 (GoT/ToT/CoT 분리) |
| Batch Validator | v2.3.0 | score/decision LLM hallucination 방지 보정 |
| Visualization | v1.19.0 | Titan 콘텐츠 차단 방어 + JSON 파싱 fallback |
상세 가이드:
docs/guides/PROMPT_VERSIONING.md. 버전 변경 시 settings.yaml 단일 진실 소스(SSOT)를 우선 수정한 뒤 본 문서를 동기화합니다.
처리 특성
| 항목 | 값 |
|---|---|
| 처리 방식 | 배치 처리 (TIER 0→1→2→3→4 순차/병렬) |
| 예상 응답 시간 | TIER 1 병렬 완료 기준 ~60초 이내 |
| 출력 형식 | 구조화된 팟캐스트 스크립트 + 커버 이미지 |
| 모드 | mode: Literal["podcast"] 전용 |
TIER 0 — Intent Classifier
역할: 사용자 입력 분류 + 실행 계획 수립 + 1차 위기 감지
핵심 동작:
- rule-based 키워드 감지 + LLM 분류 (Haiku APAC CRIS)
complexity_score(0.0~1.0) 산출 — Podcast Reasoning의 GoT 추론 깊이에 영향execution_plan생성 (TIER 경로 결정)risk_level,risk_score,safety_flags초기 설정 (Safety Agent가 덮어씀)- Redis 캐시 (선택적 활성화)
출력 필드: intent, risk_level, risk_score, safety_flags, execution_plan, next_step
TIER 1 — 병렬 Fan-out (asyncio)
4개 에이전트가 동시 실행. asyncio.as_completed() 방식.
Safety Agent
역할: 위험 레벨 판정 + CRISIS 선점
- 위험 레벨 L0(Safe)~L4(Emergency) 판정
- SAFETY_MESSAGES 상수로
required_in_script주입 → Script Personalizer에서 최종 출력에 삽입 - CRISIS 흐름 (PR #159 최신화):
safety_flags.status='crisis'판정 시 cancel_event 미발행. TIER 2~4는 LLM 미호출 + 하드코딩 위기 응답 폴백으로 즉시 응답.cancel_event는 TIER 1 타임아웃 전용으로만 사용됨 (workflow.py:378) next_step="crisis_response"설정 후 파이프라인 즉시 단락
출력 필드: risk_level, risk_score, safety_flags, next_step
Emotion Agent
역할: 감정 벡터 추출
valence(-1.01.0),1.0) 산출arousal(0.0AgentDataPublisher로 백엔드 저장 (emotion_logs)_build_intent_context()로 프롬프트 토큰 400~700개 절약
출력 필드: emotion_vectors
Content Analyzer
역할: 팟캐스트 주제/구조 분석
- complexity 기반 분석 깊이:
light | moderate | deep target_duration: 3~5분 범위 검증narrative_structure:personal_story | expert_qa | reflection | comparativeAgentDataPublisher로 백엔드 저장 (content_analyses)
출력 필드: content_analysis (main_theme, sub_themes, target_duration, narrative_structure, depth)
Podcast Reasoning
역할: GoT→ToT→CoT 추론으로 에피소드 구조 기획
full_threshold=0.0→ 모든 요청이 Full GoT+ToT+CoT 실행- GoT 결과를 Neo4j에 저장 (
_save_got_to_neo4j()) - MySQL 누적 그래프 업데이트 (
publish_graph_to_rdb()) - 조건부 DI 호출: complexity ≥ 0.6 → Episode Memory, complexity ≥ 0.5 → Knowledge Agent
출력 필드: reasoning_result (episode_structure, got_graph, tot_branches, selected_strategy)
독립 에이전트 (DI 패턴)
StateGraph 노드가 아닌 Podcast Reasoning이 직접 메서드 호출로 사용.
Episode Memory
- KT Cloud RAG Suite Embedding passage 엔드포인트 사용 (저장 경로)
- KT Cloud 임베딩 엔드포인트 구성 (query/passage/textgen)
- Phase별 컨텍스트 주입 — GoT/ToT/CoT 단계별로 분리하여 Podcast Reasoning 내부 phase 경로에 맞게 삽입 (PR #134)
- Pinecone 직접 HTTP API
- Pinecone 인덱스: **
rag-suite-knowledge**로 통일 (PR #153), 네임스페이스:mem_podcast_episode_{user_id} - 임계값 0.25 (PR #155, KT Cloud Query↔Passage 실측 score 0.20~0.35 반영)
- chunk_size=400, top_k=5
Knowledge Agent
- Expert RAG 5단계: expand_query → search_kb → get_docs → assess_applicability → synthesize
- Pinecone 인덱스: **
rag-suite-knowledge**로 통일 (PR #153, 단일 통합 인덱스) - DI(pinecone_client, embedding_client, db_client)
TIER 2 — Script Generator & Visualization (병렬)
Script Generator
역할: 팟캐스트 스크립트 세그먼트별 배치 생성
WORDS_PER_MINUTE=150(KBS 아나운서 기준 발화 속도)- 세그먼트 순서대로 생성 (이전 세그먼트 마지막 150자 context 주입)
- 재시도 시 validation_result의
revision_feedback주입
출력 필드: script_draft (episode_title, segments, key_insights, total_duration)
Visualization
역할: 에피소드 커버 이미지 생성
- AWS Bedrock Titan Image Generator v2 (
amazon.titan-image-generator-v2:0, us-east-1) - boto3로 S3 업로드 (
mindlog-images/vis/프리픽스) - 내부 retry loop
SKIP_VISUALIZATION=true환경변수로 건너뛰기 가능 (개발/테스트용)
출력 필드: visual_data (image_url, generation_model, status)
TIER 3 — Batch Validator
역할: 스크립트 품질 검증 + 재시도 제어
- verdict:
PASS | FAIL | CRITICAL_FAIL - action.decision:
approve | revise | escalate - FAIL 시
next_step="retry_tier2"→ Script Generator 재실행 max_retries=1(settings.yaml) 초과 시forced_pass=true로 강제 통과
출력 필드: validation_result (verdict, action, scores, forced_pass)
TIER 4 — Script Personalizer
역할: 사용자 성향에 맞게 스크립트 개인화
- rule-based: FORMALITY_REPLACEMENTS, STYLE_MAPPINGS, ATTITUDE_SETTINGS 테이블 기반 변환
- optional LLM deep:
deep_personalization: false(settings.yaml, 기본 비활성) - warning 상태 시
required_in_script문구를 final_output 말미에 삽입 - 완료 시
memory_write=True,memory_text,memory_metadata를 AgentState에 기록
출력 필드: final_output, memory_write, memory_text, memory_metadata
8종 호스트 페르소나 (PR #152)
사용자 맞춤 진행자 페르소나를 Script Personalizer에 주입합니다. 상세 정의는 config/app_config.py:121-170에 위치하며, 각 항목은 formality / attitude / keywords 세 축으로 구성됩니다.
| # | 호스트 페르소나 | formality | attitude | keywords |
|---|---|---|---|---|
| 1 | 따뜻한 공감자 | informal | empathetic | 공감, 위로, 따뜻함 |
| 2 | 이성적인 분석가 | formal | analytical | 분석, 논리, 객관 |
| 3 | 열정적인 코치 | informal | motivational | 동기부여, 열정, 실행 |
| 4 | 고요한 새벽지기 | formal | calm | 고요, 성찰, 새벽 |
| 5 | 유쾌한 팩트폭격기 | informal | direct | 팩트, 유머, 솔직 |
| 6 | 몰입형 이야기꾼 | informal | narrative | 서사, 몰입, 스토리 |
| 7 | 신뢰의 전문가 | formal | authoritative | 전문성, 신뢰, 검증 |
| 8 | 편안한 동네 친구 | informal | friendly | 편안, 일상, 친근 |
비동기 후처리 (async_post_processing)
TIER 4 완료 후 비동기 실행:
- Learning Agent: BackendClient.save(RESOURCE_LEARNING) 호출. AgentState 변경 없음.
- Episode Memory 저장:
memory_write=True이면memory_text+memory_metadata를 Pinecone에 저장.
노드 인터페이스 규칙
# 매 요청마다 새 인스턴스 생성 — 동시 요청 간 상태 격리
async def agent_node(state: AgentState) -> dict[str, Any]:
agent = SomeAgent()
return await agent.process(state)
모든 노드 함수는 이 패턴을 따름. 모듈 레벨 싱글톤 금지 (v27에서 전면 제거).
타임아웃 (settings.yaml)
| TIER | 타임아웃 |
|---|---|
| TIER 0 | 20s |
| TIER 1 (병렬) | 60s |
| TIER 2 (병렬) | 280s |
| TIER 3 | 100s |
| TIER 4 | 20s |
| async | 60s |