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
@@ -0,0 +1,32 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using TarninaHub.Application.Abstractions;
using TarninaHub.Application.Security;
namespace TarninaHub.Controllers;
[ApiController]
[ApiVersion("1.0")]
[Route("api/matchmaking")]
[Authorize]
public class MatchmakingController : ControllerBase
{
private readonly IMatchmakingService _matchmakingService;
public MatchmakingController(IMatchmakingService matchmakingService)
{
_matchmakingService = matchmakingService;
}
[HttpPost("reindex")]
[Authorize(Policy = Policies.AdminOnly)]
public async Task<ActionResult<MatchmakingReindexResponse>> Reindex(CancellationToken cancellationToken)
{
var indexed = await _matchmakingService.ReindexAsync(cancellationToken);
return Ok(new MatchmakingReindexResponse(indexed));
}
}
public sealed record MatchmakingReindexResponse(int Indexed);