Skip to content

fix(schema): 使用 query 进行表向量召回 #480

Open
ZhangDT-sky wants to merge 2 commits intospring-ai-alibaba:mainfrom
ZhangDT-sky:fix/issue-478-schema-query-recall
Open

fix(schema): 使用 query 进行表向量召回 #480
ZhangDT-sky wants to merge 2 commits intospring-ai-alibaba:mainfrom
ZhangDT-sky:fix/issue-478-schema-query-recall

Conversation

@ZhangDT-sky
Copy link
Copy Markdown

Describe what this PR does / why we need it

修复表 Schema 召回时未实际使用用户 query 的问题。

此前虽然构建了包含 querySearchRequest,但实际执行的是仅按 metadata 过滤的查询路径,导致会召回当前数据源下的全部表,而不是与用户问题相关的表。

Does this pull request fix one issue?

Yes. Closes #478

Describe how you did it

  1. 修复 SchemaServiceImpl#getTableDocumentsByDatasource(...) 的调用逻辑,使表召回实际执行带 query 的向量相似度检索。
  2. 新增 AgentVectorStoreService#similaritySearch(SearchRequest) 接口。
  3. AgentVectorStoreServiceImpl 中补充对应实现。
  4. 新增回归测试 SchemaServiceImplTest,验证表召回会正确使用用户 query

Describe how to verify it

运行以下命令:

cmd /c mvnw.cmd -pl data-agent-management -Dtest=SchemaServiceImplTest test                                                                                                                            
                                                                                                                                                                                                       
验证点:                                                                                                                                                                                               
                                                                                                                                                                                                       
- 测试通过。                                                                                                                                                                                           
- 表 Schema 召回会使用用户 query,不再返回当前数据源下的全部表。                                                                                                                                       
                                                                                                                                                                                                       
### Special notes for reviews                                                                                                                                                                          
                                                                                                                                                                                                       
本次修改仅影响表 Schema 的初步召回逻辑,不涉及列召回、知识库召回或多数据源管理逻辑。   

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.

[BUG] 修复向量检索表未根据query关键字检索问题

1 participant