Skip to content

pkgs/store/vecstore

pkgs/store/vecstore Defines vector similarity index and provides exact memory index and HNSW approximate nearest-neighbor implementation. Agent memory and recall use it to search for similar content by embedding.

Go API References

Core structure and implementation

SymbolFunction
IndexDefine vector add, search, delete and index lifecycle.
MatchThe expression matches ID, distance and metadata.
Memory / NewMemoryProvides in-process accurate vector search.
HNSW / NewHNSWProvide HNSW approximate index.
HNSWConfigConfigure dimension, distance and graph parameters.
OpenHNSWOpen or create a persistent HNSW index from the Object Store.
LoadHNSW / LoadHNSWWithOptionsRestore HNSW from serialized stream.
CosineDistanceCalculate cosine distance.

Ownership Boundary

VecStore does not generate embeddings, nor determine model, chunk or recall policy. Embedding dimension, normalization, resource ID, result rearrangement, object name and save timing belong to the caller.