> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/en-us/knowledge-base/sources.md).

# Add and Organize Materials

The knowledge base supports files, Cherry Studio notes, local directories, and individual webpage URLs. After import, you still need to check the processing status, full text, and chunks, and reindex when the source material is updated.

{% hint style="info" %}
The completion standard is not “the file appears in the list,” but whether the material can be read, the chunks are complete, and real questions can retrieve the correct source.
{% endhint %}

## Choose the right entry point

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FR2au2DTUF3rsKPa4GtmN%2Fclipboard.png?alt=media&amp;token=fa5fe0e5-075b-4fe6-93f0-a7f4584b1777" alt="知识库中的文件、笔记、目录和链接四种资料入口"><figcaption><p>Choose the entry point based on the source: use [File] for a small number of files, [Directory] for a collection of similar files, [Notes] for Cherry Studio content, and [Link] for public webpages.</p></figcaption></figure>

| Entry point | What kind of materials it suits             | After import relationships                                      | Main notes                                                                |
| ----------- | ------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------- |
| File        | PDF, Office, Markdown, text, etc.           | Save a hosted copy                                              | Up to 20 items can be selected at once                                    |
| Notes       | Content already organized in Cherry Studio  | A snapshot of the content at the time of import                 | Later changes to the original note will not be synced automatically       |
| Directory   | A batch of local files under the same topic | Create knowledge entries based on the contents of the directory | Do not import an unrelated directory as a whole                           |
| Link        | A single publicly accessible webpage        | Save a snapshot of the webpage when it is crawled               | Login pages, script-rendered pages, or restricted pages may be incomplete |

{% hint style="warning" %}
Supported files include PDF, DOCX, DOC, PPTX, XLSX, XLS, MD, TXT, CSV, HTML, and EPUB. Scanned PDFs or image-based content also need OCR verification.
{% endhint %}

## Add and verify material

{% stepper %}
{% step %}

### 1. Select the source of the material

Open the knowledge base, click the Add Material button, and choose \[File], \[Notes], \[Directory], or \[Link].
{% endstep %}

{% step %}

### 2. Confirm the selected content

Files and notes can be selected in batches; up to 20 items can be added interactively at a time. If you have more material, add it in batches or use the directory entry.
{% endstep %}

{% step %}

### 3. Handle same-name conflicts

When new material has the same name as an existing entry, choose \[Keep All] or \[Replace]. When updating policies, manuals, and note snapshots, \[Replace] is usually the better choice.

{% hint style="warning" %}
Choosing \[Keep All] makes both the new and old content participate in retrieval. Do this only when you truly need to query different versions in parallel, and indicate the date or version in the name.
{% endhint %}
{% endstep %}

{% step %}

### 4. Wait for processing to complete

The material will go through stages such as copying, reading, splitting, and indexing. If no embedding model is configured, vectors will not be built, but keyword indexing will still be created.

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FoYCk8ddQNgaZxNQ65As2%2Fclipboard.png?alt=media&amp;token=6a24e9c5-3456-492b-bf99-fc7cd426cf30" alt="包含多条已处理资料的员工差旅制度知识库"><figcaption><p>After the material becomes available, spot-check the full text and chunks.</p></figcaption></figure>
{% endstep %}

{% step %}

### 5. Spot-check the full text and chunks

Open the material to view the full text, or view the chunks from the material row menu. Focus on whether the title order, tables, OCR text, and key sentences have been split incorrectly.
{% endstep %}

{% step %}

### 6. Complete retrieval testing

Use a question with a clear answer to check the correct source and excerpt. After the material is updated, test again with the same set of questions.

<figure><img src="https://1658303467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2Fr2mSvzxjXSvwuT0gGIf6%2Fclipboard.png?alt=media&amp;token=87900ecb-c890-4894-9891-905a4caad74c" alt="召回测试中的来源、相关度、片段内容和排序"><figcaption><p>Final acceptance should evaluate the source, completeness of excerpts, and ranking—not just whether results are returned.</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Material status and handling methods

| Phenomenon                            | Possible cause                                                            | Handling method                                                    |
| ------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Processing for a long time            | The file is large, or the parser or model is unavailable                  | Check the original file, document processing, and embedding model  |
| Error displayed                       | Copying, reading, splitting, or indexing failed                           | Open the error message and handle it according to the failed stage |
| Missing or garbled full text          | The file processor is not suitable, or scanned content has not been OCRed | Change the document processing method or configure OCR             |
| Chunk missing key sentences           | The chunk boundaries are not appropriate                                  | Adjust the chunks and then perform \[Reindex]                      |
| Both old and new versions are matched | \[Keep All] was selected for materials with the same name                 | Delete the old entry, or re-import and choose \[Replace]           |

## Reindex and delete

After splitting, parser, or embedding settings change, old entries will not automatically adopt the new settings. Use \[Reindex] for a single material, or select materials in batches and then reindex.

{% hint style="danger" %}
Deleting an entry removes the hosted copy and index in the current knowledge base. It does not delete the original file or original note, but you should still confirm whether the knowledge base has the only copy before deleting.
{% endhint %}

## Configuration notes

| Configuration item            | Product default               | Recommended starting point                           | Function                                                           | Applicable scenario                                                    | Notes                                                         |
| ----------------------------- | ----------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------- |
| Number of items added at once | Up to 20 items                | First add a small number of representative materials | Control the scale of each import                                   | When building the knowledge base for the first time or troubleshooting | Verify parsing and retrieval before importing large batches   |
| Handling same name            | Choose when a conflict occurs | When updating material, prefer \[Replace]            | Decide whether new and old entries coexist                         | Policy, manual, and note updates                                       | \[Keep All] may allow old content to participate in retrieval |
| Reindex                       | Manually run                  | Run after settings change                            | Let old materials use the new parsing, chunking, or model settings | Tune or fix materials                                                  | After completion, you must run retrieval tests again          |

## User case

Xiaolin updates the business travel policy every month. He imports the new file with the same name and chooses \[Replace]. After the material finishes processing, he spot-checks the full text and chunks, then uses fixed questions to test the accommodation, transportation, and approval rules.

The completion standard is: old rules no longer appear in retrieval results, and the conditions and amounts of the new rules can be matched reliably.

## FAQ

<details>

<summary>If I modify the original note, will the knowledge base update automatically?</summary>

No. Notes are imported as a snapshot of the content at that time. After editing, you need to add it again and choose \[Replace], or perform \[Reindex] on the corresponding material.

</details>

<details>

<summary>Why does the webpage only capture part of the content?</summary>

Webpages that require login, rely on script rendering, or have access restrictions may not be fully captured. You can save the full text using files or notes first, then import it.

</details>

<details>

<summary>Does deleting a knowledge base entry delete the original file?</summary>

It will not delete the original file or original note, but it will remove the hosted copy and index in the knowledge base.

</details>

## Continue reading

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Document parsing and OCR</strong></td><td>Handle missing body text, garbled text, and scanned content.</td><td><a href="/docs/en-us/knowledge-base/document-preprocessing.md">Document Parsing and OCR</a></td></tr><tr><td><strong>Check materials and recall</strong></td><td>Verify retrieval quality with fixed questions.</td><td><a href="/docs/en-us/knowledge-base/recall-test.md">Check Materials and Retrieval</a></td></tr><tr><td><strong>Data, privacy, and maintenance</strong></td><td>Understand backup, deletion, and service boundaries.</td><td><a href="/docs/en-us/knowledge-base/data.md">Data, Privacy, and Maintenance</a></td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cherryai.com.cn/docs/en-us/knowledge-base/sources.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
