Package genlayer.py.storage.vecdb#

Warning

This is an internal module

class genlayer.py.storage.vecdb.VecDB[source]#

Data structure that supports storing and querying vector data

There are two entities that can act as a key:

  1. vector (can have duplicates)

  2. id (int alias, can’t have duplicates)

Warning

import numpy before from genlayer import * if you wish to use VecDB!

class genlayer.py.storage.vecdb.VecDBElement[source]#
__init__(db: VecDB[T, S, V], idx: u32, distance: Dist)[source]#
distance: Dist#

Distance from search point to this element, if any

property id: Id#

Id (unique key) of this element

property key: np.ndarray[tuple[S], np.dtype[T]]#

Key (vector) of this element

remove() None[source]#

Removes current element from the db

property value: V#

Value of this element