Interface ISemanticMemory
- Namespace
- IntentSharp.Memory
- Assembly
- IntentSharp.dll
Stores completed operations and recalls similar ones. Recall uses embedding cosine similarity when entries carry embeddings, and token overlap otherwise. Implementations must be thread-safe.
public interface ISemanticMemory
- Extension Methods
Methods
- ClearAsync(CancellationToken)
Removes every stored entry.
- GetStatsAsync(CancellationToken)
Returns counts over every stored entry.
- RecallAsync(string, int, CancellationToken)
Returns up to
maxResultsentries whose intent is similar toquery, most similar first. Entries with no similarity are left out, so the list can be empty.
- RecordAsync(MemoryEntry, CancellationToken)
Stores one entry. The client calls it after each completed request not served from the cache, unless recording is turned off.