Skip to content

fix(schema): use semantic search for table recall - #574

Closed
March-77 wants to merge 2 commits into
spring-ai-alibaba:mainfrom
March-77:agent/issue-553-semantic-schema-recall
Closed

fix(schema): use semantic search for table recall#574
March-77 wants to merge 2 commits into
spring-ai-alibaba:mainfrom
March-77:agent/issue-553-semantic-schema-recall

Conversation

@March-77

Copy link
Copy Markdown
Contributor

Describe what this PR does / why we need it

SchemaServiceImpl#getTableDocumentsByDatasource built a semantic SearchRequest with 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 query default with threshold 0.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

  • expose a guarded vector-store service method for executing a fully configured SearchRequest
  • pass the existing schema recall request through that method instead of rebuilding a filter-only request
  • add regression coverage for the query, top-K, similarity threshold, metadata filter, direct delegation, and null-request failure semantics

User 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 passed
  • Checkstyle — 0 violations
  • Spotless — no additional changes
  • git diff --check — passed

Compatibility / 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 SearchRequest portion discussed in #498; that issue additionally contains a maintainer-directed AgentScope redesign discussion and is not auto-closed here.

March-77 added 2 commits July 24, 2026 15:13
…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
@March-77

Copy link
Copy Markdown
Contributor Author

已合并最新 main 并解决冲突。语义检索改用 main 中现有的接口,相关测试 42 个通过,格式和 Checkstyle 也通过。

@March-77

Copy link
Copy Markdown
Contributor Author

最新 main 已通过 #570 实现语义表召回修复,并包含基于真实 SimpleVectorStore 的 SchemaVectorRecallIntegrationTest。当前 PR 相对 main 只剩一处 Mockito 测试调整,已被更完整的集成测试覆盖,因此关闭,不再重复合入。

@March-77 March-77 closed this Jul 27, 2026
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] SchemaRecallNode 表召回未使用语义检索,getTableDocumentsByDatasource 中 SearchRequest 为死代码

1 participant