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
Adding documentation for DQL enhancements in order to support vector
type and similarity search.
---------
Co-authored-by: Jonathan Zollinger <[email protected]>
Co-authored-by: Raphael <[email protected]>
Co-authored-by: ShivajiKharse <[email protected]>
Co-authored-by: Ryan Fox-Tyler <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,5 +106,6 @@ Pass custom Go-GRPC example to the runnable by passing a `customExampleGoGRPC` t
106
106
**Note:** Runnable doesn't support passing a multiline string as an argument to a shortcode. Therefore, you have to create the whole custom example in a single line string by replacing newlines with `\n`.
107
107
108
108
## History
109
+
v24.0:
110
+
=======
109
111
add Hypermode banner by updating the hugo-docs repository with topbat template.
@@ -112,6 +117,15 @@ For all triples with a predicate of scalar types the object is a literal.
112
117
are RFC 3339 compatible which is different from ISO 8601(as defined in the RDF spec). You should
113
118
convert your values to RFC 3339 format before sending them to Dgraph.{{% /notice %}}
114
119
120
+
### Vector Type
121
+
122
+
The `float32vector` type denotes a vector of floating point numbers, i.e an ordered array of float32. A node type can contain more than one vector predicate.
123
+
124
+
Vectors are normaly used to store embeddings obtained from other information through an ML model. When a `float32vector` is [indexed]({{<relref "dql/predicate-indexing.md">}}), the DQL [similar_to]({{<relref "query-language/functions#vector-similarity-search">}}) function can be used for similarity search.
125
+
126
+
127
+
128
+
115
129
### UID Type
116
130
117
131
The `uid` type denotes a relationship; internally each node is identified by it's UID which is a `uint64`.
|`similar_to`|`hsnw`| HSNW index supports parameters `metric` and `exponent`. |
55
+
56
+
57
+
#
58
+
59
+
`hsnw` (**Hierarchical Navigable Small World**) index supports the following parameters
60
+
- metric : indicate the metric to use to compute vector similarity. One of `cosine`, `euclidean`, and `dotproduct`. Default is `euclidean`.
61
+
62
+
- exponent : An integer, represented as a string, roughly representing the number of vectors expected in the index in power of 10. The exponent value,is used to set "reasonable defaults" for HSNW internal tuning parameters. Default is "4" (10^4 vectors).
Alternatively the vector can be passed as a variable: `similar_to(predicate, 3, $vec)`
185
+
186
+
This function finds the nodes that have `predicate` close to the provided vector. The search is based on the distance metric specified in the index (`cosine`, `euclidean`, or `dotproduct`). The shorter distance indicates more similarity.
187
+
The second parameter, `3` specifies that top 3 matches be returned.
188
+
189
+
Schema Types: `float32vector`
190
+
191
+
Index Required: `hnsw`
192
+
193
+
194
+
180
195
## Full-Text Search
181
196
182
197
Syntax Examples: `alloftext(predicate, "space-separated text")` and `anyoftext(predicate, "space-separated text")`
0 commit comments