Tencent/WeKnora · error

query failed: %v

Error message

query failed: %v

What it means

The HybridSearch call against the configured knowledge base failed while executing the graph query: the underlying search backend (vector/full-text retrieval) returned an error, and this KB's sub-query is recorded as failed in kbResults for later aggregation.

Source

Thrown at internal/agent/tools/query_knowledge_graph.go:188

				mu.Lock()
				kbResults[id] = &graphQueryResult{kbID: id, err: fmt.Errorf("failed to get knowledge base: %v", err)}
				mu.Unlock()
				return
			}

			// Check if graph extraction is enabled
			if kb.ExtractConfig == nil || (len(kb.ExtractConfig.Nodes) == 0 && len(kb.ExtractConfig.Relations) == 0) {
				mu.Lock()
				kbResults[id] = &graphQueryResult{kbID: id, err: fmt.Errorf("graph extraction not configured")}
				mu.Unlock()
				return
			}

			// Query graph
			results, err := t.knowledgeService.HybridSearch(ctx, id, searchParams)
			if err != nil {
				mu.Lock()
				kbResults[id] = &graphQueryResult{kbID: id, kb: kb, err: fmt.Errorf("query failed: %v", err)}
				mu.Unlock()
				return
			}
			if t.scopeEnforced {
				results, err = filterSearchResultsInSearchTargets(
					ctx, t.searchTargets, id, results, t.scopeKnowledgeService,
				)
				if err != nil {
					mu.Lock()
					kbResults[id] = &graphQueryResult{kbID: id, kb: kb, err: err}
					mu.Unlock()
					return
				}
			}

			mu.Lock()
			kbResults[id] = &graphQueryResult{kbID: id, kb: kb, results: results}
			mu.Unlock()

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Check retrieval backend health and logs for the underlying error
  2. Retry transient backend failures per-KB
  3. Verify the KB's index actually contains graph-extracted chunks
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/agent/tools/query_knowledge_graph.go:188 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/408e0eb2daab4c0f. Report an issue: GitHub.