Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/basics/rag.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ They are highly consistent at the technical base (e.g., vector retrieval, keywor

RAG has demonstrated clear value in several typical scenarios:

1. Enterprise Knowledge Q&A and Internal Search
1. Enterprise Knowledge Q&A and Internal Search
By vectorizing corporate private data and combining it with an LLM, RAG can directly return natural language answers based on authoritative sources, rather than document lists. While meeting intelligent Q&A needs, it inherently aligns with corporate requirements for data security, access control, and compliance.
2. Complex Document Understanding and Professional Q&A
2. Complex Document Understanding and Professional Q&A
For structurally complex documents like contracts and regulations, the value of RAG lies in its ability to generate accurate, verifiable answers while maintaining context integrity. Its system accuracy largely depends on text chunking and semantic understanding strategies.
3. Dynamic Knowledge Fusion and Decision Support
3. Dynamic Knowledge Fusion and Decision Support
In business scenarios requiring the synthesis of information from multiple sources, RAG evolves into a knowledge orchestration and reasoning support system for business decisions. Through a multi-path recall mechanism, it fuses knowledge from different systems and formats, maintaining factual consistency and logical controllability during the generation phase.

## The future of RAG

The evolution of RAG is unfolding along several clear paths:

1. RAG as the data foundation for Agents
1. RAG as the data foundation for Agents
RAG and agents have an architecture vs. scenario relationship. For agents to achieve autonomous and reliable decision-making and execution, they must rely on accurate and timely knowledge. RAG provides them with a standardized capability to access private domain knowledge and is an inevitable choice for building knowledge-aware agents.
2. Advanced RAG: Using LLMs to optimize retrieval itself
2. Advanced RAG: Using LLMs to optimize retrieval itself
The core feature of next-generation RAG is fully utilizing the reasoning capabilities of LLMs to optimize the retrieval process, such as rewriting queries, summarizing or fusing results, or implementing intelligent routing. Empowering every aspect of retrieval with LLMs is key to breaking through current performance bottlenecks.
3. Towards context engineering 2.0
3. Towards context engineering 2.0
Current RAG can be viewed as Context Engineering 1.0, whose core is assembling static knowledge context for single Q&A tasks. The forthcoming Context Engineering 2.0 will extend with RAG technology at its core, becoming a system that automatically and dynamically assembles comprehensive context for agents. The context fused by this system will come not only from documents but also include interaction memory, available tools/skills, and real-time environmental information. This marks the transition of agent development from a "handicraft workshop" model to the industrial starting point of automated context engineering.

The essence of RAG is to build a dedicated, efficient, and trustworthy external data interface for large language models; its core is Retrieval, not Generation. Starting from the practical need to solve private data access, its technical depth is reflected in the optimization of retrieval for complex unstructured data. With its deep integration into agent architectures and its development towards automated context engineering, RAG is evolving from a technology that improves Q&A quality into the core infrastructure for building the next generation of trustworthy, controllable, and scalable intelligent applications.
1 change: 0 additions & 1 deletion docs/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
sidebarIcon: LucideCog
}
---

# Configuration

Configurations for deploying RAGFlow via Docker.
Expand Down
3 changes: 1 addition & 2 deletions docs/contribution/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucideBookA
}
---

# Contribution guidelines

General guidelines for RAGFlow's community contributors.
Expand Down Expand Up @@ -35,7 +34,7 @@ The list below mentions some contributions you can make, but it is not a complet
1. Fork our GitHub repository.
2. Clone your fork to your local machine:
`git clone [email protected]:<yourname>/ragflow.git`
3. Create a local branch:
3. Create a local branch:
`git checkout -b my-branch`
4. Provide sufficient information in your commit message
`git commit -m 'Provide sufficient info in your commit message'`
Expand Down
1 change: 0 additions & 1 deletion docs/develop/acquire_ragflow_api_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucideKey
}
---

# Acquire RAGFlow API key

An API key is required for the RAGFlow server to authenticate your HTTP/Python or MCP requests. This documents provides instructions on obtaining a RAGFlow API key.
Expand Down
1 change: 0 additions & 1 deletion docs/develop/build_docker_image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucidePackage
}
---

# Build RAGFlow Docker image
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Expand Down
11 changes: 5 additions & 6 deletions docs/develop/launch_ragflow_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucideMonitorPlay
}
---

# Launch service from source

A guide explaining how to set up a RAGFlow service from its source code. By following this guide, you'll be able to debug using the source code.
Expand Down Expand Up @@ -39,7 +38,7 @@ cd ragflow/
### Install Python dependencies

