This paper presents the design and implementation of a Retrieval-Augmented Generation (RAG)-based AI chatbot system tailored for defense knowledge management, addressing the critical hallucination problem of Large Language Models (LLMs) in high-accuracy domains. The system is deployed on an on-premise, Docker-based microservice architecture to ensure full operational independence within a closed defense network. Milvus is adopted as the vector database with a Flat index and L2 metric to prioritize retrieval accuracy, complemented by a hybrid search strategy combining BM25-based sparse retrieval and dense semantic retrieval to enhance matching of domain-specific military terminology. Qwen-2.5-14B-Instruct-Q8 is selected as the generation model after comparative evaluation, with ko-sbert-nli providing Korean-specialized embeddings and LangChain orchestrating the end-to-end pipeline. Experiments on 100 defense PDF documents confirm millisecond-level retrieval latency and effective hallucination suppression, validating the system's practical applicability and its potential generalization to other precision-critical domains such as law and medicine.
한국어
본 논문은 거대언어모델(LLM)의 환각(Hallucination) 문제를 해결하기 위해 국방출판지원단의 약 4만 4천 건 이상의 국방 지식 데이터를 기반으로 한 검색 증강 생성(RAG) AI 챗봇 시스템의 설계 및 구현을 제안한다. 시스템은 Docker 컨테이너 기 반 온프레미스 환경으로 구성되며, 벡터 데이터베이스 Milvus에 Flat 인덱스와 L2 메트릭을 적용하여 검색 정확도를 극대화하 였다. 또한 BM25 기반 희소 검색과 의미 기반 밀집 검색을 결합한 하이브리드 검색을 통해 군 전문 용어에 대한 매칭 성능을 강화하였으며, 언어 모델로는 비교 실험을 통해 Qwen-2.5-14B-Instruct-Q8을 최종 채택하였다. 실험 결과, 6ms 수준의 검색 속도와 효과적인 환각 억제 성능을 확인하였으며, 본 연구의 아키텍처는 법률·의료 등 정확성이 중시되는 타 특수 도메인으로 의 확장 가능성을 제시한다.
목차
요약 ABSTRACT 1. 서론 2. 관련 연구 2.1 거대언어모델 2.2 검색 증강 생성(RAG) 2.3 벡터 데이터베이스: Milvus 2.4 LangChain 프레임워크 3. 연구 방법 및 내용 3.1 시스템 아키텍처 3.2 데이터 수집 및 전처리 3.3 벡터 DB 및 하이브리드 검색 구현 4. 실험 내용 및 분석 4.1 실험 환경 및 데이터셋 4.2 검색 알고리즘 성능 비교 및 분석 4.3 언어 모델별 답변 품질 비교 분석 5. 결론 참고문헌