You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apis/python/src/tiledb/vector_search/vamana_index.py
+40-8Lines changed: 40 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,15 @@
1
+
"""
2
+
Vamana Index implementation.
3
+
4
+
Vamana is based on Microsoft's DiskANN vector search library, as described in these papers:
5
+
```
6
+
Subramanya, Suhas Jayaram, and Rohan Kadekodi. DiskANN: Fast Accurate Billion-Point Nearest Neighbor Search on a Single Node.
7
+
8
+
Singh, Aditi, et al. FreshDiskANN: A Fast and Accurate Graph-Based ANN Index for Streaming Similarity Search. arXiv:2105.09613, arXiv, 20 May 2021, http://arxiv.org/abs/2105.09613.
9
+
10
+
Gollapudi, Siddharth, et al. “Filtered-DiskANN: Graph Algorithms for Approximate Nearest Neighbor Search with Filters.” Proceedings of the ACM Web Conference 2023, ACM, 2023, pp. 3406-16, https://doi.org/10.1145/3543507.3583552.
11
+
```
12
+
"""
1
13
importwarnings
2
14
fromtypingimportAny, Mapping
3
15
@@ -17,14 +29,14 @@
17
29
18
30
classVamanaIndex(index.Index):
19
31
"""
20
-
Open a Vamana index
32
+
Opens a `VamanaIndex`.
21
33
22
34
Parameters
23
35
----------
24
36
uri: str
25
-
URI of the index
37
+
URI of the index.
26
38
config: Optional[Mapping[str, Any]]
27
-
config dictionary, defaults to None
39
+
TileDB config dictionary.
28
40
"""
29
41
30
42
def__init__(
@@ -59,6 +71,9 @@ def __init__(
59
71
self.size=self.base_size
60
72
61
73
defget_dimensions(self):
74
+
"""
75
+
Returns the dimension of the vectors in the index.
76
+
"""
62
77
returnself.dimensions
63
78
64
79
defquery_internal(
@@ -69,16 +84,16 @@ def query_internal(
69
84
**kwargs,
70
85
):
71
86
"""
72
-
Query an VAMANA index
87
+
Queries a `VamanaIndex`.
73
88
74
89
Parameters
75
90
----------
76
-
queries: numpy.ndarray
77
-
ND Array of queries
91
+
queries: np.ndarray
92
+
2D array of query vectors. This can be used as a batch query interface by passing multiple queries in one call.
78
93
k: int
79
-
Number of top results to return per query
94
+
Number of results to return per query vector.
80
95
opt_l: int
81
-
How deep to search. Should be >= k. Defaults to 100.
96
+
How deep to search. Should be >= k, and if it's not, we will set it to k.
82
97
"""
83
98
warnings.warn("The Vamana index is not yet supported, please use with caution.")
84
99
ifself.size==0:
@@ -111,6 +126,23 @@ def create(
111
126
storage_version: str=STORAGE_VERSION,
112
127
**kwargs,
113
128
) ->VamanaIndex:
129
+
"""
130
+
Creates an empty VamanaIndex.
131
+
Parameters
132
+
----------
133
+
uri: str
134
+
URI of the index.
135
+
dimensions: int
136
+
Number of dimensions for the vectors to be stored in the index.
137
+
vector_type: np.dtype
138
+
Datatype of vectors.
139
+
Supported values (uint8, int8, float32).
140
+
config: Optional[Mapping[str, Any]]
141
+
TileDB config dictionary.
142
+
storage_version: str
143
+
The TileDB vector search storage version to use.
144
+
If not provided, use the latest stable storage version.
145
+
"""
114
146
warnings.warn("The Vamana index is not yet supported, please use with caution.")
Copy file name to clipboardExpand all lines: documentation/Building.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,20 @@ Credentials:
71
71
- Some tests run on TileDB Cloud using your current environment variable `TILEDB_REST_TOKEN` - you will need a valid API token for the tests to pass. See [Create API Tokens](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens) for for instructions on getting one.
72
72
- For continuous integration, the token is configured for the `unittest` user and all tests should pass.
73
73
74
+
## Quarto
75
+
76
+
First install quarto with [their instructions](https://quarto.org/docs/get-started) or [with Homebrew](https://formulae.brew.sh/cask/quarto).
77
+
78
+
Then run:
79
+
80
+
```bash
81
+
pip install quartodoc
82
+
quartodoc build
83
+
quarto render --fail-if-warnings
84
+
```
85
+
86
+
You can them open up `docs/documentation/index.html` in a web browser to preview the results.
0 commit comments