feat: implement semantic search, knowledge unit extraction, and visualization components

This commit is contained in:
2026-05-03 15:59:30 +02:00
parent 94ecc7a404
commit 1f187b5125
24 changed files with 844 additions and 21 deletions
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace NexusReader.Domain.Entities;
@@ -11,6 +12,9 @@ public class SemanticKnowledgeCache
[Required]
public string JsonData { get; set; } = string.Empty;
[Required]
public string OriginalText { get; set; } = string.Empty;
[Required]
[MaxLength(50)]
public string ModelId { get; set; } = "gemini-1.5-flash";
@@ -19,5 +23,12 @@ public class SemanticKnowledgeCache
[MaxLength(10)]
public string PromptVersion { get; set; } = "1.0";
[Required]
[MaxLength(128)]
public string TenantId { get; set; } = string.Empty;
[Column(TypeName = "vector(1536)")] // text-embedding-004 has 768 or 1536 dims, assuming 1536 for high-fidelity
public float[]? Vector { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}