fix(go-agent): finish retrieval component (#17845)

- Prefer canonical `dataset_ids` over legacy `kb_ids` in Canvas
retrieval components.
- Cover selected and explicitly cleared dataset IDs with regression
tests.
- Add cross-language retrieval with dataset-specific embedding and
rerank models.
- Support vector and keyword similarity controls, metadata filtering,
TOC enhancement, and child-chunk expansion.
- Route Canvas retrieval across datasets and memories with compatible
embedding validation.
This commit is contained in:
Hz_
2026-08-05 15:48:54 +08:00
committed by GitHub
parent 40ff1c9d03
commit a55a438b42
17 changed files with 1500 additions and 140 deletions

View File

@@ -26,6 +26,7 @@ import (
"ragflow/internal/admin"
"ragflow/internal/agent/audio"
"ragflow/internal/agent/canvas"
"ragflow/internal/agent/retrievalbridge"
agenttool "ragflow/internal/agent/tool"
"ragflow/internal/channels"
"ragflow/internal/handler"
@@ -728,7 +729,14 @@ func startServer(ctx context.Context) {
// Initialize doc engine for skill search
docEngine := engine.Get()
documentDAO := dao.NewDocumentDAO()
agenttool.SetRetrievalService(agenttool.NewNLPRetrievalAdapterFromDeps(docEngine, documentDAO))
retrievalEnhancer := retrievalbridge.NewEnhancer(docEngine, metadataService)
agenttool.SetRetrievalService(agenttool.NewNLPRetrievalAdapterFromDeps(
docEngine,
documentDAO,
modelProviderService,
retrievalEnhancer,
))
agenttool.SetMemoryRetrievalService(retrievalbridge.NewMemoryAdapter(memoryService))
common.Info("agent: retrieval service adapter installed")
// Initialize handler layer