Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

refactor(knowledge.go): Modify the knowledge existence check condition to eliminate the parsing failure state

begoniezhao54570da047b0
diff --git a/internal/application/repository/knowledge.go b/internal/application/repository/knowledge.go
index 4284fe877..4c7623f3d 100644
--- a/internal/application/repository/knowledge.go
+++ b/internal/application/repository/knowledge.go
@@ -118,7 +118,7 @@ func (r *knowledgeRepository) CheckKnowledgeExists(
params *types.KnowledgeCheckParams,
) (bool, *types.Knowledge, error) {
query := r.db.WithContext(ctx).Model(&types.Knowledge{}).
- Where("tenant_id = ? AND knowledge_base_id = ? AND enable_status = ?", tenantID, kbID, "enabled")
+ Where("tenant_id = ? AND knowledge_base_id = ? AND parse_status <> ?", tenantID, kbID, "failed")
if params.Type == "file" {
// If file hash exists, prioritize exact match using hash