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
+10 -1
View File
@@ -15,10 +15,12 @@ namespace TarninaHub.Controllers;
public class InnovationsController : ControllerBase
{
private readonly IInnovationService _innovations;
private readonly IMatchmakingService _matchmakingService;
public InnovationsController(IInnovationService innovations)
public InnovationsController(IInnovationService innovations, IMatchmakingService matchmakingService)
{
_innovations = innovations;
_matchmakingService = matchmakingService;
}
[HttpGet]
@@ -56,6 +58,8 @@ public class InnovationsController : ControllerBase
var created = await _innovations.CreateAsync(request, cancellationToken);
await _matchmakingService.IndexInnovationAsync(created.Id, cancellationToken);
return CreatedAtAction(nameof(GetById), new { innovationId = created.Id }, created);
}
@@ -73,6 +77,11 @@ public class InnovationsController : ControllerBase
var updated = await _innovations.UpdateAsync(innovationId, request, cancellationToken);
if (updated is not null)
{
await _matchmakingService.IndexInnovationAsync(updated.Id, cancellationToken);
}
return updated is null ? NotFound() : Ok(updated);
}