Table of Contents

Interface IVectorStore

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

Vector store abstraction for semantic memory.

public interface IVectorStore

Methods

CountAsync(CancellationToken)

Returns the total number of stored entries.

Task<long> CountAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<long>

DeleteAsync(IReadOnlyList<string>, CancellationToken)

Deletes entries by IDs.

Task DeleteAsync(IReadOnlyList<string> ids, CancellationToken ct = default)

Parameters

ids IReadOnlyList<string>
ct CancellationToken

Returns

Task

SearchAsync(float[], int, string?, CancellationToken)

Searches for similar entries by embedding vector.

Task<IReadOnlyList<MemorySearchResult>> SearchAsync(float[] queryEmbedding, int topK = 5, string? categoryFilter = null, CancellationToken ct = default)

Parameters

queryEmbedding float[]
topK int
categoryFilter string
ct CancellationToken

Returns

Task<IReadOnlyList<MemorySearchResult>>

UpsertAsync(IReadOnlyList<MemoryEntry>, CancellationToken)

Upserts entries with their embeddings.

Task UpsertAsync(IReadOnlyList<MemoryEntry> entries, CancellationToken ct = default)

Parameters

entries IReadOnlyList<MemoryEntry>
ct CancellationToken

Returns

Task