namespace TeamUp.SharedKernel.Ai;
public enum MemoryKind
{
Decision,
Approval,
Correction,
}
/// The scope a memory belongs to: a single team (local, tactical) or a whole product (shared).
public enum MemoryScope
{
Team,
Product,
}
public sealed record MemoryHit(Guid Id, MemoryKind Kind, string Content, DateTimeOffset CreatedAtUtc);
///
/// 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.
///
public interface IWorkingMemory
{
Task WriteAsync(
MemoryScope scope,
Guid scopeId,
MemoryKind kind,
string content,
Guid? sourceReviewItemId = null,
CancellationToken cancellationToken = default);
Task> SearchAsync(
MemoryScope scope,
Guid scopeId,
string query,
int take = 3,
CancellationToken cancellationToken = default);
}