{"record":{"id":"f423729af12f4faf","repo":"Tencent/WeKnora","slug":"graph-extraction-not-configured","errorCode":null,"errorMessage":"graph extraction not configured","messagePattern":"graph extraction not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/query_knowledge_graph.go","lineNumber":179,"sourceCode":"\n\tfor _, kbID := range input.KnowledgeBaseIDs {\n\t\twg.Add(1)\n\t\tgo func(id string) {\n\t\t\tdefer wg.Done()\n\n\t\t\t// Get knowledge base to check graph configuration\n\t\t\tkb, err := t.knowledgeService.GetKnowledgeBaseByIDOnly(ctx, id)\n\t\t\tif err != nil {\n\t\t\t\tmu.Lock()\n\t\t\t\tkbResults[id] = &graphQueryResult{kbID: id, err: fmt.Errorf(\"failed to get knowledge base: %v\", err)}\n\t\t\t\tmu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Check if graph extraction is enabled\n\t\t\tif kb.ExtractConfig == nil || (len(kb.ExtractConfig.Nodes) == 0 && len(kb.ExtractConfig.Relations) == 0) {\n\t\t\t\tmu.Lock()\n\t\t\t\tkbResults[id] = &graphQueryResult{kbID: id, err: fmt.Errorf(\"graph extraction not configured\")}\n\t\t\t\tmu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Query graph\n\t\t\tresults, err := t.knowledgeService.HybridSearch(ctx, id, searchParams)\n\t\t\tif err != nil {\n\t\t\t\tmu.Lock()\n\t\t\t\tkbResults[id] = &graphQueryResult{kbID: id, kb: kb, err: fmt.Errorf(\"query failed: %v\", err)}\n\t\t\t\tmu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif t.scopeEnforced {\n\t\t\t\tresults, err = filterSearchResultsInSearchTargets(\n\t\t\t\t\tctx, t.searchTargets, id, results, t.scopeKnowledgeService,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\tmu.Lock()","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/tools/query_knowledge_graph.go#L161-L197","documentation":"Graph query configuration guard: the knowledge base loaded successfully but its ExtractConfig is nil or defines no nodes and no relations, meaning graph extraction was never configured/enabled for this KB, so a knowledge-graph query over it cannot produce meaningful results and is rejected per-KB.","triggerScenarios":"Thrown at internal/agent/tools/query_knowledge_graph.go:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure ExtractConfig with nodes/relations for the knowledge base","Run graph extraction on the KB's documents first","Skip unconfigured KBs with a warning instead of an error when others remain"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}