feat: RAG分块策略增强

This commit is contained in:
2026-03-29 17:28:12 +08:00
parent 2f20064ee1
commit 941995d1b8
28 changed files with 1719 additions and 12 deletions

View File

@@ -51,6 +51,15 @@
<artifactId>easy-agents-bom</artifactId>
</dependency>
<dependency>
<groupId>com.easyagents</groupId>
<artifactId>easy-agents-rag-core</artifactId>
</dependency>
<dependency>
<groupId>com.easyagents</groupId>
<artifactId>easy-agents-rag-ingestion</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -0,0 +1,42 @@
package com.easyagents.spring.boot.rag.ingestion;
import com.easyagents.rag.ingestion.DefaultRagIngestionService;
import com.easyagents.rag.ingestion.RagIngestionService;
import com.easyagents.rag.ingestion.analysis.DocumentStructureAnalyzer;
import com.easyagents.rag.ingestion.chunk.RagSplitStrategyRegistry;
import com.easyagents.rag.ingestion.recommend.SplitStrategyRecommender;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(RagIngestionService.class)
@Configuration(proxyBeanMethods = false)
public class RagIngestionAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public DocumentStructureAnalyzer documentStructureAnalyzer() {
return new DocumentStructureAnalyzer();
}
@Bean
@ConditionalOnMissingBean
public SplitStrategyRecommender splitStrategyRecommender() {
return new SplitStrategyRecommender();
}
@Bean
@ConditionalOnMissingBean
public RagSplitStrategyRegistry ragSplitStrategyRegistry() {
return new RagSplitStrategyRegistry();
}
@Bean
@ConditionalOnMissingBean
public RagIngestionService ragIngestionService(DocumentStructureAnalyzer documentStructureAnalyzer,
SplitStrategyRecommender splitStrategyRecommender,
RagSplitStrategyRegistry ragSplitStrategyRegistry) {
return new DefaultRagIngestionService(documentStructureAnalyzer, splitStrategyRecommender, ragSplitStrategyRegistry);
}
}

View File

@@ -1,10 +1,11 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.easyagents.spring.boot.chatModel.chatglm.ChatglmAutoConfiguration,\
com.easyagents.spring.boot.chatModel.openai.OpenAIAutoConfiguration,\
com.easyagents.spring.boot.chatModel.qwen.QwenAutoConfiguration,\
com.easyagents.spring.boot.chatModel.spark.SparkAutoConfiguration,\
com.easyagents.spring.boot.llm.openai.OpenAIAutoConfiguration,\
com.easyagents.spring.boot.llm.qwen.QwenAutoConfiguration,\
com.easyagents.spring.boot.store.aliyun.AliyunAutoConfiguration,\
com.easyagents.spring.boot.store.qcloud.QCloudStoreAutoConfiguration,\
com.easyagents.spring.boot.chatModel.ollama.OllamaAutoConfiguration,\
com.easyagents.spring.boot.chatModel.deepseek.DeepSeekAutoConfiguration,\
com.easyagents.spring.boot.store.chroma.ChromaAutoConfiguration
com.easyagents.spring.boot.llm.ollama.OllamaAutoConfiguration,\
com.easyagents.spring.boot.llm.deepseek.DeepSeekAutoConfiguration,\
com.easyagents.spring.boot.store.chroma.ChromaAutoConfiguration,\
com.easyagents.spring.boot.store.elasticsearch.ElasticSearchAutoConfiguration,\
com.easyagents.spring.boot.store.opensearch.OpenSearchAutoConfiguration,\
com.easyagents.spring.boot.rag.ingestion.RagIngestionAutoConfiguration

View File

@@ -1,8 +1,10 @@
com.easyagents.spring.boot.chatModel.chatglm.ChatglmAutoConfiguration
com.easyagents.spring.boot.chatModel.openai.OpenAIAutoConfiguration
com.easyagents.spring.boot.chatModel.qwen.QwenAutoConfiguration
com.easyagents.spring.boot.chatModel.spark.SparkAutoConfiguration
com.easyagents.spring.boot.llm.openai.OpenAIAutoConfiguration
com.easyagents.spring.boot.llm.qwen.QwenAutoConfiguration
com.easyagents.spring.boot.store.aliyun.AliyunAutoConfiguration
com.easyagents.spring.boot.store.qcloud.QCloudStoreAutoConfiguration
com.easyagents.spring.boot.chatModel.ollama.OllamaAutoConfiguration
com.easyagents.spring.boot.llm.ollama.OllamaAutoConfiguration
com.easyagents.spring.boot.llm.deepseek.DeepSeekAutoConfiguration
com.easyagents.spring.boot.store.chroma.ChromaAutoConfiguration
com.easyagents.spring.boot.store.elasticsearch.ElasticSearchAutoConfiguration
com.easyagents.spring.boot.store.opensearch.OpenSearchAutoConfiguration
com.easyagents.spring.boot.rag.ingestion.RagIngestionAutoConfiguration