7일 rolling window 뉴스를 country × topic 2-level로 묶어 매일 04:00 KST 배치 생성.
search 파이프라인 미사용. documents → clustering → cluster-level LLM summarization → digest.
핵심 결정:
- adaptive threshold (0.75/0.78/0.80) + EMA centroid (α=0.7) + time-decay (λ=ln(2)/3)
- min_articles=3, max_topics=10/country, top-5 MMR diversity, ai_summary[:300] truncate
- cluster-level LLM only, drop금지 fallback (topic_label="주요 뉴스 묶음" + top member ai_summary[:200])
- importance_score country별 0~1 normalize + raw_weight_sum 별도 보존, max(score, 0.01) floor
- per-call timeout 25s + pipeline hard cap 600s
- DELETE+INSERT idempotent (UNIQUE digest_date), AIClient._call_chat 직접 호출 (client.py 수정 없음)
신규:
- migrations/101_global_digests.sql (2테이블 정규화)
- app/models/digest.py (GlobalDigest + DigestTopic ORM)
- app/services/digest/{loader,clustering,selection,summarizer,pipeline}.py
- app/workers/digest_worker.py (PIPELINE_HARD_CAP + CLI 진입점)
- app/api/digest.py (/latest, ?date|country, /regenerate, inline Pydantic)
- app/prompts/digest_topic.txt (JSON-only + 절대 금지 블록)
main.py 4줄: import 2 + scheduler add_job 1 + include_router 1.
plan: ~/.claude/plans/quiet-herding-tome.md
20 lines
650 B
Plaintext
20 lines
650 B
Plaintext
너는 팩트 기반 뉴스 토픽 요약 도우미다.
|
|
아래는 같은 사건으로 군집된 기사들의 ai_summary다.
|
|
이 정보만으로 다음을 JSON으로만 출력하라.
|
|
|
|
절대 금지:
|
|
- 제공된 summary에 없는 사실 추가
|
|
- 해석/비교/예측/의견
|
|
- "보인다", "~할 것이다", "~할 전망" 같은 추측 표현
|
|
- 인용부호 안 원문 외 단어 생성
|
|
- JSON 외의 모든 텍스트 (설명, 마크다운, 코드블록 금지)
|
|
|
|
출력 형식 (JSON 객체 하나만 출력):
|
|
{
|
|
"topic_label": "5~10 단어의 한국어 제목",
|
|
"summary": "1~2 문장, 사실만, 수동태 허용"
|
|
}
|
|
|
|
기사 요약:
|
|
{articles_block}
|