Skip to content

fix: normalize business knowledge vector IDs - #569

Merged
zxuexingzhijie merged 2 commits into
spring-ai-alibaba:mainfrom
March-77:codex/fix-business-knowledge-filter
Jul 28, 2026
Merged

zxuexingzhijie merged 2 commits into
spring-ai-alibaba:mainfrom
March-77:codex/fix-business-knowledge-filter

Conversation

@March-77

Copy link
Copy Markdown
Contributor

What changed

  • serialize new businessTermId vector metadata as a string
  • query both the normalized string representation and legacy numeric metadata
  • delete both metadata representations when business knowledge is updated or removed
  • add a regression test backed by the actual SimpleVectorStore filter implementation

Root cause

SimpleVectorStore evaluates metadata filters through SpEL. Numeric values in an IN expression are parsed as Integer, while business knowledge IDs were stored as Long, so equality always failed and no business terms were recalled.

Validation

  • ./mvnw -pl data-agent-management -Dtest=DynamicFilterServiceTest,DocumentConverterUtilTest,BusinessKnowledgeServiceImplTest test (58 tests)
  • ./mvnw -pl data-agent-management spotless:check checkstyle:check
  • git diff --check

Fixes #460

@March-77
March-77 marked this pull request as ready for review July 22, 2026 02:02
…knowledge-filter

# Conflicts:
#	data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/business/BusinessKnowledgeServiceImpl.java
@March-77

Copy link
Copy Markdown
Contributor Author

已合并最新 main 并解决冲突。新写入的业务术语使用字符串 ID,删除和过滤仍兼容旧的数值 ID。相关测试 72 个通过,格式和 Checkstyle 也通过。

@zxuexingzhijie
zxuexingzhijie merged commit d542550 into spring-ai-alibaba:main Jul 28, 2026
7 checks passed
zxuexingzhijie added a commit that referenced this pull request Jul 28, 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] 业务知识召回不生效

2 participants