Case study
NPAI — Nguyên Pháp AI
Hệ thống hỏi đáp tài liệu bằng RAG, kết hợp tìm kiếm ngữ nghĩa, metadata và trích dẫn nguồn.A document Q&A system combining RAG, semantic retrieval, metadata, and source citations.

Bài toánProblem
Tài liệu và tri thức chuyên môn thường nằm rải rác ở nhiều định dạng, khiến việc tìm đúng ngữ cảnh chậm và câu trả lời khó kiểm chứng. Bài toán của NPAI là tổ chức nguồn tri thức để một trợ lý AI có thể truy xuất đúng đoạn, trả lời có căn cứ và chỉ ra nguồn liên quan.Specialist knowledge is often scattered across formats, making the right context slow to find and answers hard to verify. NPAI frames the problem as organizing sources so an AI assistant can retrieve the right passage, answer with evidence, and point back to relevant material.
Cách tiếp cậnApproach
Hướng tiếp cận ưu tiên retrieval trước generation: chuẩn hóa tài liệu, chia đoạn theo cấu trúc, gắn metadata, tạo embedding và đánh giá kết quả truy xuất bằng bộ câu hỏi thực tế. Phần sinh câu trả lời chỉ dùng ngữ cảnh đã tìm được và phải thể hiện rõ khi dữ liệu chưa đủ.The approach puts retrieval before generation: normalize documents, split them by structure, attach metadata, create embeddings, and evaluate retrieval with representative questions. Answer generation is constrained to retrieved context and must state when the available evidence is insufficient.
Kiến trúcArchitecture
Luồng kiến trúc gồm lớp nạp dữ liệu, xử lý và chia đoạn, kho chỉ mục vector, bộ truy xuất, lớp điều phối prompt và giao diện hỏi đáp. Metadata về nguồn, phiên bản và phạm vi truy cập đi cùng mỗi đoạn để hỗ trợ lọc, trích dẫn và cập nhật có kiểm soát.The architecture separates ingestion, processing and chunking, vector indexing, retrieval, prompt orchestration, and the question-answer interface. Source, version, and access metadata travel with every chunk to support filtering, citations, and controlled updates.
Quy trìnhProcess
Quy trình case study bắt đầu từ việc chọn tập tài liệu mẫu và câu hỏi mục tiêu, sau đó thử nhiều chiến lược chunking, top-k và reranking. Mỗi vòng kiểm tra ghi nhận đoạn được tìm thấy, độ liên quan, phần trích dẫn và tình huống hệ thống nên từ chối trả lời.The case-study workflow begins with a representative document set and target questions, then compares chunking, top-k, and reranking strategies. Each test records the retrieved passages, relevance, citation coverage, and cases where the system should decline to answer.
Kết quảResults
Case study hoàn thiện kiến trúc, luồng dữ liệu và checklist đánh giá cho hệ thống RAG. Bộ deliverable kết nối rõ nguồn dữ liệu, chiến lược retrieval, trích dẫn và tiêu chí từ chối khi bằng chứng không đủ.The completed case study delivers the architecture, data flow, and evaluation checklist for a RAG system, connecting source data, retrieval strategy, citations, and refusal criteria when evidence is insufficient.
Bài họcLessons learned
Chất lượng RAG phụ thuộc nhiều vào dữ liệu, metadata và phép đo retrieval hơn là độ dài prompt. Trích dẫn, phân quyền và cơ chế nói “không đủ dữ liệu” cần được thiết kế ngay từ đầu, không phải bổ sung ở cuối.RAG quality depends more on data, metadata, and retrieval measurement than on prompt length. Citations, access control, and an explicit insufficient-evidence path should be designed from the start rather than added later.