Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
a0a708f
feat: integrate Graph RAG client and enhance knowledge base with RAG …
Dallas98 Jan 15, 2026
e5132fc
Merge branch 'refs/heads/main' into graph_rag
Dallas98 Jan 15, 2026
39e50ce
feat: implement RAG management module with knowledge base and file mo…
Dallas98 Jan 15, 2026
e6659fe
feat: enhance RAG service with background processing for unprocessed …
Dallas98 Jan 15, 2026
f7bd707
feat: update GraphRagClient API endpoint and enhance error handling i…
Dallas98 Jan 15, 2026
64ffcc6
feat: enhance knowledge base management with new types and custom ent…
Dallas98 Jan 15, 2026
fbd7157
feat: add query endpoint for knowledge graph and enhance RAG service …
Dallas98 Jan 15, 2026
45b634e
feat: enhance RAG service with async file processing and improve logging
Dallas98 Jan 15, 2026
132a288
feat: implement KnowledgeGraphView component and integrate knowledge …
Dallas98 Jan 15, 2026
bbc3aff
feat: enhance KnowledgeGraphView with improved link handling and dyna…
Dallas98 Jan 15, 2026
03cb80f
feat: enhance KnowledgeGraphView with improved link handling and dyna…
Dallas98 Jan 15, 2026
28f3053
feat: enhance KnowledgeGraphView with improved link handling and dyna…
Dallas98 Jan 15, 2026
17e1d4b
feat: improve text rendering and dynamic distance calculation in Know…
Dallas98 Jan 15, 2026
4595757
feat: improve text rendering and dynamic distance calculation in Know…
Dallas98 Jan 15, 2026
a2e84d2
feat: enhance lighting and dynamic distance calculation in KnowledgeG…
Dallas98 Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.datamate.datamanagement;

import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
Expand All @@ -10,7 +9,6 @@
* 数据管理服务配置类 - 多源接入、元数据、血缘治理
*/
@Configuration
@EnableFeignClients(basePackages = "com.datamate.datamanagement.infrastructure.client")
@EnableAsync
@ComponentScan(basePackages = {
"com.datamate.datamanagement",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
Expand All @@ -23,6 +24,7 @@
@EnableAsync
@EnableScheduling
@EnableCaching
@EnableFeignClients(basePackages = "com.datamate.*")
public class DataMateApplication {
public static void main(String[] args) {
SpringApplication.run(DataMateApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.baomidou.mybatisplus.annotation.TableName;
import com.datamate.common.domain.model.base.BaseEntity;
import com.datamate.rag.indexer.interfaces.dto.RagType;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -25,6 +26,11 @@ public class KnowledgeBase extends BaseEntity<String> {
*/
private String description;

/**
* RAG 类型
*/
private RagType type;

/**
* 嵌入模型
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.datamate.rag.indexer.infrastructure.client;

import com.datamate.common.infrastructure.common.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
* 知识图谱RAG客户端
*
* @author dallas
* @since 2026-01-15
*/
@FeignClient(name = "rag-service", url = "${collection.service.url:http://datamate-backend-python:18000}")
public interface GraphRagClient {
/**
* 启动知识图谱RAG任务
* @param knowledgeBaseId 知识库ID
* @return 任务详情
*/
@PostMapping("/api/rag/process/{id}")
Response<?> startGraphRagTask(@PathVariable("id") String knowledgeBaseId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import com.datamate.rag.indexer.domain.model.FileStatus;
import com.datamate.rag.indexer.domain.model.RagFile;
import com.datamate.rag.indexer.domain.repository.RagFileRepository;
import com.datamate.rag.indexer.infrastructure.client.GraphRagClient;
import com.datamate.rag.indexer.infrastructure.milvus.MilvusService;
import com.datamate.rag.indexer.interfaces.dto.AddFilesReq;
import com.datamate.rag.indexer.interfaces.dto.RagType;
import com.google.common.collect.Lists;
import dev.langchain4j.data.document.Document;
import dev.langchain4j.data.document.DocumentParser;
Expand Down Expand Up @@ -58,13 +60,20 @@ public class RagEtlService {

private final ModelConfigRepository modelConfigRepository;

private final GraphRagClient graphRagClient;

private final ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor();

@Async
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
public void processAfterCommit(DataInsertedEvent event) {
// 执行 RAG 处理流水线
List<RagFile> ragFiles = ragFileRepository.findNotSuccessByKnowledgeBaseId(event.knowledgeBase().getId());
if (RagType.GRAPH.equals(event.knowledgeBase().getType())){
log.info("Knowledge base {} is of type GRAPH. Skipping RAG ETL processing.", event.knowledgeBase().getName());
graphRagClient.startGraphRagTask(event.knowledgeBase().getId());
return;
}

ragFiles.forEach(ragFile -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class KnowledgeBaseCreateReq {
@Size(max = 512, message = "知识库描述长度必须在 0 到 512 之间")
private String description;

private RagType type = RagType.DOCUMENT;

/**
* 嵌入模型
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.datamate.rag.indexer.interfaces.dto;

/**
* RAG 类型
*
* @author dallas
* @since 2026-01-15
*/
public enum RagType {
/**
* 文档
*/
DOCUMENT,

/**
* 知识图谱
*/
GRAPH,
}
Loading
Loading