feat(ai): pgvector embedding infrastructure (#19)
CI / backend (push) Successful in 51s
CI / frontend (push) Successful in 15s
Deploy Staging / deploy (push) Successful in 46s
Security / secrets (push) Successful in 4s
Security / dependencies (push) Successful in 56s
CI / backend (pull_request) Successful in 54s
CI / frontend (pull_request) Successful in 15s
Security / secrets (pull_request) Successful in 3s
Security / dependencies (pull_request) Successful in 55s

This commit was merged in pull request #19.
This commit is contained in:
2026-07-02 03:00:06 +02:00
parent d78fe601ff
commit 2056548702
10 changed files with 854 additions and 5 deletions
+7
View File
@@ -54,6 +54,13 @@ public class Email : AuditableEntity
/// </summary>
public NpgsqlTypes.NpgsqlTsVector? SearchVector { get; set; }
/// <summary>
/// Semantic-search embedding (pgvector, 768-dim for nomic-embed-text). Populated by the
/// embedding backfill worker when AI is enabled; null otherwise (search falls back to
/// lexical). Nullable so the InMemory test provider and AI-off deployments work unchanged.
/// </summary>
public Pgvector.Vector? Embedding { get; set; }
public ICollection<EmailLabel> EmailLabels { get; set; } = new List<EmailLabel>();
public ICollection<Attachment> Attachments { get; set; } = new List<Attachment>();
}
@@ -4,7 +4,9 @@
<AssemblyName>InboxIntel.Domain</AssemblyName>
</PropertyGroup>
<ItemGroup>
<!-- NpgsqlTypes.NpgsqlTsVector is used on the Email entity for FTS mapping. -->
<!-- NpgsqlTypes.NpgsqlTsVector (FTS) and Pgvector.Vector (semantic search) are used as
column types on the Email entity — same pragmatic precedent for both. -->
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Pgvector" Version="0.2.0" />
</ItemGroup>
</Project>