Hyungi Ahn b2306c3afd feat(ask): Phase 3.5b guardrails — verifier + telemetry + grounding 강화
Phase 3.5a(classifier+refusal gate+grounding) 위에 4개 Item 추가:

Item 0: ask_events telemetry 배선
- AskEvent ORM 모델 + record_ask_event() — ask_events INSERT 완성
- defense_layers에 input_snapshot(query, chunks, answer) 저장
- refused/normal 두 경로 모두 telemetry 호출

Item 3: evidence 간 numeric conflict detection
- 동일 단위 다른 숫자 → weak flag
- "이상/이하/초과/미만" threshold 표현 → skip (FP 방지)

Item 4: fabricated_number normalization 개선
- 단위 접미사 건/원 추가, 범위 표현(10~20%) 양쪽 추출
- bare number 2자리 이상만 (1자리 FP 제거)

Item 1: exaone semantic verifier (판단권 잠금 배선)
- verifier_service.py — 3s timeout, circuit breaker, severity 3단계
- direct_negation만 strong, numeric/intent→medium, 나머지→weak
- verifier strong 단독 refuse 금지 — grounding과 교차 필수
- 6-tier re-gate (4라운드 리뷰 확정)
- grounding strong 2+ OR max_score<0.2 → verifier skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:49:56 +09:00

hyungi_Document_Server

Self-hosted 개인 지식관리(PKM) 웹 애플리케이션

기술 스택

  • 백엔드: FastAPI + SQLAlchemy (async)
  • 데이터베이스: PostgreSQL 16 + pgvector + pg_trgm
  • 프론트엔드: SvelteKit
  • 문서 파싱: kordoc (HWP/HWPX/PDF → Markdown)
  • AI: Qwen3.5-35B-A3B (MLX), nomic-embed-text, Claude API (폴백)
  • 인프라: Docker Compose, Caddy, Synology NAS

주요 기능

  • 문서 자동 분류/태그/요약 (AI 기반)
  • 전문검색 + 벡터 유사도 검색
  • HWP/PDF/Markdown 문서 뷰어
  • 법령 변경 모니터링 (산업안전보건법 등)
  • 이메일 자동 수집 (MailPlus IMAP)
  • 일일 다이제스트
  • CalDAV 태스크 연동 (Synology Calendar)

Quick Start

git clone https://git.hyungi.net/hyungi/hyungi_document_server.git hyungi_Document_Server
cd hyungi_Document_Server

# 인증 정보 설정
cp credentials.env.example credentials.env
nano credentials.env  # 실제 값 입력

# 실행
docker compose up -d

http://localhost:8000/docs 에서 API 문서 확인

디렉토리 구조

├── app/              FastAPI 백엔드 (API, 워커, AI 클라이언트)
├── frontend/         SvelteKit 프론트엔드
├── services/kordoc/  문서 파싱 마이크로서비스 (Node.js)
├── gpu-server/       GPU 서버 배포 (AI Gateway)
├── migrations/       PostgreSQL 스키마
├── docs/             설계 문서, 배포 가이드
└── tests/            테스트 코드

인프라 구성

서버 역할
Mac mini M4 Pro Docker Compose (FastAPI, PostgreSQL, kordoc, Caddy) + MLX AI
Synology NAS 파일 원본 저장, Synology Office/Drive/Calendar/MailPlus
GPU 서버 AI Gateway, 벡터 임베딩, OCR, 리랭킹

문서

Description
No description provided
Readme 1.8 MiB
Languages
Python 58.9%
Svelte 34.4%
TypeScript 3%
HTML 1.8%
CSS 0.8%
Other 1.1%