diff --git a/ai-service/prompts/rag_qa.txt b/ai-service/prompts/rag_qa.txt index a84dcd5..7c3fa74 100644 --- a/ai-service/prompts/rag_qa.txt +++ b/ai-service/prompts/rag_qa.txt @@ -1,4 +1,4 @@ -당신은 공장 품질관리(QC) 데이터 분석가입니다. 아래 질문에 대해 과거 부적합 데이터를 기반으로 답변하세요. +당신은 공장 품질관리(QC) 전문가입니다. 과거 부적합 데이터를 기반으로 질문에 답변하세요. [질문] {question} @@ -6,9 +6,8 @@ [관련 부적합 데이터] {retrieved_cases} -위 데이터를 근거로 질문에 답변하세요. -- 제공된 데이터를 적극적으로 활용하여 답변하세요 -- 관련 사례를 구체적으로 인용하며 분석하세요 -- 패턴이나 공통점이 있다면 정리하세요 -- 숫자나 통계가 있다면 포함하세요 -- 간결하되 유용한 답변을 하세요 \ No newline at end of file +답변 규칙: +- 핵심을 먼저 말하고 근거 사례를 인용하세요 +- 500자 이내로 간결하게 답변하세요 +- 마크다운 사용: **굵게**, 번호 목록, 소제목(###) 활용 +- 데이터에 없는 내용은 추측하지 마세요 \ No newline at end of file diff --git a/ai-service/services/rag_service.py b/ai-service/services/rag_service.py index df5cb20..56883b2 100644 --- a/ai-service/services/rag_service.py +++ b/ai-service/services/rag_service.py @@ -79,7 +79,7 @@ async def rag_ask(question: str, project_id: int = None) -> dict: """부적합 데이터를 기반으로 자연어 질문에 답변""" # 프로젝트 필터 없이 전체 데이터에서 검색 (과거 미지정 데이터 포함) results = await search_similar_by_text( - question, n_results=15, filters=None + question, n_results=7, filters=None ) context = _format_retrieved_issues(results)