> For the complete documentation index, see [llms.txt](https://docs.clickai.vn/clickai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clickai.vn/clickai-docs/co-so-du-lieu/index-method-and-retrieval-settings.md).

# Index Method & Retrieval Settings

## Mục lục

·       \[Chọn Index Method]\(#chọn-index-method)

·       \[Cấu hình Retrieval Settings]\(#cấu-hình-retrieval-settings)

·       \[Q\&A Mode]\(#qa-mode)

&#x20;

## Chọn Index Method

ClickAI cung cấp 2 phương pháp lập chỉ mục:

### High Quality (Chất lượng cao)

·       Gọi Embedding Model để tạo vector cho mỗi chunk

·       Cho phép tìm kiếm semantic (dựa trên ý nghĩa ngữ cảnh)

·       Ưu điểm: Độ chính xác cao hơn, hiểu ngữ cảnh tốt hơn

·       Nhược điểm: Tốn token embedding, thời gian xử lý lâu hơn

### Economical (Tiết kiệm)

·       Sử dụng keyword indexing (inverted index) — kỹ thuật tìm kiếm tiêu chuẩn

·       Không cần embedding model, không tốn token

·       Ưu điểm: Nhanh, không tốn chi phí embedding

·       Nhược điểm: Chỉ khớp từ khóa, không hiểu ngữ cảnh

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Tiêu chí</td><td valign="top">High Quality</td><td valign="top">Economical</td></tr><tr><td valign="top">Công nghệ</td><td valign="top">Embedding vectors + keyword</td><td valign="top">Keyword indexing (inverted index)</td></tr><tr><td valign="top">Độ chính xác</td><td valign="top">Cao</td><td valign="top">Trung bình</td></tr><tr><td valign="top">Chi phí token</td><td valign="top">Có (embedding)</td><td valign="top">Không</td></tr><tr><td valign="top">Thời gian xử lý</td><td valign="top">Lâu hơn</td><td valign="top">Nhanh hơn</td></tr><tr><td valign="top">Tìm kiếm ngữ nghĩa</td><td valign="top">✅</td><td valign="top">❌</td></tr><tr><td valign="top">Tìm kiếm đa ngôn ngữ</td><td valign="top">✅</td><td valign="top">❌</td></tr></tbody></table>

&#x20;

💡 TIP: Nếu bạn cần chatbot trả lời chính xác cao hoặc xử lý nội dung đa ngôn ngữ, hãy chọn \*\*High Quality\*\*. Nếu ưu tiên tốc độ và tiết kiệm chi phí, chọn \*\*Economical\*\*.

&#x20;

## Cấu hình Retrieval Settings

Hệ thống Knowledge Base hỗ trợ 2 kỹ thuật retrieval cốt lõi:

1\.     Semantic Retrieval: Dựa trên vector similarity — chunks và câu hỏi được chuyển thành vectors và khớp thông qua similarity scoring.

2\.     Keyword Matching: Sử dụng inverted index (kỹ thuật search engine tiêu chuẩn).

### Weight Settings (Cấu hình trọng số)

Tính năng này cho phép bạn thiết lập trọng số tùy chỉnh giữa semantic priority và keyword priority:

#### Semantic Value = 1 (Chỉ Semantic Search)

·       Chỉ kích hoạt chế độ tìm kiếm semantic

·       Sử dụng embedding models để tìm kiếm sâu hơn — kể cả khi thuật ngữ chính xác không xuất hiện trong knowledge base

·       Tính khoảng cách vector để trả về nội dung liên quan

·       Hỗ trợ tốt nội dung đa ngôn ngữ — bắt được ý nghĩa qua các ngôn ngữ khác nhau

#### Keyword Value = 1 (Chỉ Keyword Search)

·       Chỉ kích hoạt chế độ tìm kiếm từ khóa

·       Thực hiện full-text match trong knowledge base

·       Phù hợp khi người dùng biết chính xác thuật ngữ cần tìm

·       Tiêu thụ ít tài nguyên hơn, lý tưởng cho tìm kiếm nhanh trong kho tài liệu lớn

#### Custom Keyword và Semantic Weights

Ngoài việc chỉ bật semantic hoặc keyword search riêng lẻ, ClickAI cung cấp cài đặt trọng số linh hoạt:

·       Điều chỉnh liên tục trọng số hai phương pháp

·       Xác định tỷ lệ trọng số tối ưu phù hợp với kịch bản kinh doanh cụ thể

### Rerank Model

·       Mặc định tắt. Khi bật, model Rerank bên thứ ba sẽ sắp xếp lại các chunks được trả về để tối ưu kết quả

·       Giúp LLM truy cập thông tin chính xác hơn, cải thiện chất lượng output

·       Trước khi bật, vào Settings > Model Providers để cấu hình API key cho Rerank model

⚠️ IMPORTANT: Nếu embedding model đã chọn là multimodal, hãy chọn rerank model multimodal tương ứng (có biểu tượng Vision). Nếu không, hình ảnh đã truy xuất sẽ bị loại khỏi reranking.

📝 NOTE: Bật Rerank sẽ tiêu thụ token từ Rerank model. Tham khảo trang pricing của model tương ứng để biết chi tiết.

### TopK và Score Threshold

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Setting</td><td valign="top">Mô tả</td><td valign="top">Giá trị mặc định</td><td valign="top">Khuyến nghị</td></tr><tr><td valign="top">Top K</td><td valign="top">Số chunks tương tự nhất được truy xuất</td><td valign="top">3</td><td valign="top">3-5</td></tr><tr><td valign="top">Score Threshold</td><td valign="top">Điểm similarity tối thiểu để chunk được truy xuất</td><td valign="top">0.5</td><td valign="top">0.5-0.7</td></tr></tbody></table>

&#x20;

·       Top K cao hơn → truy xuất nhiều chunks hơn, nhưng có thể bao gồm nội dung ít liên quan

·       Score Threshold cao hơn → yêu cầu similarity cao hơn, ít chunks được trả về nhưng chính xác hơn

&#x20;

## Q\&A Mode

Q\&A Mode là tùy chọn đặc biệt cho phép ClickAI tự động phân tích tài liệu và tạo cặp câu hỏi-trả lời. Phù hợp cho:

·       Tài liệu FAQ

·       Tài liệu hỗ trợ khách hàng

·       Tài liệu có cấu trúc Q\&A rõ ràng

&#x20;

*📖 Trước: \[Chunk Settings]\(./03-chunk-settings.md) · Tiếp: \[Knowledge Pipeline]\(./05-knowledge-pipeline.md)*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clickai.vn/clickai-docs/co-so-du-lieu/index-method-and-retrieval-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
