# Knowledge Base Tutorial

{% hint style="warning" %}
This document was prepared by the Cherry AI team in Chinese and copied here for convenience
{% endhint %}

### Add Embedding Model

1. Find the model in the model management service, you can quickly filter by clicking "Embedding Model";
2. Find the required model and add it to My Models.
3. For Parley API users, this will be text-embedding-3-large.\
   \
   ![](/files/oUtdr8umkb8jSF868CkQ)

### Create Knowledge Base

1. Knowledge Base Entry: On the left toolbar of Cherry Studio, click the knowledge base icon to enter the management page;
2. Add Knowledge Base: Click "Add" to start creating a knowledge base;
3. Name: Enter the name of the knowledge base and add an embedding model. In this case, we recommend text-embedding-3-large.

### Add Files and Vectorize

1. Add Files: Click the "Add files" button to open the file selection;
2. Select Files: Choose supported file formats, such as pdf, docx, pptx, xlsx, txt, md, mdx, etc., and open them;
3. Vectorization: The system will automatically perform vectorization. When it shows "Completed" (green ✓), it means vectorization is finished.

### Add Data from Multiple Sources

Cherry Studio supports multiple ways to add data:

1. Folder Directory: You can add an entire folder directory, and supported format files within that directory will be automatically vectorized;
2. Website Link: Supports URL links, such as [https://llm.theparley.org](< https://llm.theparley.org&#xA;>).
3. Plain Text Note: Supports entering custom content in plain text.

{% hint style="info" %}
Tips:

1. Illustrations in documents imported into the knowledge base currently do not support conversion to vectors and need to be manually converted to text;
2. Using a website as a knowledge base source may not always succeed. Some websites have strict anti-crawling mechanisms (or require login, authorization, etc.), so this method may not always obtain accurate content. It is recommended to test with a search after creation.
   {% endhint %}

### Import Past Chats from ChatGPT

{% embed url="<https://migration.theparley.org>" %}

### Search Knowledge Base

Once files and other data are vectorized, you can query them:

1. Click the "Search Knowledge Base" button at the bottom of the page;
2. Enter the query content;
3. The search results will be displayed;
4. And the matching score for each result will be shown.

### Cite Knowledge Base in Conversation to Generate Replies

1. Create a new topic. In the conversation toolbar, click "Knowledge Base," which will expand the list of created knowledge bases. Select the knowledge base you want to cite;
2. Enter and send your question, and the model will return an answer generated from the retrieval results;
3. At the same time, the cited data source will be attached below the answer, allowing quick access to the source file.


---

# Agent Instructions: 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:

```
GET https://llm.theparley.org/starting-to-use-it/knowledge-base-tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
