Files
Teamup/src/Shared/TeamUp.SharedKernel/Ai/IWorkingMemory.cs
T

41 lines
1.1 KiB
C#
Raw Normal View History

namespace TeamUp.SharedKernel.Ai;
public enum MemoryKind
{
Decision,
Approval,
Correction,
}
/// <summary>The scope a memory belongs to: a single team (local, tactical) or a whole product (shared).</summary>
public enum MemoryScope
{
Team,
Product,
}
public sealed record MemoryHit(Guid Id, MemoryKind Kind, string Content, DateTimeOffset CreatedAtUtc);
/// <summary>
/// Working memory: written when a human approves (or corrects) agent work, read at prompt assembly
/// via pgvector similarity. Scoped to a team (local context) or a product (shared by every agent
/// across the product's teams). Implemented by the Memory module.
/// </summary>
public interface IWorkingMemory
{
Task WriteAsync(
MemoryScope scope,
Guid scopeId,
MemoryKind kind,
string content,
Guid? sourceReviewItemId = null,
CancellationToken cancellationToken = default);
Task<IReadOnlyList<MemoryHit>> SearchAsync(
MemoryScope scope,
Guid scopeId,
string query,
int take = 3,
CancellationToken cancellationToken = default);
}