> 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/quan-ly-documents-and-chunks.md).

# Quản lý Documents & Chunks

## Mục lục

·       \[Quản lý Documents]\(#quản-lý-documents)

·       \[Quản lý Chunks]\(#quản-lý-chunks)

·       \[Best Practices]\(#best-practices)

&#x20;

## Quản lý Documents

Trong trang chi tiết Knowledge Base, bạn có thể quản lý tất cả tài liệu đã upload:

### Các thao tác với Documents

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Thao tác</td><td valign="top">Mô tả</td></tr><tr><td valign="top">View</td><td valign="top">Xem danh sách tất cả tài liệu, trạng thái xử lý, và thông tin chi tiết</td></tr><tr><td valign="top">Add</td><td valign="top">Upload thêm tài liệu mới vào Knowledge Base</td></tr><tr><td valign="top">Enable / Disable</td><td valign="top">Bật/tắt tài liệu. Tài liệu bị tắt sẽ không được truy xuất nhưng vẫn được lưu</td></tr><tr><td valign="top">Archive</td><td valign="top">Lưu trữ tài liệu không còn sử dụng thường xuyên</td></tr><tr><td valign="top">Delete</td><td valign="top">Xóa vĩnh viễn tài liệu khỏi Knowledge Base</td></tr><tr><td valign="top">Re-index</td><td valign="top">Lập chỉ mục lại tài liệu khi thay đổi settings</td></tr></tbody></table>

&#x20;

### Trạng thái Document

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Trạng thái</td><td valign="top">Mô tả</td></tr><tr><td valign="top">Queuing</td><td valign="top">Đang chờ xử lý</td></tr><tr><td valign="top">Processing</td><td valign="top">Đang được chunking và indexing</td></tr><tr><td valign="top">Available</td><td valign="top">Sẵn sàng cho retrieval</td></tr><tr><td valign="top">Error</td><td valign="top">Xử lý gặp lỗi — nhấn để xem chi tiết</td></tr><tr><td valign="top">Disabled</td><td valign="top">Đã tắt — không tham gia retrieval</td></tr><tr><td valign="top">Archived</td><td valign="top">Đã lưu trữ</td></tr></tbody></table>

&#x20;

💡 TIP: Sử dụng Enable/Disable thay vì Delete khi bạn muốn tạm thời loại bỏ tài liệu khỏi retrieval. Bạn có thể bật lại bất kỳ lúc nào mà không cần upload lại.

&#x20;

## Quản lý Chunks

Nhấn vào một document để xem và quản lý các chunks:

### Các thao tác với Chunks

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Thao tác</td><td valign="top">Mô tả</td></tr><tr><td valign="top">View</td><td valign="top">Xem nội dung chi tiết của chunk</td></tr><tr><td valign="top">Edit</td><td valign="top">Chỉnh sửa nội dung chunk</td></tr><tr><td valign="top">Add</td><td valign="top">Thêm chunk mới thủ công</td></tr><tr><td valign="top">Enable / Disable</td><td valign="top">Bật/tắt chunk riêng lẻ</td></tr><tr><td valign="top">Delete</td><td valign="top">Xóa chunk</td></tr><tr><td valign="top">Add Image</td><td valign="top">Đính kèm hình ảnh vào chunk</td></tr></tbody></table>

&#x20;

### Lưu ý khi chỉnh sửa Chunks

Với Parent-Child Mode:

·       Khi chỉnh sửa parent chunk, bạn có thể chọn tạo lại (regenerate) các child chunks hoặc giữ nguyên

·       Chỉnh sửa child chunk không cập nhật parent chunk tương ứng

Giới hạn đính kèm:

·       Kích thước hình ảnh tối đa: Theo cấu hình ATTACHMENT\_IMAGE\_FILE\_SIZE\_LIMIT

·       Số file đính kèm tối đa mỗi chunk: Theo cấu hình SINGLE\_CHUNK\_ATTACHMENT\_LIMIT

⚠️ IMPORTANT: Khi chỉnh sửa chunks, nội dung mới sẽ được re-embed tự động. Tuy nhiên, hãy test retrieval sau khi chỉnh sửa để đảm bảo kết quả vẫn chính xác.

&#x20;

## Best Practices

### Kiểm tra chất lượng Chunk

Sau khi tạo Knowledge Base, hãy review các chunks để phát hiện vấn đề:

·       Chunks quá ngắn — Có thể thiếu đủ context, dẫn đến mất ý nghĩa ngữ cảnh và câu trả lời không chính xác

·       Chunks quá dài — Có thể bao gồm thông tin không liên quan, gây nhiễu ngữ nghĩa và giảm độ chính xác retrieval

·       Chunks không hoàn chỉnh ngữ nghĩa — Chunking bắt buộc cắt qua câu hoặc đoạn, dẫn đến nội dung bị thiếu hoặc sai lệch khi retrieval

### Sử dụng Child Chunks làm Retrieval Hooks

Trong Parent-Child mode, child chunks đóng vai trò "hooks" — điểm bắt retrieval, sau đó parent chunk cung cấp context đầy đủ hơn.

Các loại child chunk hiệu quả:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Loại</td><td valign="top">Ví dụ</td></tr><tr><td valign="top">Keywords</td><td valign="top">blinking light, won't turn on, red light, connection error, frozen</td></tr><tr><td valign="top">Summaries</td><td valign="top">Hướng dẫn phân tích màu LED và xử lý sự cố phần cứng</td></tr><tr><td valign="top">Queries</td><td valign="top">Đèn đỏ liên tục nghĩa là gì?</td></tr></tbody></table>

&#x20;

### Sử dụng Summary để kết nối Query-Content

Summary đặc biệt hữu ích trong các trường hợp:

·       Câu hỏi người dùng khác ngôn ngữ tài liệu: Với tài liệu kỹ thuật viết formal, thêm summary theo cách người dùng thực sự hỏi

·       Khái niệm ẩn trong chi tiết: Thêm summary mức cao surface core concepts, cho phép chunk được match mà không cần dựa vào chi tiết nhỏ

·       Nội dung không phải text: Khi chunk chủ yếu là code, bảng, log — thêm summary mô tả rõ chunk chứa gì

·       Chunks liên quan cần truy xuất cùng nhau: Áp dụng summary giống nhau cho các chunks liên quan để hỗ trợ grouped retrieval

📝 NOTE: Số lượng chunks liên quan trả về phụ thuộc vào giới hạn Top K trong retrieval settings.

&#x20;

*📖 Trước: \[External Knowledge API]\(./07-external-knowledge-api.md) · Tiếp: \[Metadata]\(./09-metadata.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/quan-ly-documents-and-chunks.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.
