MongoDB 到 RagApi
| 功能 | 说明 |
|---|---|
Full Data Migration | Migrate data by sequentially scanning data in tables and writing it in batches to the target database. Supported _id types: ObjectId, Long, Integer. |
Incremental Data Sync | Sync of INSERT, UPDATE, DELETE is supported. |
Subscription Modification | Add, delete, or modify the subscribed tables with support for historical data migration. For more information, see Modify Subscription. |
Position Resetting | Reset positions by timestamp to consume the oplog in a past period again. |
Supported Deployment | Support master-slave, replica set, sharded cluster. |
高级功能
| 功能 | 说明 |
|---|---|
知识片段选择(KNOWLEDGE_SELECT) | 根据用户查询语义,从检索结果中自动筛选最相关的知识片段,提高生成回答的准确性和针对性。 |
压缩查询(QUERY_COMPRESS) | 对用户原始问题进行语义压缩,去除冗余信息,保留核心内容,优化向量检索效果。 |
扩展查询(QUERY_EXTEND) | 自动扩展用户问题,引入潜在相关信息或同义表达,提升语义匹配覆盖率。 |
MCP 工具链调用 | 支持调用 MCP 平台上配置的工具链(如 GitHub 查询、Shell 命令等),实现问答中自动调用外部系统完成任务或补全信息。 |
Custom Code | For more information, see Custom Code Processing, Debug Custom Code and Logging in Custom Code. |
Adding Virtual Columns | Support adding custom virtual columns with fixed values, such as region, ID, etc. |
限制和注意点
| 限制项 | 说明 |
|---|---|
oplog 大小和保留时间设置 | MongoDB 默认配置 replication.oplogSizeMB 过小 或 storage.oplogMinRetentionHours 过小,如数据同步延迟过大,可能导致未消费的 oplog 被清除,需调大此参数 |
MongoDB 主备架构的任务设置 | 源端 MongoDB 主备架构模式,需要将源端任务 参数 oplogCollection 设置为 oplog.$main |
changeStream 模式 | MongoDB 3.6 以上支持 changeStream 获取增量变更,同步任务可以设置源端参数 captureMode 为 CHANGE_STREAM,MongoDB 分片集群可以填写 Mongos 连接串进行同步 |
oplog 模式 | 当使用 oplog 模式进行 MongoDB 源端同步时,需要确保该能够访问到 local 库 |
网络准备 | 请确保迁移同步节点(Sidecar)具备访问目标知识库及大模型服务的网络连通性,如 xxx 域名或 IP。 |