Skip to content

Commit a550b59

Browse files
infinityCuratorRAGFlow Curator
andauthored
Synchronize documentation. (#291)
Co-authored-by: RAGFlow Curator <infinitydocs.curator@users.noreply.github.com>
1 parent 9f79102 commit a550b59

14 files changed

+164
-37
lines changed

website/docs/faq.mdx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,26 @@ See [Upgrade RAGFlow](./guides/upgrade_ragflow.mdx) for more information.
443443

444444
To switch your document engine from Elasticsearch to [Infinity](https://github.com/infiniflow/infinity):
445445

446-
1. In **docker/.env**, set `DOC_ENGINE=${DOC_ENGINE:-infinity}`
447-
2. Restart your Docker image:
446+
1. Stop all running containers:
448447

449-
```bash
450-
$ docker compose -f docker-compose.yml up -d
451-
```
448+
```bash
449+
$ docker compose -f docker/docker-compose.yml down -v
450+
```
451+
:::caution WARNING
452+
`-v` will delete all Docker container volumes, and the existing data will be cleared.
453+
:::
454+
455+
2. In **docker/.env**, set `DOC_ENGINE=${DOC_ENGINE:-infinity}`
456+
3. Restart your Docker image:
457+
458+
```bash
459+
$ docker compose -f docker-compose.yml up -d
460+
```
461+
462+
---
452463

453464
### Where are my uploaded files stored in RAGFlow's image?
454465

455466
All uploaded files are stored in Minio, RAGFlow's object storage solution. For instance, if you upload your file directly to a knowledge base, it is located at `<knowledgebase_id>/filename`.
467+
468+
---

website/docs/guides/agent/agent_component_reference/begin.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ You can set global variables within the **Begin** component, which can be either
4848

4949
:::tip NOTE
5050
To pass in parameters from a client, call:
51-
- HTTP method [Converse with agent](../../references/http_api_reference.md#converse-with-agent), or
52-
- Python method [Converse with agent](../../referencespython_api_reference.md#converse-with-agent).
51+
- HTTP method [Converse with agent](../../../references/http_api_reference.md#converse-with-agent), or
52+
- Python method [Converse with agent](../../../referencespython_api_reference.md#converse-with-agent).
5353
:::
5454

5555
:::danger IMPORTANT

website/docs/guides/chat/accelerate_question_answering.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Please note that some of your settings may consume a significant amount of time.
2020
Please note that rerank models are essential in certain scenarios. There is always a trade-off between speed and performance; you must weigh the pros against cons for your specific case.
2121
:::
2222

23-
- In the **Assistant Setting** tab of your **Chat Configuration** dialogue, disabling **Keyword analysis** will reduce the time to receive an answer from the LLM.
23+
- In the **Assistant settings** tab of your **Chat Configuration** dialogue, disabling **Keyword analysis** will reduce the time to receive an answer from the LLM.
2424
- When chatting with your chat assistant, click the light bulb icon above the *current* dialogue and scroll down the popup window to view the time taken for each task:
2525
![enlighten](https://github.com/user-attachments/assets/fedfa2ee-21a7-451b-be66-20125619923c)
2626

website/docs/guides/chat/implement_deep_research.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ From v0.17.0 onward, RAGFlow supports integrating agentic reasoning in an AI cha
1515

1616
To activate this feature:
1717

18-
1. Enable the **Reasoning** toggle under the **Prompt Engine** tab of your chat assistant dialogue.
18+
1. Enable the **Reasoning** toggle under the **Prompt engine** tab of your chat assistant dialogue.
1919

2020
![Image](https://github.com/user-attachments/assets/4a1968d0-0128-4371-879f-77f3a70197f5)
2121

22-
2. Enter the correct Tavily API key under the **Assistant Setting** tab of your chat assistant dialogue to leverage Tavily-based web search
22+
2. Enter the correct Tavily API key under the **Assistant settings** tab of your chat assistant dialogue to leverage Tavily-based web search
2323

2424
![Image](https://github.com/user-attachments/assets/e8787532-7e72-49ef-8951-169ae544512f)
2525

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
sidebar_position: 4
3+
slug: /set_chat_variables
4+
---
5+
6+
# Set variables
7+
8+
Set variables to be used together with the system prompt for your LLM.
9+
10+
---
11+
12+
When configuring the system prompt for a chat model, variables play an important role in enhancing flexibility and reusability. With variables, you can dynamically adjust the system prompt to be sent to your model. In the context of RAGFlow, if you have defined variables in the **Chat Configuration** dialogue, except for the system's reserved variable `{knowledge}`, you are required to pass in values for them from RAGFlow's [HTTP API](../../references/http_api_reference.md#converse-with-chat-assistant) or through its [Python SDK](../../references/python_api_reference.md#converse-with-chat-assistant).
13+
14+
:::danger IMPORTANT
15+
In RAGFlow, variables are closely linked with the system prompt. When you add a variable in the **Variable** section, include it in the system prompt. Conversely, when deleting a variable, ensure it is removed from the system prompt; otherwise, an error would occur.
16+
:::
17+
18+
## Where to set variables
19+
20+
Hover your mouse over your chat assistant, click **Edit** to open its **Chat Configuration** dialogue, then click the **Prompt Engine** tab. Here, you can work on your variables in the **System prompt** field and the **Variable** section:
21+
22+
![set_variables](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/prompt_engine.jpg)
23+
24+
## 1. Manage variables
25+
26+
In the **Variable** section, you add, remove, or update variables.
27+
28+
### `{knowledge}` - a reserved variable
29+
30+
`{knowledge}` is the system's reserved variable, representing the chunks retrieved from the knowledge base(s) specified by **Knowledge bases** under the **Assistant settings** tab. If your chat assistant is associated with certain knowledge bases, you can keep it as is.
31+
32+
:::info NOTE
33+
It does not currently make a difference whether you set `{knowledge}` to optional or mandatory, but note that this design will be updated at a later point.
34+
:::
35+
36+
From v0.17.0 onward, you can start an AI chat without specifying knowledge bases. In this case, we recommend removing the `{knowledge}` variable to prevent unnecessary references and keeping the **Empty response** field empty to avoid errors.
37+
38+
### Custom variables
39+
40+
Besides `{knowledge}`, you can also define your own variables to pair with the system prompt. To use these custom variables, you must pass in their values through RAGFlow's official APIs. The **Optional** toggle determines whether these variables are required in the corresponding APIs:
41+
42+
- **Disabled** (Default): The variable is mandatory and must be provided.
43+
- **Enabled**: The variable is optional and can be omitted if not needed.
44+
45+
46+
47+
## 2. Update system prompt
48+
49+
After you add or remove variables in the **Variable** section, ensure your changes are reflected in the system prompt to avoid inconsistencies and errors. Here's an example:
50+
51+
```
52+
You are an intelligent assistant. Please answer the question by summarizing chunks from the specified knowledge base(s)...
53+
54+
Your answers should follow a professional and {style} style.
55+
56+
Here is the knowledge base:
57+
{knowledge}
58+
The above is the knowledge base.
59+
```
60+
61+
:::tip NOTE
62+
If you have removed `{knowledge}`, ensure that you thoroughly review and update the entire system prompt to achieve optimal results.
63+
:::
64+
65+
## APIs
66+
67+
The *only* way to pass in values for the custom variables defined in the **Chat Configuration** dialogue is to call RAGFlow's [HTTP API](../../references/http_api_reference.md#converse-with-chat-assistant) or through its [Python SDK](../../references/python_api_reference.md#converse-with-chat-assistant).
68+
69+
### HTTP API
70+
71+
See [Converse with chat assistant](../../references/http_api_reference.md#converse-with-chat-assistant). Here's an example:
72+
73+
```json {9}
74+
curl --request POST \
75+
--url http://{address}/api/v1/chats/{chat_id}/completions \
76+
--header 'Content-Type: application/json' \
77+
--header 'Authorization: Bearer <YOUR_API_KEY>' \
78+
--data-binary '
79+
{
80+
"question": "xxxxxxxxx",
81+
"stream": true,
82+
"style":"hilarious"
83+
}'
84+
```
85+
86+
### Python API
87+
88+
See [Converse with chat assistant](../../references/python_api_reference.md#converse-with-chat-assistant). Here's an example:
89+
90+
```python {18}
91+
from ragflow_sdk import RAGFlow
92+
93+
rag_object = RAGFlow(api_key="<YOUR_API_KEY>", base_url="http://<YOUR_BASE_URL>:9380")
94+
assistant = rag_object.list_chats(name="Miss R")
95+
assistant = assistant[0]
96+
session = assistant.create_session()
97+
98+
print("\n==================== Miss R =====================\n")
99+
print("Hello. What can I do for you?")
100+
101+
while True:
102+
question = input("\n==================== User =====================\n> ")
103+
style = input("Please enter your preferred style (e.g., formal, informal, hilarious): ")
104+
105+
print("\n==================== Miss R =====================\n")
106+
107+
cont = ""
108+
for ans in session.ask(question, stream=True, style=style):
109+
print(ans.content[len(cont):], end='', flush=True)
110+
cont = ans.content
111+
```
112+

website/docs/guides/chat/start_chat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You start an AI conversation by creating an assistant.
1919

2020
> RAGFlow offers you the flexibility of choosing a different chat model for each dialogue, while allowing you to set the default models in **System Model Settings**.
2121
22-
2. Update **Assistant Setting**:
22+
2. Update **Assistant Settings**:
2323

2424
- **Assistant name** is the name of your chat assistant. Each assistant corresponds to a dialogue with a unique combination of knowledge bases, prompts, hybrid search configurations, and large model settings.
2525
- **Empty response**:

website/docs/guides/dataset/construct_knowledge_graph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ In a knowledge graph, a community is a cluster of entities linked by relationshi
7070
3. Click **Knowledge graph** to view the details of the generated graph.
7171
4. To use the created knowledge graph, do either of the following:
7272

73-
- In your **Chat Configuration** dialogue, click the **Assistant Setting** tab to add the corresponding knowledge base(s) and click the **Prompt Engine** tab to switch on the **Use knowledge graph** toggle.
73+
- In your **Chat Configuration** dialogue, click the **Assistant settings** tab to add the corresponding knowledge base(s) and click the **Prompt engine** tab to switch on the **Use knowledge graph** toggle.
7474
- If you are using an agent, click the **Retrieval** agent component to specify the knowledge base(s) and switch on the **Use knowledge graph** toggle.
7575

7676
## Frequently asked questions

website/docs/guides/dataset/use_tag_sets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ Use a tag set to tag chunks in your datasets.
1111

1212
Retrieval accuracy is the touchstone for a production-ready RAG framework. In addition to retrieval-enhancing approaches like auto-keyword, auto-question, and knowledge graph, RAGFlow introduces an auto-tagging feature to address semantic gaps. The auto-tagging feature automatically maps tags in the user-defined tag sets to relevant chunks within your knowledge base based on similarity with each chunk. This automation mechanism allows you to apply an additional "layer" of domain-specific knowledge to existing datasets, which is particularly useful when dealing with a large number of chunks.
1313

14-
To use this feature, ensure you have at least one properly configured tag set, specify the tag set(s) on the **Configuration** page of your knowledge base (dataset), and then re-parse your documents to initiate the auto-tag process. During this process, each chunk in your dataset is compared with every entry in the specified tag set(s), and tags are automatically applied based on similarity.
14+
To use this feature, ensure you have at least one properly configured tag set, specify the tag set(s) on the **Configuration** page of your knowledge base (dataset), and then re-parse your documents to initiate the auto-tagging process. During this process, each chunk in your dataset is compared with every entry in the specified tag set(s), and tags are automatically applied based on similarity.
1515

1616
:::caution NOTE
1717
The auto-tagging feature is *unavailable* on the [Infinity](https://github.com/infiniflow/infinity) document engine.
1818
:::
1919

2020
## Scenarios
2121

22-
Auto-tagging applies in situations where chunks are so similar to each other that the intended chunks cannot be distinguished from the rest. For example, when you have a few chunks about iPhone and a majority about iPhone case or iPhone accessaries, it becomes difficult to retrieve the iPhone-specific chunks without additional information.
22+
Auto-tagging applies in situations where chunks are so similar to each other that the intended chunks cannot be distinguished from the rest. For example, when you have a few chunks about iPhone and a majority about iPhone case or iPhone accessaries, it becomes difficult to retrieve those chunks about iPhone without additional information.
2323

2424
## Create tag set
2525

website/docs/guides/manage_files.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /manage_files
77

88
Knowledge base, hallucination-free chat, and file management are the three pillars of RAGFlow. RAGFlow's file management allows you to upload files individually or in bulk. You can then link an uploaded file to multiple target knowledge bases. This guide showcases some basic usages of the file management feature.
99

10-
:::danger IMPORTANT
10+
:::info IMPORTANT
1111
Compared to uploading files directly to various knowledge bases, uploading them to RAGFlow's file management and then linking them to different knowledge bases is *not* an unnecessary step, particularly when you want to delete some parsed files or an entire knowledge base but retain the original files.
1212
:::
1313

@@ -17,7 +17,9 @@ RAGFlow's file management allows you to establish your file system with nested f
1717

1818
![create new folder](https://github.com/infiniflow/ragflow/assets/93570324/3a37a5f4-43a6-426d-a62a-e5cd2ff7a533)
1919

20-
> Each knowledge base in RAGFlow has a corresponding folder under the **root/.knowledgebase** directory. You are not allowed to create a subfolder within it.
20+
:::caution NOTE
21+
Each knowledge base in RAGFlow has a corresponding folder under the **root/.knowledgebase** directory. You are not allowed to create a subfolder within it.
22+
:::
2123

2224
## Upload file
2325

website/docs/guides/team/join_or_leave_team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ _After accepting the team invite, you should be able to view and update the team
3939

4040
## Leave a joined team
4141

42-
![leave_team](https://github.com/user-attachments/assets/16f31462-27e5-4a13-b9dc-dd7f1bcc43f0)
42+
![leave_team](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/quit.jpg)

0 commit comments

Comments
 (0)