Search Results for

    Show / Hide Table of Contents

    Class LocalVectorStore

    Simple on-disk vector store (cosine similarity)'. Each item is two files:

    • {id}.vec : raw float32 array (dimension = fixed)
    • {id}.json : payload json (arbitrary metadata; role, content, timestamps, etc.)

    Options:

    • preloadVectors: load all vectors into memory on startup (fast search, higher RAM)
    • normalizeOnWrite: store L2-normalized vectors to speed cosine (dot == cosine)
    Inheritance
    object
    LocalVectorStore
    Implements
    IVectorStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.VectorStore
    Assembly: Glitch9.VectorStore.dll
    Syntax
    public sealed class LocalVectorStore : IVectorStore

    Constructors

    | Edit this page View Source

    LocalVectorStore(string, VectorStoreSettings)

    Creates a new local vector store at the specified root directory. If the directory does not exist, it will be created.

    Declaration
    public LocalVectorStore(string id, VectorStoreSettings settings)
    Parameters
    Type Name Description
    string id

    The unique identifier for the vector store. Use AI Agent's UniqueId.

    VectorStoreSettings settings
    Exceptions
    Type Condition
    ArgumentOutOfRangeException
    ArgumentNullException

    Properties

    | Edit this page View Source

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Dimension

    Declaration
    public int Dimension { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    DeleteAsync(string)

    Declaration
    public UniTask<bool> DeleteAsync(string id)
    Parameters
    Type Name Description
    string id
    Returns
    Type Description
    UniTask<bool>
    | Edit this page View Source

    ExistsAsync(string)

    Declaration
    public UniTask<bool> ExistsAsync(string id)
    Parameters
    Type Name Description
    string id
    Returns
    Type Description
    UniTask<bool>
    | Edit this page View Source

    SearchAsync(float[], int, float)

    Declaration
    public UniTask<IReadOnlyList<SearchHit>> SearchAsync(float[] query, int k, float minSim = 0.2)
    Parameters
    Type Name Description
    float[] query
    int k
    float minSim
    Returns
    Type Description
    UniTask<IReadOnlyList<SearchHit>>
    | Edit this page View Source

    UpsertAsync(string, float[], object)

    Declaration
    public UniTask UpsertAsync(string id, float[] vec, object payload)
    Parameters
    Type Name Description
    string id
    float[] vec
    object payload
    Returns
    Type Description
    UniTask

    Implements

    IVectorStore

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation