32 lines
878 B
C#
32 lines
878 B
C#
|
|
namespace TeamUp.SharedKernel.Ai;
|
||
|
|
|
||
|
|
public enum MemoryKind
|
||
|
|
{
|
||
|
|
Decision,
|
||
|
|
Approval,
|
||
|
|
Correction,
|
||
|
|
}
|
||
|
|
|
||
|
|
public sealed record MemoryHit(Guid Id, MemoryKind Kind, string Content, DateTimeOffset CreatedAtUtc);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Team-scoped working memory: written when a human approves (or corrects) agent work, read at
|
||
|
|
/// prompt assembly via pgvector similarity. Implemented by the Memory module. Strictly isolated
|
||
|
|
/// per team — institutional knowledge is the moat.
|
||
|
|
/// </summary>
|
||
|
|
public interface ITeamMemory
|
||
|
|
{
|
||
|
|
Task WriteAsync(
|
||
|
|
Guid teamId,
|
||
|
|
MemoryKind kind,
|
||
|
|
string content,
|
||
|
|
Guid? sourceReviewItemId = null,
|
||
|
|
CancellationToken cancellationToken = default);
|
||
|
|
|
||
|
|
Task<IReadOnlyList<MemoryHit>> SearchAsync(
|
||
|
|
Guid teamId,
|
||
|
|
string query,
|
||
|
|
int take = 3,
|
||
|
|
CancellationToken cancellationToken = default);
|
||
|
|
}
|