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
LocalVectorStore
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
Properties
|
Edit this page
View Source
Count
Declaration
public int Count { get; }
Property Value
|
Edit this page
View Source
Dimension
Declaration
public int Dimension { get; }
Property Value
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
Returns
|
Edit this page
View Source
UpsertAsync(string, float[], object)
Declaration
public UniTask UpsertAsync(string id, float[] vec, object payload)
Parameters
Returns
Implements
Extension Methods