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
LanceDBVectorStore ¶
Bases: LlamaIndexVectorStore
Source code in libs/kotaemon/kotaemon/storages/vectorstores/lancedb.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/lancedb.py
MilvusVectorStore ¶
Bases: LlamaIndexVectorStore
Source code in libs/kotaemon/kotaemon/storages/vectorstores/milvus.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
QdrantVectorStore ¶
Bases: LlamaIndexVectorStore
Source code in libs/kotaemon/kotaemon/storages/vectorstores/qdrant.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/qdrant.py
SimpleFileVectorStore ¶
Bases: LlamaIndexVectorStore
Similar to InMemoryVectorStore but is backed by file by default