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: manual/english/Creating_a_table/Local_tables/Plain_and_real-time_table_settings.md
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,25 +471,45 @@ Each vector attribute stores an array of floating-point numbers that represent d
471
471
472
472
##### Configuring KNN for vector attributes
473
473
474
-
To enable KNN searches on float vector attributes, you must add a `knn` configuration that specifies the indexing parameters:
474
+
To enable KNN searches on float vector attributes, you must add a `knn` configuration that specifies the indexing parameters. You can configure KNN in two ways:
475
+
476
+
**1. Manual vector insertion** (you provide pre-computed vectors):
-`name`: The name of the vector attribute (must match the `rt_attr_float_vector` name)
484
495
-`type`: Index type, currently only `"hnsw"` is supported
485
-
-`dims`: Number of dimensions in the vectors (must match your embedding model's output)
496
+
-`dims`: Number of dimensions in the vectors. **Required** for manual vector insertion, **must be omitted** when using `model_name` (the model determines dimensions automatically)
486
497
-`hnsw_similarity`: Distance function - `"L2"`, `"IP"` (inner product), or `"COSINE"`
487
498
488
499
**Optional KNN parameters:**
489
-
-`hnsw_m`: Maximum connections in the graph
490
-
-`hnsw_ef_construction`: Construction time/accuracy trade-off
500
+
-`hnsw_m`: Maximum connections in the graph (default: 16)
501
+
-`hnsw_ef_construction`: Construction time/accuracy trade-off (default: 200)
502
+
503
+
**Auto-embeddings parameters** (when using `model_name`):
504
+
-`model_name`: The embedding model to use (e.g., `"sentence-transformers/all-MiniLM-L6-v2"`, `"openai/text-embedding-ada-002"`). When specified, `dims` must be omitted as the model determines the dimensions automatically.
505
+
-`from`: Comma-separated list of field names to use for embedding generation, or empty string `""` to use all text/string fields. This parameter is required when `model_name` is specified.
506
+
-`api_key`: API key for API-based models (OpenAI, Voyage, Jina). Only required for API-based embedding services.
507
+
-`cache_path`: Optional path for caching downloaded models (for sentence-transformers models).
508
+
-`use_gpu`: Optional boolean to enable GPU acceleration if available.
509
+
510
+
**Important:** You cannot specify both `dims` and `model_name` in the same configuration - they are mutually exclusive. Use `dims` for manual vector insertion, or `model_name` for auto-embeddings. Use `dims` for manual vector insertion, or `model_name` for auto-embeddings.
491
511
492
-
For more details on KNN vector search, see the [KNN documentation](../../Searching/KNN.md).
512
+
For more details on KNN vector search and auto-embeddings, see the [KNN documentation](../../Searching/KNN.md).
**Note:** For auto-embeddings in plain mode, see the example below, which shows how to use `model_name` and `from` parameters in the `knn` configuration.
- When using `model_name`, you **must not** specify `dims` - the model automatically determines the vector dimensions. The `dims` and `model_name` parameters are mutually exclusive.
156
+
- When **not** using `model_name` (manual vector insertion), you **must** specify `dims` to indicate the vector dimensions.
157
+
- The `from` parameter specifies which fields to use for embedding generation (comma-separated list, or empty string for all text/string fields). This parameter is required when using `model_name`.
158
+
- For API-based models (OpenAI, Voyage, Jina), include the `api_key` parameter in the knn configuration
0 commit comments