Table of Contents

Class MemoryManager

Namespace
JD.AI.Core.Memory
Assembly
JD.AI.Core.dll

Unified memory manager that combines embedding + vector store.

public sealed class MemoryManager
Inheritance
MemoryManager
Inherited Members

Constructors

MemoryManager(IEmbeddingProvider, IVectorStore)

public MemoryManager(IEmbeddingProvider embedder, IVectorStore store)

Parameters

embedder IEmbeddingProvider
store IVectorStore

Methods

IndexAsync(IReadOnlyList<(string Id, string Content, string? Source, string? Category)>, CancellationToken)

Indexes content into the vector store.

public Task IndexAsync(IReadOnlyList<(string Id, string Content, string? Source, string? Category)> items, CancellationToken ct = default)

Parameters

items IReadOnlyList<(string Id, string Content, string Source, string Category)>
ct CancellationToken

Returns

Task

SearchAsync(string, int, string?, CancellationToken)

Searches memory with a natural language query.

public Task<IReadOnlyList<MemorySearchResult>> SearchAsync(string query, int topK = 5, string? categoryFilter = null, CancellationToken ct = default)

Parameters

query string
topK int
categoryFilter string
ct CancellationToken

Returns

Task<IReadOnlyList<MemorySearchResult>>