Skip to content

feat: 集成 You.com 网络搜索作为第三条检索通道#7

Open
tra371 wants to merge 1 commit into
DevYangJC:masterfrom
Cooperation-org:feat/youcom-search
Open

feat: 集成 You.com 网络搜索作为第三条检索通道#7
tra371 wants to merge 1 commit into
DevYangJC:masterfrom
Cooperation-org:feat/youcom-search

Conversation

@tra371

@tra371 tra371 commented Jul 27, 2026

Copy link
Copy Markdown

变更内容

在混合检索流程中新增 You.com 网络搜索 作为第三条检索通道,向量检索 + 关键词检索通过 RRF 融合排序后,You.com 搜索结果直接追加到证据束中。

新增文件

  • engine/youcom/YoucomSearchService.java
    • 通过 YDC Index API (https://ydc-index.io/v1/search) 执行网络搜索
    • 使用 JDK HttpClient(与 Elasticsearch 通道一致)
    • 搜索结果转换为 Spring AI Document 对象,content 取自 snippet,url 写入 metadata
    • ObjectMapper 通过构造器注入(与 ElasticsearchChunkIndexService 模式一致)

修改文件

  • qa/rag/HybridChunkRetrievalService.java
    • 注入 YoucomSearchService
    • RRF 融合排序完成后,遍历查询计划执行 You.com 搜索,追加到 documents 列表
    • Javadoc 更新为三通道架构说明
  • application-dev.yml — 新增 You.com 配置项(默认关闭)

配置项

youcom:
  search:
    enabled: false      # 默认关闭,需要时启用
    api-key: ${YOUCOM_API_KEY:}
    top-k: 10

检索流程

查询规划
    ↓
向量检索 ─┬─ RRF 融合排序
关键词检索 ─┤  (k=0)
You.com 搜索 ─┘
    ↓
聚类分组 → 窗口扩展
    ↓
You.com 结果追加(证据列表)
    ↓
证据评估

测试计划

  • You.com API 连通性测试
  • 启用 youcom.search.enabled=true 后三通道正常返回
  • API Key 未配置时优雅降级(Web 通道跳过)

- Add YoucomSearchService: YDC Index API client via JDK HttpClient
- Inject YoucomSearchService into HybridChunkRetrievalService
- You.com search runs after RRF fusion, web results appended to evidence bundle
- You.com config in application-dev.yml (enabled=false by default)
- ObjectMapper injected via constructor (matching ElasticsearchChunkIndexService pattern)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tra371

tra371 commented Jul 27, 2026

Copy link
Copy Markdown
Author

针对该问题的实现 - #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant