diff --git a/doc/AI_PROMPTS_CATALOG.md b/doc/AI_PROMPTS_CATALOG.md new file mode 100644 index 0000000..1553734 --- /dev/null +++ b/doc/AI_PROMPTS_CATALOG.md @@ -0,0 +1,124 @@ +# INFINITH AI Prompts Catalog + +All AI prompts used in the marketing analysis pipeline. + +--- + +## Phase 1: discover-channels (채널 발견) + +### 1A. Firecrawl — 병원 정보 추출 +- **API**: Firecrawl JSON extraction +- **File**: `supabase/functions/discover-channels/index.ts` +``` +Extract: clinic name (Korean), clinic name (English), address, phone, +services offered, doctors with specialties, ALL social media links +(instagram handles/URLs, youtube channel URL/handle, naver blog URL, +facebook page URL, tiktok, kakao channel), business hours, slogan +``` + +### 1B. Firecrawl — 브랜딩 추출 +- **API**: Firecrawl JSON extraction +``` +Extract brand identity: primary/accent/background/text colors (hex), +heading/body fonts, logo URL, favicon URL, tagline +``` + +### 1C. Perplexity — 병원명 추출 (Firecrawl 실패 시 fallback) +- **API**: Perplexity `sonar`, temp=0.1 +- **System**: `Respond with ONLY the clinic name in Korean, nothing else.` +- **User**: `{url} 이 URL의 병원/클리닉 한국어 이름이 뭐야?` + +### 1D. Perplexity — 소셜 미디어 계정 검색 +- **API**: Perplexity `sonar`, temp=0.1 +- **System**: `You are a social media researcher. Search the web and find social media accounts. Respond ONLY with valid JSON, no explanation.` +- **User**: +``` +{clinicName} 병원의 인스타그램, 유튜브, 페이스북, 틱톡, 네이버블로그, +카카오채널 계정을 검색해서 찾아줘. 검색 결과에서 발견된 계정을 모두 알려줘. +인스타그램은 여러 계정이 있을 수 있어. + +{"instagram": ["handle1", "handle2"], "youtube": "channel URL or @handle", +"facebook": "page URL or name", "tiktok": "@handle", "naverBlog": "blog ID", +"kakao": "channel ID"} +``` + +### 1E. Perplexity — 플랫폼 등록 현황 (강남언니, 네이버, 바비톡) +- **API**: Perplexity `sonar`, temp=0.1 +- **System**: `You are a medical platform researcher. Search the web for clinic listings. Respond ONLY with valid JSON, no explanation.` +- **User**: +``` +{clinicName} 병원이 강남언니(gangnamunni.com), 네이버 플레이스, 바비톡에 +등록되어 있는지 검색해줘. URL도 찾아줘. + +{"gangnamUnni": {"registered": true, "url": "https://gangnamunni.com/hospitals/...", +"rating": 9.5}, "naverPlace": {"registered": true}, "babitok": {"registered": false}} +``` + +--- + +## Phase 2: collect-channel-data (데이터 수집) + +### 2A. Firecrawl — 강남언니 페이지 추출 +- **API**: Firecrawl JSON extraction +``` +Extract: hospital name, overall rating (out of 10), total review count, +doctors with names/ratings/review counts/specialties, procedures offered, +address, certifications/badges +``` + +### 2B. Perplexity — 경쟁사 분석 +- **System**: `You are a Korean medical marketing analyst. Always respond in Korean. Provide data in valid JSON format.` +- **User**: `{address} 근처 {services} 전문 성형외과/피부과 경쟁 병원 5곳을 분석해줘...` + +### 2C. Perplexity — 키워드 트렌드 분석 +- **User**: `한국 {services} 관련 검색 키워드 트렌드. 네이버와 구글에서 월간 검색량이 높은 키워드 20개...` + +### 2D. Perplexity — 시장 트렌드 분석 +- **User**: `한국 {services[0]} 시장 트렌드 2025-2026. 시장 규모, 성장률, 주요 트렌드...` + +### 2E. Perplexity — 타겟 오디언스 분석 +- **User**: `{clinicName}의 잠재 고객 분석. 연령대별, 성별, 관심 시술, 정보 탐색 채널...` + +--- + +## Phase 3: generate-report (리포트 생성) + +### 3A. Perplexity — V2 마케팅 리포트 (실제 데이터 기반) +- **API**: Perplexity `sonar`, temp=0.3 +- **System**: `You are a Korean medical marketing analyst. Respond ONLY with valid JSON, no markdown code blocks. Use Korean for text fields. 강남언니 rating is 10-point scale. Use ONLY the provided real data — never invent metrics.` +- **User**: (긴 프롬프트 — 실제 수집된 채널 데이터 + 시장 분석 + 브랜딩 정보를 포함하고, JSON 리포트 구조 지정) + +### 3B. Perplexity — V1 레거시 리포트 (AI 추측 기반) +- V1 호환용. URL 기반 단일 호출 플로우. + +--- + +## 기타 + +### 4A. Gemini — 마케팅 이미지 생성 +- **API**: Google Gemini `gemini-2.5-flash-image` +- **File**: `src/services/geminiImageGen.ts` +``` +Generate a premium medical marketing image for a plastic surgery clinic. +Theme: {pillarContext} // safety | expertise | results | care +Style: {channelHint} // youtube | instagram | naver_blog | tiktok | facebook +Color palette: soft purple (#7B2D8E), gold (#E8B931), warm white (#FAF8F5). +Premium, luxurious, trustworthy aesthetic. +No text or logos in the image. +``` + +--- + +## Summary + +| API | Model | Prompts | 용도 | +|-----|-------|---------|------| +| Perplexity | sonar | 11개 | 시장 분석, 채널 발견, 리포트 생성 | +| Firecrawl | JSON extraction | 6개 | 웹사이트 스크래핑, 데이터 추출 | +| Gemini | gemini-2.5-flash-image | 1개 | 마케팅 이미지 생성 | + +**핵심 원칙**: +- 모든 Perplexity 응답은 JSON only (마크다운 금지) +- V2 리포트는 실제 수집 데이터만 사용 (추측 금지) +- 강남언니 평점은 10점 만점 +- Temperature 0.1 (검색/발견) vs 0.3 (분석/생성)