feat(backend): add semantic matchmaking with embedding pipeline

Add a pluggable embedding provider with an offline deterministic default, vector indexing for problems and innovations, cosine semantic ranking, similar cases and solution suggestions, area filtering and an admin reindex endpoint. Refresh the index when innovations or submissions change.
This commit is contained in:
Rafał Tyński
2026-10-04 02:44:03 +02:00
parent 2bc083fb95
commit 25ce901021
13 changed files with 611 additions and 2 deletions
@@ -118,6 +118,25 @@ internal sealed class InnovationRow
[CborProperty("published")] public bool Published { get; set; }
[CborProperty("updated_at")] public DateTimeOffset? UpdatedAt { get; set; }
[CborProperty("embedding")] public List<float>? Embedding { get; set; }
}
internal sealed class ProblemRow
{
[CborProperty("id")] public string Id { get; set; } = string.Empty;
[CborProperty("title")] public string Title { get; set; } = string.Empty;
[CborProperty("description")] public string Description { get; set; } = string.Empty;
[CborProperty("challenge")] public string Challenge { get; set; } = string.Empty;
[CborProperty("location")] public string Location { get; set; } = string.Empty;
[CborProperty("author")] public string Author { get; set; } = string.Empty;
[CborProperty("embedding")] public List<float>? Embedding { get; set; }
}
internal sealed class TrendRow
@@ -131,3 +150,8 @@ internal sealed class TrendSubmissionRow
{
[CborProperty("challenge")] public string Challenge { get; set; } = string.Empty;
}
internal sealed class IdRow
{
[CborProperty("id")] public string Id { get; set; } = string.Empty;
}