diff --git a/skills/companyx-rag/SKILL.md b/skills/companyx-rag/SKILL.md index c2e0074..8fbd532 100644 --- a/skills/companyx-rag/SKILL.md +++ b/skills/companyx-rag/SKILL.md @@ -9,9 +9,12 @@ Use this skill only for Company X users and only when the answer should be groun ## Trigger -- The user is authenticated as a Company X member. -- The question asks for `근거`, `내부 문서`, `자료 기준`, `문서 기준`, or similar evidence-first phrasing. -- The topic is a Company X internal program, partner, MOU, proposal, or operational fact. +- The user is authenticated as a Company X member (`team_id == COMPANYX_TEAM_ID`). +- AND the question matches one of the following: + - Intent markers: `근거`, `내부 문서`, `내부 자료`, `자료 기준`, `문서 기준`, `문서 확인해줘`, `근거 확인해줘`, `협력`, `MOU`, `계약서`, `투자조합`, `사업계획서`, `정관`, `재무제표`, `재무상태표`, `손익계산서`, `고유번호증`, `서면의결서`, `추천서`, `공문`, `협약`, `소집통지`, `주주총회`, `정기주총`, `결산`, `감사`, `보고서`, `규약`, `인감`, `등기`, `사업자등록`, `팁스`, `TIPS`, `립스`, `LIPS` + - Domain markers: `오늘전통`, `옐로펀치`, `yellowpunch`, `x-course`, `컴퍼니엑스`, `company x`, `companyx` +- If neither marker matches, the question goes to the normal skill pipeline (calendar, email, news, etc.). +- Note: `team_id` alone does NOT trigger grounding. This prevents general queries from being misrouted to document search. (260323 rollback of P1-5, all agents agreed.) ## Do diff --git a/workflow/03_rag/companyx_grounding_pipeline.md b/workflow/03_rag/companyx_grounding_pipeline.md index ebf4bf4..280b528 100644 --- a/workflow/03_rag/companyx_grounding_pipeline.md +++ b/workflow/03_rag/companyx_grounding_pipeline.md @@ -1,7 +1,7 @@ --- tags: [workflow, rag, companyx, grounding, answer] type: workflow -last_updated: 2026-03-22 +last_updated: 2026-03-23 --- # Company X Grounding 파이프라인 @@ -29,7 +29,7 @@ last_updated: 2026-03-22 - 근거 부족 시 명시적 실패 응답 ## 처리 순서 -1. `team_id == COMPANYX_TEAM_ID`이면 grounding 경로로 진입한다. 마커 체크 없이 team_id 기반으로 판단한다. +1. `team_id == COMPANYX_TEAM_ID`이고 질문이 마커(intent/domain)에 매칭되면 grounding 경로로 진입한다. team_id만으로는 진입하지 않는다. 마커 미매칭 시 일반 스킬 경로(캘린더/이메일/뉴스 등)로 fallback한다. (260323 P1-5 롤백, 전원 동의) 2. 질문 유형을 분류한다 (설명형/사실확인형/수치확인형/재정리형). 3. 멀티쿼리를 생성한다 (`_build_query_candidates()`, 7~9개 변형). 4. 하이브리드 검색(벡터+키워드 RRF, search_mode=hybrid)으로 상위 결과를 수집한다. @@ -50,7 +50,7 @@ last_updated: 2026-03-22 - 근거 선별 책임은 LLM에 있으며, 코드 레벨에서는 점수 상위 결과를 문서 다양성 기준으로 선택만 한다. ## 실패 분기 -- 검색 결과가 0건이면 `문서 없음`으로 실패한다. +- 검색 결과가 0건이면 `try_companyx_grounding()`이 `None`을 반환하고, `message_service`가 일반 의도 분류 경로로 fallback한다. (260323 fallback 복구) - LLM이 컨텍스트만으로 답변 불가로 판단하면 `failure_reason`을 채우고, 성공처럼 반환하지 않는다. - 수치형 질문에서 값이 없으면 추정하지 않는다. - 내부 규정이나 최신 집계가 없으면 `문서 없음`, `미확인`, `불일치` 중 하나로 명시한다.