-
Notifications
You must be signed in to change notification settings - Fork 753
Expand file tree
/
Copy pathapplication.yaml
More file actions
359 lines (321 loc) · 11.3 KB
/
Copy pathapplication.yaml
File metadata and controls
359 lines (321 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
server:
port: 9090
servlet:
context-path: /api/ragent
spring:
application:
name: ragent${unique-name:}-service
servlet:
multipart:
max-file-size: 50MB
max-request-size: 100MB
datasource:
driver-class-name: org.postgresql.Driver
type: com.zaxxer.hikari.HikariDataSource
username: postgres
password: postgres
url: jdbc:postgresql://127.0.0.1:5432/ragent?client_encoding=UTF8
hikari:
connection-timeout: 5000
idle-timeout: 600000
max-lifetime: 1800000
maximum-pool-size: 10
minimum-idle: 5
pool-name: RagentHikariPool
data:
redis:
host: 127.0.0.1
port: 6379
password: 123456
rocketmq:
name-server: 127.0.0.1:9876
producer:
group: ragent-producer${unique-name:}_pg
send-message-timeout: 2000
ragent:
engine:
type: workflow # 执行架构档位,可选 workflow(v1 编排管线)/ agent(v2 ReAct 架构,RAG 管线降级为主 Agent 的一个 Tool)
demo-mode: false
eval:
enabled: true
# Agent 执行架构(ragent.engine.type=agent 时生效);单模型无 fallback,供应商可用性由 provider 侧保障
agent:
chat:
provider: bailian # 引用 ai.providers 下的供应商,取其 url / api-key / endpoints.chat
model: qwen3-max # 直接传给 OpenAI 兼容端点的模型名
max-iters: 10 # ReAct 循环上限,超出后熔断收尾
max-retries: 2 # 单次模型调用失败重试次数
sse-timeout-ms: 300000
rag:
storage:
type: s3 # 可选 s3(rustfs / minio)/ oss(阿里云)
kb-bucket: ragent-sources # 全局知识库桶(私有),所有知识库文档按 collectionName 目录隔离;OSS 桶名全局唯一,生产需按部署覆盖
asset-bucket: ragent-assets # 多模态资产桶(公共读),PDF 抽出的图片等供浏览器匿名直连预览
s3:
endpoint: http://localhost:9000
access-key: rustfsadmin
secret-key: rustfsadmin
region: us-east-1
path-style: true
public-url: # 内外网端点不同时配置,留空回退 endpoint
oss:
endpoint: https://oss-cn-hangzhou.aliyuncs.com
access-key: ${OSS_ACCESS_KEY:}
secret-key: ${OSS_SECRET_KEY:}
region: cn-hangzhou
public-url: # 虚拟主机式基址(含 bucket 子域),如 https://ragent-assets.oss-cn-hangzhou.aliyuncs.com;留空由 endpoint 推导
vector:
type: pg # 可选 milvus / pg
keyword:
type: none # 可选 none / es
es:
uris: http://127.0.0.1:9200
index: rag_keyword_store # 全库共享索引,按 collection_name 字段区分知识库
analyzer: ik_max_word
search-analyzer: ik_smart
graph:
type: none # 图谱后端总开关,可选 none / lightrag。lightrag 即接入后端供「后台可视化 / 检索读取」;是否参与检索、是否写入分别由 rag.search.channels.graph.enabled 与下方 ingestion.enabled 独立控制
lightrag:
base-url: http://127.0.0.1:9621
query-mode: hybrid
embedding-model: qwen-emb-8b # 与 LightRAG 的 SiliconFlow Qwen3-Embedding-8B 配置一致
default:
collection-name: rag_default_store
dimension: 1536
metric-type: COSINE
sse-timeout-ms: 300000 # SSE 全局超时(毫秒),默认 5 分钟
query-rewrite:
enabled: true
rerank:
enabled: true
citation:
enabled: true # 回答行内引用角标 [N](#cite-N):开启会动态追加引用规则并为资料注入编号,增加首字延迟;关闭不影响文档级来源面板
rate-limit:
global:
enabled: true
max-concurrent: 10
max-wait-seconds: 15
lease-seconds: 30
poll-interval-ms: 200
voice:
executors:
websocket-lifecycle:
core-pool-size: 2
max-pool-size: 32
keep-alive-seconds: 60
thread-name-prefix: websocket_lifecycle_executor_
playback:
core-pool-size: 2
max-pool-size: 8
keep-alive-seconds: 60
thread-name-prefix: voice_playback_executor_
memory:
history-keep-turns: 8
summary-enabled: true
summary-start-turns: 9
summary-max-chars: 400
title-max-length: 30
semaphore:
document-upload:
name: rag:document:upload
max-concurrent: 10
max-wait-seconds: 5
lease-seconds: 300
knowledge:
schedule:
scan-delay-ms: 10000
lock-seconds: 900
batch-size: 20
min-interval-seconds: 60
mcp:
servers:
- name: default
url: http://localhost:9099
search:
# 检索漏斗三段预算,各自独立、单调收窄,启动时校验 recall-budget ≥ default-top-k 且 rerank-candidate-limit ≥ default-top-k
default-top-k: 10 # ③ 最终进 LLM 的条数(产品语义的 topK)
recall-budget: 20 # ① 每通道召回条数(绝对值,向量意图路/关键词/图谱共用);须 ≥ default-top-k,0=回退 default-top-k
# 检索作用域:本次请求该看哪些知识库,与用什么模态检索无关,故与 channels 平级、三条通道共读
# 判定只看 KB 意图最高分,不看意图个数;关掉任一通道都不影响其余通道的作用域
scope:
min-intent-score: 0.4 # 低于此分的意图节点不参与「是否收窄」的判定
confidence-threshold: 0.6 # KB 意图最高分低于此值 → 退化为全库检索
supplement-ratio: 0.25 # 定向时各通道从自身产出额度划给「未命中库」的保底比例,兜住意图判错;0=关闭补充路,命中库已覆盖全库时自动不补
channels:
timeout-ms: 15000 # 单通道查询超时上限(毫秒)
vector:
enabled: true # 向量通道总开关
keyword:
enabled: false # 检索范围读引擎解析好的作用域,与向量通道同源
graph:
enabled: false # 图谱检索通道开关:false 不参与问答召回(后端仍在,后台可视化照常);置 true 前需先开 rag.graph.type=lightrag
web-search:
enabled: false
count: 5
timeout-seconds: 10
api-key: ${YDC_API_KEY:}
fusion:
strategy: rrf
rrf-k: 20 # 候选池通常仅 20~40 条,k=60 会过度平滑名次;调低至 20 让头部更有区分度(配合「检索归因」日志校准)
rerank-candidate-limit: 40 # ② RRF 融合后送入 Rerank 的候选池上限,<=0 不截断(经验值 40~100)
channel-weights:
vector: 1.0
keyword: 1.0
graph: 0.8
web-search: 0.5
trace:
enabled: true
max-error-length: 1000
# 图片解析(图生文)配置
# 产出一段自包含的知识文本:既说清"图是什么",又完整保留所有文字与层级
image-parse:
description-prompt: |-
请把这张图片的内容转写成一段自包含的知识文本,用于知识库检索与问答,不要描述颜色、布局、字体等视觉样式。要求:
1. 开头用一两句话说明这张图是什么(主题、类型、用途),让人不看图也能明白讲的是什么。
2. 随后按图中的分组、层级、流程关系,完整转写所有文字内容(OCR),保留每个分组标题与其下属条目的归属关系,不要遗漏任何文字。
3. 若是图表、架构图或流程图,请补充说明各部分之间的关系(如包含、调用、先后顺序),而不只是罗列文字。
4. 保持术语准确完整,表述贴近用户可能的提问方式。
5. 最后另起一行,用一句话自然引出图片(例如"下方为该内容对应的原始图片:"),以便在这段文字后紧接着展示图片。
max-output-tokens: 4096
ai:
providers:
ollama:
url: http://localhost:11434
endpoints:
chat: /v1/chat/completions
embedding: /v1/embeddings
bailian:
url: https://dashscope.aliyuncs.com
api-key: ${BAILIAN_API_KEY:}
workspace: ${BAILIAN_WORKSPACE:}
endpoints:
chat: /compatible-mode/v1/chat/completions
rerank: /api/v1/services/rerank/text-rerank/text-rerank
tts: /api-ws/v1/inference
aihubmix:
url: https://aihubmix.com
api-key: ${AIHUBMIX_API_KEY:}
endpoints:
chat: /v1/chat/completions
embedding: /v1/embeddings
siliconflow:
url: https://api.siliconflow.cn
api-key: ${SILICONFLOW_API_KEY:}
endpoints:
chat: /v1/chat/completions
embedding: /v1/embeddings
selection:
failure-threshold: 2
open-duration-ms: 30000
stream:
message-chunk-size: 1
chat:
candidates:
- id: qwen-plus
provider: bailian
model: qwen-plus-latest
- id: qwen-flash
provider: bailian
model: qwen-flash
- id: qwen3-local
provider: ollama
model: qwen3:8b-fp16
- id: qwen3-max
provider: bailian
model: qwen3-max
supports-thinking: true
- id: glm-4.7
provider: siliconflow
model: Pro/zai-org/GLM-4.7
supports-thinking: true
- id: gpt-5.4
provider: aihubmix
model: gpt-5.4
default-tier: standard
deep-thinking-tier: deep
tiers:
fast:
candidates: [ qwen-flash, qwen-plus, qwen3-local ]
timeout-ms: 5000
standard:
candidates: [ qwen3-max, qwen-plus, qwen3-local, gpt-5.4 ]
timeout-ms: 30000
deep:
candidates: [ qwen3-max, glm-4.7 ]
timeout-ms: 120000
embedding:
default-model: qwen-emb-8b
candidates:
- id: qwen-emb-8b
provider: siliconflow
model: Qwen/Qwen3-Embedding-8B
dimension: ${rag.default.dimension}
priority: 1
- id: qwen-emb-local
provider: ollama
model: qwen3-embedding:8b-fp16
dimension: ${rag.default.dimension}
priority: 2
- id: text-embedding-3-large
provider: aihubmix
model: text-embedding-3-large
dimension: ${rag.default.dimension}
priority: 3
rerank:
default-model: qwen3-rerank
candidates:
- id: qwen3-rerank
provider: bailian
model: qwen3-rerank
priority: 1
- id: rerank-noop
provider: noop
model: noop
priority: 100
vlm:
default-model: qwen-vl-max
candidates:
- id: qwen-vl-max
provider: bailian
model: qwen-vl-max
tts:
default-model: cosyvoice-v3-flash
timeout-ms: 3000
candidates:
- id: cosyvoice-v3-flash
provider: bailian
model: cosyvoice-v3-flash
priority: 1
voice: longxiaochun_v3
websocket:
connect-timeout-ms: 10000
task-start-timeout-ms: 10000
task-packet-idle-timeout-ms: 10000
max-total-per-model: 8
max-idle-per-model: 8
idle-timeout-ms: 25000
eviction-interval-ms: 30000
# MinerU SaaS API 配置(PDF / Word / PPT 走 MinerU 解析)
mineru:
api-url: https://mineru.net/api/v4
api-key: ${MINERU_API_KEY:}
poll-interval-seconds: 5
timeout-seconds: 300
enable-table: true
enable-formula: true
ocr: false
language: ch
concurrency-limit: 5
semaphore-name: rag:mineru:parse
max-wait-seconds: 30
lease-seconds: 900
sa-token:
token-name: Authorization
timeout: 2592000
is-concurrent: true
is-share: false
token-style: simple-uuid
is-log: false
is-print: false
milvus:
uri: http://localhost:19530