Tencent/WeKnora · error
embedding_model_id is required for RAG compression
Error message
embedding_model_id is required for RAG compression
What it means
Configuration guard in CompressWithRAG: RAG compression embeds and retrieves via a specific embedding model, and cfg.EmbeddingModelID is empty, so there is no model to vectorize the web search results with. Configure an embedding model before enabling RAG compression of search results.
Source
Thrown at internal/application/service/web_search.go:157
return base
}
// CompressWithRAG performs RAG-based compression using a temporary, hidden knowledge base.
// The temporary knowledge base is deleted after use. The UI will not list it due to repo filtering.
func (s *WebSearchService) CompressWithRAG(
ctx context.Context, sessionID string, tempKBID string, questions []string,
webSearchResults []*types.WebSearchResult, cfg *types.WebSearchConfig,
kbSvc interfaces.KnowledgeBaseService, knowSvc interfaces.KnowledgeService,
seenURLs map[string]bool, knowledgeIDs []string,
) (compressed []*types.WebSearchResult, kbID string, newSeen map[string]bool, newIDs []string, err error) {
if len(webSearchResults) == 0 || len(questions) == 0 {
return
}
if cfg == nil {
return nil, tempKBID, seenURLs, knowledgeIDs, fmt.Errorf("web search config is required for RAG compression")
}
if cfg.EmbeddingModelID == "" {
return nil, tempKBID, seenURLs, knowledgeIDs, fmt.Errorf("embedding_model_id is required for RAG compression")
}
var createdKB *types.KnowledgeBase
// reuse or create temp KB
if strings.TrimSpace(tempKBID) != "" {
createdKB, err = kbSvc.GetKnowledgeBaseByID(ctx, tempKBID)
if err != nil {
logger.Warnf(ctx, "Temp KB %s not available, recreating: %v", tempKBID, err)
createdKB = nil
}
}
if createdKB == nil {
kb := &types.KnowledgeBase{
Name: fmt.Sprintf("tmp-websearch-%d", time.Now().UnixNano()),
Description: "Ephemeral search compression KB",
IsTemporary: true,
EmbeddingModelID: cfg.EmbeddingModelID,
}
createdKB, err = kbSvc.CreateKnowledgeBase(ctx, kb)View on GitHub (pinned to 988cbb0330)
Solutions
- Set embedding_model_id in the web search config
- Verify the embedding model selection was saved with the provider config
- Choose a valid embedding model available to the tenant
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/application/service/web_search.go:157 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/683d4409a39eed9a.
Report an issue: GitHub.