1. Install uv:

```bash
pipx install uv
```
Expand Down Expand Up @@ -91,13 +90,13 @@ docker compose -f docker/docker-compose-base.yml up -d
```

3. **Optional:** If you cannot access HuggingFace, set the HF_ENDPOINT environment variable to use a mirror site:

```bash
export HF_ENDPOINT=https://hf-mirror.com
```

4. Check the configuration in **conf/service_conf.yaml**, ensuring all hosts and ports are correctly set.

5. Run the **entrypoint.sh** script to launch the backend service:

```shell
Expand Down Expand Up @@ -126,10 +125,10 @@ docker compose -f docker/docker-compose-base.yml up -d
3. Start up the RAGFlow frontend service:

```bash
npm run dev
npm run dev
```

*The following message appears, showing the IP address and port number of your frontend service:*
*The following message appears, showing the IP address and port number of your frontend service:*

![](https://github.com/user-attachments/assets/0daf462c-a24d-4496-a66f-92533534e187)

Expand Down
61 changes: 30 additions & 31 deletions docs/develop/mcp/launch_mcp_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ sidebar_custom_props: {
categoryIcon: LucideTvMinimalPlay
}
---

# Launch RAGFlow MCP server

Launch an MCP server from source or via Docker.

---

A RAGFlow Model Context Protocol (MCP) server is designed as an independent component to complement the RAGFlow server. Note that an MCP server must operate alongside a properly functioning RAGFlow server.
A RAGFlow Model Context Protocol (MCP) server is designed as an independent component to complement the RAGFlow server. Note that an MCP server must operate alongside a properly functioning RAGFlow server.

An MCP server can start up in either self-host mode (default) or host mode:
An MCP server can start up in either self-host mode (default) or host mode:

- **Self-host mode**:
- **Self-host mode**:
When launching an MCP server in self-host mode, you must provide an API key to authenticate the MCP server with the RAGFlow server. In this mode, the MCP server can access *only* the datasets of a specified tenant on the RAGFlow server.
- **Host mode**:
- **Host mode**:
In host mode, each MCP client can access their own datasets on the RAGFlow server. However, each client request must include a valid API key to authenticate the client with the RAGFlow server.

Once a connection is established, an MCP server communicates with its client in MCP HTTP+SSE (Server-Sent Events) mode, unidirectionally pushing responses from the RAGFlow server to its client in real time.
Expand All @@ -32,9 +31,9 @@ Once a connection is established, an MCP server communicates with its client in
If you wish to try out our MCP server without upgrading RAGFlow, community contributor [yiminghub2024](https://github.com/yiminghub2024) 👏 shares their recommended steps [here](#launch-an-mcp-server-without-upgrading-ragflow).
:::

## Launch an MCP server
## Launch an MCP server

You can start an MCP server either from source code or via Docker.
You can start an MCP server either from source code or via Docker.

### Launch from source code

Expand All @@ -51,7 +50,7 @@ uv run mcp/server/server.py --host=127.0.0.1 --port=9382 --base-url=http://127.0
# uv run mcp/server/server.py --host=127.0.0.1 --port=9382 --base-url=http://127.0.0.1:9380 --mode=host
```

Where:
Where:

- `host`: The MCP server's host address.
- `port`: The MCP server's listening port.
Expand Down Expand Up @@ -97,7 +96,7 @@ The MCP server is designed as an optional component that complements the RAGFlow
# - --no-json-response # Disables JSON responses for the streamable-HTTP transport
```

Where:
Where:

- `mcp-host`: The MCP server's host address.
- `mcp-port`: The MCP server's listening port.
Expand All @@ -122,13 +121,13 @@ Run `docker compose -f docker-compose.yml up` to launch the RAGFlow server toget
docker-ragflow-cpu-1 | Starting MCP Server on 0.0.0.0:9382 with base URL http://127.0.0.1:9380...
docker-ragflow-cpu-1 | Starting 1 task executor(s) on host 'dd0b5e07e76f'...
docker-ragflow-cpu-1 | 2025-04-18 15:41:18,816 INFO 27 ragflow_server log path: /ragflow/logs/ragflow_server.log, log levels: {'peewee': 'WARNING', 'pdfminer': 'WARNING', 'root': 'INFO'}
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | __ __ ____ ____ ____ _____ ______ _______ ____
docker-ragflow-cpu-1 | | \/ |/ ___| _ \ / ___|| ____| _ \ \ / / ____| _ \
docker-ragflow-cpu-1 | | |\/| | | | |_) | \___ \| _| | |_) \ \ / /| _| | |_) |
docker-ragflow-cpu-1 | | | | | |___| __/ ___) | |___| _ < \ V / | |___| _ <
docker-ragflow-cpu-1 | |_| |_|\____|_| |____/|_____|_| \_\ \_/ |_____|_| \_\
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | MCP launch mode: self-host
docker-ragflow-cpu-1 | MCP host: 0.0.0.0
docker-ragflow-cpu-1 | MCP port: 9382
Expand All @@ -141,13 +140,13 @@ Run `docker compose -f docker-compose.yml up` to launch the RAGFlow server toget
docker-ragflow-cpu-1 | 2025-04-18 15:41:23,263 INFO 27 init database on cluster mode successfully
docker-ragflow-cpu-1 | 2025-04-18 15:41:25,318 INFO 27 load_model /ragflow/rag/res/deepdoc/det.onnx uses CPU
docker-ragflow-cpu-1 | 2025-04-18 15:41:25,367 INFO 27 load_model /ragflow/rag/res/deepdoc/rec.onnx uses CPU
docker-ragflow-cpu-1 | ____ ___ ______ ______ __
docker-ragflow-cpu-1 | ____ ___ ______ ______ __
docker-ragflow-cpu-1 | / __ \ / | / ____// ____// /____ _ __
docker-ragflow-cpu-1 | / /_/ // /| | / / __ / /_ / // __ \| | /| / /
docker-ragflow-cpu-1 | / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
docker-ragflow-cpu-1 | /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | / _, _// ___ |/ /_/ // __/ / // /_/ /| |/ |/ /
docker-ragflow-cpu-1 | /_/ |_|/_/ |_|\____//_/ /_/ \____/ |__/|__/
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | 2025-04-18 15:41:29,088 INFO 27 RAGFlow version: v0.18.0-285-gb2c299fa full
docker-ragflow-cpu-1 | 2025-04-18 15:41:29,088 INFO 27 project base: /ragflow
docker-ragflow-cpu-1 | 2025-04-18 15:41:29,088 INFO 27 Current configs, from /ragflow/conf/service_conf.yaml:
Expand All @@ -156,12 +155,12 @@ Run `docker compose -f docker-compose.yml up` to launch the RAGFlow server toget
docker-ragflow-cpu-1 | * Running on all addresses (0.0.0.0)
docker-ragflow-cpu-1 | * Running on http://127.0.0.1:9380
docker-ragflow-cpu-1 | * Running on http://172.19.0.6:9380
docker-ragflow-cpu-1 | ______ __ ______ __
docker-ragflow-cpu-1 | ______ __ ______ __
docker-ragflow-cpu-1 | /_ __/___ ______/ /__ / ____/ _____ _______ __/ /_____ _____
docker-ragflow-cpu-1 | / / / __ `/ ___/ //_/ / __/ | |/_/ _ \/ ___/ / / / __/ __ \/ ___/
docker-ragflow-cpu-1 | / / / /_/ (__ ) ,< / /____> </ __/ /__/ /_/ / /_/ /_/ / /
docker-ragflow-cpu-1 | /_/ \__,_/____/_/|_| /_____/_/|_|\___/\___/\__,_/\__/\____/_/
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | / / / /_/ (__ ) ,< / /____> </ __/ /__/ /_/ / /_/ /_/ / /
docker-ragflow-cpu-1 | /_/ \__,_/____/_/|_| /_____/_/|_|\___/\___/\__,_/\__/\____/_/
docker-ragflow-cpu-1 |
docker-ragflow-cpu-1 | 2025-04-18 15:41:34,501 INFO 32 TaskExecutor: RAGFlow version: v0.18.0-285-gb2c299fa full
docker-ragflow-cpu-1 | 2025-04-18 15:41:34,501 INFO 32 Use Elasticsearch http://es01:9200 as the doc engine.
...
Expand All @@ -173,11 +172,11 @@ Run `docker compose -f docker-compose.yml up` to launch the RAGFlow server toget
This section is contributed by our community contributor [yiminghub2024](https://github.com/yiminghub2024). 👏
:::

1. Prepare all MCP-specific files and directories.
i. Copy the [mcp/](https://github.com/infiniflow/ragflow/tree/main/mcp) directory to your local working directory.
ii. Copy [docker/docker-compose.yml](https://github.com/infiniflow/ragflow/blob/main/docker/docker-compose.yml) locally.
iii. Copy [docker/entrypoint.sh](https://github.com/infiniflow/ragflow/blob/main/docker/entrypoint.sh) locally.
iv. Install the required dependencies using `uv`:
1. Prepare all MCP-specific files and directories.
i. Copy the [mcp/](https://github.com/infiniflow/ragflow/tree/main/mcp) directory to your local working directory.
ii. Copy [docker/docker-compose.yml](https://github.com/infiniflow/ragflow/blob/main/docker/docker-compose.yml) locally.
iii. Copy [docker/entrypoint.sh](https://github.com/infiniflow/ragflow/blob/main/docker/entrypoint.sh) locally.
iv. Install the required dependencies using `uv`:
- Run `uv add mcp` or
- Copy [pyproject.toml](https://github.com/infiniflow/ragflow/blob/main/pyproject.toml) locally and run `uv sync --python 3.12`.
2. Edit **docker-compose.yml** to enable MCP (disabled by default).
Expand All @@ -197,19 +196,19 @@ docker logs docker-ragflow-cpu-1

## Security considerations

As MCP technology is still at early stage and no official best practices for authentication or authorization have been established, RAGFlow currently uses [API key](./acquire_ragflow_api_key.md) to validate identity for the operations described earlier. However, in public environments, this makeshift solution could expose your MCP server to potential network attacks. Therefore, when running a local SSE server, it is recommended to bind only to localhost (`127.0.0.1`) rather than to all interfaces (`0.0.0.0`).
As MCP technology is still at early stage and no official best practices for authentication or authorization have been established, RAGFlow currently uses [API key](./acquire_ragflow_api_key.md) to validate identity for the operations described earlier. However, in public environments, this makeshift solution could expose your MCP server to potential network attacks. Therefore, when running a local SSE server, it is recommended to bind only to localhost (`127.0.0.1`) rather than to all interfaces (`0.0.0.0`).

For further guidance, see the [official MCP documentation](https://modelcontextprotocol.io/docs/concepts/transports#security-considerations).

## Frequently asked questions

### When to use an API key for authentication?

The use of an API key depends on the operating mode of your MCP server.
The use of an API key depends on the operating mode of your MCP server.

- **Self-host mode** (default):
When starting the MCP server in self-host mode, you should provide an API key when launching it to authenticate it with the RAGFlow server:
- If launching from source, include the API key in the command.
- **Self-host mode** (default):
When starting the MCP server in self-host mode, you should provide an API key when launching it to authenticate it with the RAGFlow server:
- If launching from source, include the API key in the command.
- If launching from Docker, update the API key in **docker/docker-compose.yml**.
- **Host mode**:
- **Host mode**:
If your RAGFlow MCP server is working in host mode, include the API key in the `headers` of your client requests to authenticate your client with the RAGFlow server. An example is available [here](https://github.com/infiniflow/ragflow/blob/main/mcp/client/client.py).
5 changes: 2 additions & 3 deletions docs/develop/mcp/mcp_client_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ sidebar_custom_props: {
}

---

# RAGFlow MCP client examples

Python and curl MCP client examples.
Expand Down Expand Up @@ -39,11 +38,11 @@ When interacting with the MCP server via HTTP requests, follow this initializati

1. **The client sends an `initialize` request** with protocol version and capabilities.
2. **The server replies with an `initialize` response**, including the supported protocol and capabilities.
3. **The client confirms readiness with an `initialized` notification**.
3. **The client confirms readiness with an `initialized` notification**.
_The connection is established between the client and the server, and further operations (such as tool listing) may proceed._

:::tip NOTE
For more information about this initialization process, see [here](https://modelcontextprotocol.io/docs/concepts/architecture#1-initialization).
For more information about this initialization process, see [here](https://modelcontextprotocol.io/docs/concepts/architecture#1-initialization).
:::

In the following sections, we will walk you through a complete tool calling process.
Expand Down
1 change: 0 additions & 1 deletion docs/develop/mcp/mcp_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucideToolCase
}
---

# RAGFlow MCP tools

The MCP server currently offers a specialized tool to assist users in searching for relevant information powered by RAGFlow DeepDoc technology:
Expand Down
1 change: 0 additions & 1 deletion docs/develop/switch_doc_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sidebar_custom_props: {
categoryIcon: LucideShuffle
}
---

# Switch document engine

Switch your doc engine from Elasticsearch to Infinity.
Expand Down
Loading