feat: 법령 크로스 링크 2-pass + launchd 등록 + RAG thinking 필터

- law_monitor.py: 2-pass 크로스 링크 적용
  - Pass 1: 전체 법령 파싱 + 조문-장 매핑 테이블 생성
  - Pass 2: 「법령명」 제X조 → [[법명_제N장#제X조]] wiki-link 일괄 적용
  - 변경된 법령에만 크로스 링크 적용 후 DEVONthink 임포트
- pkm_api_server.py: RAG 응답에 enable_thinking=false + strip_thinking 적용
- launchd: pkm-api(Flask), law-monitor(07:00), mailplus(07:00+18:00), digest(20:00) plist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hyungi
2026-03-30 15:28:36 +09:00
parent c79e26e822
commit a4f8e56633
3 changed files with 77 additions and 5 deletions

View File

@@ -252,16 +252,19 @@ def _search_qdrant(vector: list[float], limit: int = 20) -> list[dict]:
def _llm_generate(prompt: str) -> str:
"""Mac Mini MLX로 답변 생성"""
"""Mac Mini MLX로 답변 생성 (thinking 필터링 포함)"""
import requests as req
from pkm_utils import strip_thinking
resp = req.post("http://localhost:8800/v1/chat/completions", json={
"model": "mlx-community/Qwen3.5-35B-A3B-4bit",
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.3,
"max_tokens": 2048,
"enable_thinking": False,
}, timeout=120)
resp.raise_for_status()
return resp.json()["choices"][0]["message"]["content"]
content = resp.json()["choices"][0]["message"]["content"]
return strip_thinking(content)
@app.route('/rag/query', methods=['POST'])