Vectorstores
BaseVectorStore ¶
Bases: ABC
Source code in libs\kotaemon\kotaemon\storages\vectorstores\base.py
add
abstractmethod
¶
Add vector embeddings to vector stores
Parameters:
Name | Type | Description | Default |
---|---|---|---|
embeddings |
list[list[float]] | list[DocumentWithEmbedding]
|
List of embeddings |
required |
metadatas |
Optional[list[dict]]
|
List of metadata of the embeddings |
None
|
ids |
Optional[list[str]]
|
List of ids of the embeddings |
None
|
kwargs |
meant for vectorstore-specific parameters |
required |
Returns:
Type | Description |
---|---|
list[str]
|
List of ids of the embeddings |
Source code in libs\kotaemon\kotaemon\storages\vectorstores\base.py
delete
abstractmethod
¶
Delete vector embeddings from vector stores
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids |
list[str]
|
List of ids of the embeddings to be deleted |
required |
kwargs |
meant for vectorstore-specific parameters |
{}
|
Source code in libs\kotaemon\kotaemon\storages\vectorstores\base.py
query
abstractmethod
¶
Return the top k most similar vector embeddings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
embedding |
list[float]
|
List of embeddings |
required |
top_k |
int
|
Number of most similar embeddings to return |
1
|
ids |
Optional[list[str]]
|
List of ids of the embeddings to be queried |
None
|
Returns:
Type | Description |
---|---|
tuple[list[list[float]], list[float], list[str]]
|
the matched embeddings, the similarity scores, and the ids |
Source code in libs\kotaemon\kotaemon\storages\vectorstores\base.py
ChromaVectorStore ¶
Bases: LlamaIndexVectorStore
Source code in libs\kotaemon\kotaemon\storages\vectorstores\chroma.py
delete ¶
Delete vector embeddings from vector stores
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids |
List[str]
|
List of ids of the embeddings to be deleted |
required |
kwargs |
meant for vectorstore-specific parameters |
{}
|
Source code in libs\kotaemon\kotaemon\storages\vectorstores\chroma.py
InMemoryVectorStore ¶
Bases: LlamaIndexVectorStore
Source code in libs\kotaemon\kotaemon\storages\vectorstores\in_memory.py
save ¶
save a simpleVectorStore to a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
save_path |
str
|
Path of saving vector to disk. |
required |
fs |
Optional[AbstractFileSystem]
|
An abstract super-class for pythonic file-systems |
None
|
Source code in libs\kotaemon\kotaemon\storages\vectorstores\in_memory.py
load ¶
Create a SimpleKVStore from a load directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
load_path |
str
|
Path of loading vector. |
required |
fs |
Optional[AbstractFileSystem]
|
An abstract super-class for pythonic file-systems |
None
|
Source code in libs\kotaemon\kotaemon\storages\vectorstores\in_memory.py
SimpleFileVectorStore ¶
Bases: LlamaIndexVectorStore
Similar to InMemoryVectorStore but is backed by file by default