fix(retrieval): bound automatic graph retrieval

This commit is contained in:
姚章浩
2026-09-10 16:24:56 +08:00
parent c64a48647c
commit e1092f84a4
11 changed files with 231 additions and 13 deletions
@@ -17,6 +17,8 @@ type PluginSearchEntity struct {
knowledgeRepo interfaces.KnowledgeRepository
}
const maxGraphChunkResults = 10
// NewPluginSearchEntity creates a new plugin search entity
func NewPluginSearchEntity(
eventManager *EventManager,
@@ -200,6 +202,12 @@ func filterSeenChunk(ctx context.Context, graph *types.GraphData, searchResult [
}
seen[chunkID] = true
chunkIDs = append(chunkIDs, chunkID)
if len(chunkIDs) == maxGraphChunkResults {
break
}
}
if len(chunkIDs) == maxGraphChunkResults {
break
}
}
logger.Infof(ctx, "filterSeenChunk: new chunkIDs count: %d", len(chunkIDs))