fix(knowledge-service): resolve semantic cache collision by partitioning content hash by traceType and PromptVersion

This commit is contained in:
2026-05-25 11:31:19 +02:00
parent f8d1ceabd3
commit 3cbbb6df6b
@@ -85,7 +85,8 @@ public class KnowledgeService : IKnowledgeService
using var dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
var normalizedText = text.Trim();
var hash = ContentHasher.ComputeHash(normalizedText);
var hashInput = $"{normalizedText}:{traceType}:{PromptVersion}";
var hash = ContentHasher.ComputeHash(hashInput);
// 1. Check Cache
var cached = await dbContext.SemanticKnowledgeCache