InMemoryAgentMemoryStore
Models & Types · AiDotNet.Agentic.Memory
A process-local IAgentMemoryStore that ranks memories by lexical overlap with the query —
the fraction of the query’s words that appear in the memory. Requires no embedding model, so it is the
zero-config default; for meaning-based recall, use EmbeddingAgentMemoryStore<T>.
Implements: IAgentMemoryStore
For Beginners
This notebook finds notes by matching words. If you ask about “deadline” it finds notes containing “deadline”, but it won’t realize “due date” means the same thing — that needs the embedding-backed store. It’s fast, needs no setup, and is great for tests and simple cases.
Constructors
| Constructor | Summary |
|---|---|
InMemoryAgentMemoryStore() |
Methods
| Method | Summary |
|---|---|
Task RemoveAsync(string id, CancellationToken cancellationToken) |
|
Task<IReadOnlyList<AgentMemory>> GetAllAsync(CancellationToken cancellationToken) |
|
Task<IReadOnlyList<ScoredMemory>> SearchAsync(string query, int topK, CancellationToken cancellationToken) |
|
Task<string> AddAsync(string content, IReadOnlyDictionary<string, string> metadata, CancellationToken cancellationToken) |