fix(schema): use semantic search for table recall - #574
Closed
March-77 wants to merge 2 commits into
Closed
Conversation
…antic-schema-recall # Conflicts: # data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/schema/SchemaServiceImpl.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/service/schema/SchemaServiceImplTest.java
Contributor
Author
|
已合并最新 main 并解决冲突。语义检索改用 main 中现有的接口,相关测试 42 个通过,格式和 Checkstyle 也通过。 |
Contributor
Author
|
最新 main 已通过 #570 实现语义表召回修复,并包含基于真实 SimpleVectorStore 的 SchemaVectorRecallIntegrationTest。当前 PR 相对 main 只剩一处 Mockito 测试调整,已被更完整的集成测试覆盖,因此关闭,不再重复合入。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
SchemaServiceImpl#getTableDocumentsByDatasourcebuilt a semanticSearchRequestwith the user query, configured top-K, similarity threshold, and datasource/table filters, but discarded it. The code instead called the filter-only path, which embeds the literal querydefaultwith threshold0.0. Table recall therefore ignored the user question and could truncate the relevant table when a datasource had more than the configured top-K tables.Does this pull request fix one issue?
Fixes #553
Describe how you did it
SearchRequestUser impact
Schema recall now ranks tables semantically for the actual user question while remaining scoped to the selected datasource and table documents. This prevents unrelated first-in-store tables from displacing relevant tables in larger schemas.
Describe how to verify it
./mvnw -pl data-agent-management -Dtest=SchemaServiceImplTest,AgentVectorStoreServiceImplTest test— 47 tests passed./mvnw -pl data-agent-management test— 1,631 tests passedgit diff --check— passedCompatibility / risk
No API or persistence format changes. Existing filter-only lookups remain unchanged. The new service method delegates the already-built Spring AI request directly, so the behavioral change is limited to datasource table recall now honoring the configured semantic search inputs.
Special notes for reviews
This also addresses the dead
SearchRequestportion discussed in #498; that issue additionally contains a maintainer-directed AgentScope redesign discussion and is not auto-closed here.