1.1Cắt theo cấu trúcStructure-aware chunking
Nạp & cắtIngest
Cắt theo heading, section, điều khoản — ranh giới tác giả đã đánh dấu sẵn.Split on headings, sections, clauses — boundaries the author already marked.
- Dùng choUse for
- Tài liệu có cấu trúc rõ: Markdown, HTML, hợp đồng, mã nguồn.Documents with real structure: Markdown, HTML, contracts, source code.
- ĐượcGain
- Chunk không đứt giữa ý; ngữ cảnh đến sẵn theo đơn vị ngữ nghĩa.No chunk cut mid-thought; context arrives in semantic units.
- MấtLose
- Kích thước không đều; section quá dài vẫn phải cắt tiếp.Uneven sizes; over-long sections still need a second pass.
Đổi sự đồng đều về kích thước lấy tính toàn vẹn của ý.Trades uniform size for intact meaning.
Dấu hiệu nhận biếtTell Câu trả lời cụt nửa câu, hoặc một chunk chứa hai chủ đề rời nhau.Answers stop mid-sentence, or one chunk holds two unrelated topics.
1.2Parent–childParent–child (small-to-big)
Nạp & cắtIngest
Embed chunk nhỏ để khớp, trả về section cha lớn cho LLM đọc.Embed small chunks to match, return the larger parent for the model to read.
- Dùng choUse for
- Khi khớp cần chính xác nhưng câu trả lời cần ngữ cảnh rộng hơn.When matching needs precision but the answer needs wider context.
- ĐượcGain
- Precision lúc search và đầy đủ lúc đọc, cùng lúc.Search precision and reading completeness at the same time.
- MấtLose
- Lưu hai tầng, cần logic map con→cha, prompt dài hơn.Two storage tiers, child→parent mapping, longer prompts.
Đổi độ phức tạp lưu trữ để khỏi phải chọn giữa chunk nhỏ và chunk lớn.Trades storage complexity for not having to choose small or large.
Dấu hiệu nhận biếtTell Retrieval trúng đúng chunk nhưng LLM vẫn thiếu dữ kiện để kết luận.Retrieval hits the right chunk but the model still lacks enough to conclude.
1.3Contextual retrievalContextual retrieval
Nạp & cắtIngest
Sinh sẵn một dòng ngữ cảnh gắn đầu mỗi chunk trước khi embed.Generate a short context line and prepend it to each chunk before embedding.
- Dùng choUse for
- Chunk mất tham chiếu: đại từ, “lãi suất này”, số liệu không rõ năm.Chunks that lose their referents: pronouns, “this rate”, undated figures.
- ĐượcGain
- Giảm rõ rệt tỷ lệ retrieval hụt mà không đổi kiến trúc.Measurably fewer retrieval misses with no architectural change.
- MấtLose
- Một lời gọi LLM cho mỗi chunk trong lúc index.One LLM call per chunk during indexing.
Trả chi phí một lần lúc index để mọi truy vấn về sau chính xác hơn.Pays once at index time so every later query lands better.
Dấu hiệu nhận biếtTell Đọc riêng một chunk ra thì không biết nó đang nói về cái gì.Read a chunk in isolation and you cannot tell what it refers to.
1.4Metadata & bộ lọcMetadata & filters
Nạp & cắtIngest
Lưu nguồn, ngày, phòng ban, quyền; lọc cứng ngay trong truy vấn search, không lọc sau.Store source, date, owner, permissions; filter hard inside the search query, not after it.
- Dùng choUse for
- Câu hỏi có ràng buộc cứng: thời gian, loại tài liệu, tenant, quyền truy cập.Questions with hard constraints: date, doc type, tenant, access rights.
- ĐượcGain
- Loại thẳng phần lớn corpus; là điều kiện bắt buộc để phân quyền.Eliminates most of the corpus outright; mandatory for access control.
- MấtLose
- Phải thiết kế schema từ đầu — bổ sung sau nghĩa là index lại toàn bộ.Schema must be designed up front — adding it later means a full re-index.
Công sức bỏ ra ở ngày đầu, không phải ở ngày tối ưu.The work lands on day one, not on optimisation day.
Dấu hiệu nhận biếtTell Kết quả đúng chủ đề nhưng sai năm, sai phòng ban, sai khách hàng.Results are on-topic but the wrong year, wrong team, wrong customer.