Docarray
DocArrayHnswVectorStore #
Bases: DocArrayVectorStore
Class representing a DocArray HNSW vector store.
This class is a lightweight Document Index implementation provided by Docarray. It stores vectors on disk in hnswlib, and stores all other data in SQLite.
Examples:
pip install llama-index-vector-stores-docarray
from llama_index.vector_stores.docarray import DocArrayHnswVectorStore
# Initialize the DocArrayHnswVectorStore
vector_store = DocArrayHnswVectorStore(work_dir="hnsw_index", dim=1536)
Source code in llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/docarray/hnsw.py
8 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 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
DocArrayInMemoryVectorStore #
Bases: DocArrayVectorStore
Class representing a DocArray In-Memory vector store.
This class is a document index provided by Docarray that stores documents in memory.
Examples:
pip install llama-index-vector-stores-docarray
from llama_index.vector_stores.docarray import DocArrayInMemoryVectorStore
# Create an instance of DocArrayInMemoryVectorStore
vector_store = DocArrayInMemoryVectorStore()
Source code in llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/docarray/in_memory.py
7 8 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 |
|
persist #
persist(persist_path: str, fs: Optional[AbstractFileSystem] = None) -> None
Persists the in-memory vector store to a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
persist_path
|
str
|
The path to persist the index. |
required |
fs
|
AbstractFileSystem
|
Filesystem to persist to. (doesn't apply) |
None
|
Source code in llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/docarray/in_memory.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|