Skip to content

refactor: enhance schema recall - #108

Merged
VLSMB merged 24 commits into
spring-ai-alibaba:mainfrom
lzq986:feat/call-hybrid-search
Nov 14, 2025
Merged

VLSMB merged 24 commits into
spring-ai-alibaba:mainfrom
lzq986:feat/call-hybrid-search

Conversation

@lzq986

@lzq986 lzq986 commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor
  • adjust workflow before plannerNode
  • call hybrid search in AgentVectorStoreService
  • add aop for log
  • clean unsed code
  • finish semantic support

Describe what this PR does / why we need it

Does this pull request fix one issue?

close #58 close #97 close #99, fix #30 fix #104

Describe how you did it

Describe how to verify it

Special notes for reviews

- adjust workflow before plannerNode
- call hybrid search in AgentVectorStoreService
- add aop for log
- clean unsed code
@lzq986
lzq986 marked this pull request as draft November 11, 2025 10:17
@VLSMB
VLSMB self-requested a review November 11, 2025 14:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the schema recall workflow by restructuring the query processing pipeline. The changes replace the previous two-step process (QueryRewrite + KeywordExtract) with a three-step process (IntentRecognition → EvidenceRecall → QueryEnhance) and introduce a FeasibilityAssessment node before planning.

Key changes:

  • Replaced query rewrite and keyword extraction with intent recognition, evidence recall, and query enhancement nodes
  • Added feasibility assessment node to validate data analysis requests before planning
  • Implemented hybrid search functionality with configurable vector store properties
  • Refactored schema service to use direct document lists instead of nested lists
  • Added AOP-based logging for node entry points
  • Removed unused code including sample data enrichment in NL2SQL service

Reviewed Changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
schema.sql / data.sql Added table_name and schema_name columns to semantic_model table for better metadata tracking
AgentSearchRequest.java Simplified to use Lombok builder pattern, removed complex factory methods
AgentVectorStoreService*.java Refactored to support hybrid search and removed estimateDocuments method
SchemaService*.java Changed column document handling from nested lists to flat lists with fusion strategy
Node classes Replaced QueryRewriteNode/KeywordExtractNode with IntentRecognition/EvidenceRecall/QueryEnhance/FeasibilityAssessment nodes
Hybrid search classes Updated fusion strategy to support variable arguments and parameter order
Configuration Added DataAgentProperties for vector store settings and AOP logging aspect

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 80 out of 80 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

spring-ai-alibaba-data-agent-chat/src/main/java/com/alibaba/cloud/ai/service/schema/SchemaServiceImpl.java:1

  • The code adds docs to allResults when documents (the filtered result) is not empty. This appears to be a bug - it should add documents instead of docs to maintain consistency with the filtering logic.
    spring-ai-alibaba-data-agent-chat/src/main/java/com/alibaba/cloud/ai/node/PythonExecuteNode.java:1
  • Changed from createResponse to createPureResponse on line 100, but line 99 uses createPureResponse for the start sign. This inconsistency has been corrected. Good fix.
/*

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lzq986

lzq986 commented Nov 14, 2025

Copy link
Copy Markdown
Contributor Author

related to #104

@VLSMB
VLSMB marked this pull request as ready for review November 14, 2025 16:51
@VLSMB
VLSMB merged commit 15c136c into spring-ai-alibaba:main Nov 14, 2025
8 checks passed
pangpang20 pushed a commit to pangpang20/DataAgent that referenced this pull request Jan 28, 2026
* refactor: enhance schema recall
- adjust workflow before plannerNode
- call hybrid search in AgentVectorStoreService
- add aop for log
- clean unsed code

* clean unsed node

* feat: adapt flux output

* add semantic support

* fix: python bug

* fix unit test

* fix TableRelationDispatcher unit test

* fix method buildBusinessKnowledgePrompt

* delete unused code

* add metadata constant

* add semantic support

* update semantic crud cotroller

* fix MappersTest.java

* feat: add semantic frontend

* fix bugs

* feat: add search text-edit

* fix: bugs in schema.sql

* adjust semantic and business knowledge

* adjust by copilot feedback

* fix MapperTest type error.

* refactor: workflow

* chore update README.md

---------

Co-authored-by: VLSMB <2047857654@qq.com>
Co-authored-by: VLSMB <36068250+VLSMB@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants