Detailed information on the in-memory vector component
The in-memory vector store keeps every collection in the memory of the Dapr sidecar. Use it for local development and tests that need no external vector database. It is not durable: collections and records are lost when the sidecar stops, and they aren’t shared between sidecar instances.
Component format
To set up an in-memory vector store, create a component of type vector.in-memory. See this guide on how to create and apply a vector store configuration.
Queues every write and applies it once this delay has passed, so that you can test queued acknowledgements and wait timeouts. Defaults to "0s", which applies writes before the call returns.
"2s"
Supported features
Feature
Supported
Details
Dense vectors
Y
Distance metrics
Cosine, dot product, Euclidean
DISTANCE_METRIC_UNSPECIFIED selects cosine when a collection is created. A query can use a different metric from the collection’s.
Query by ID
Y
A byId that matches no record fails that query with NOT_FOUND.
Score threshold
Y
Metadata filtering
Y
Batch query
Y
Each query is evaluated independently.
Queued acknowledgement
Y
Writes return INDEX_ACK_QUEUED when indexingDelay is set, so INDEXING_WAIT_TIMEOUT_ACTION_CONTINUE_ASYNC is supported. Without a delay, writes return INDEX_ACK_COMPLETED.
Wait for completion
Y
With indexingDelay set, the request waits for the queued write, up to waitTimeout.
Queries and records
A query compares the query vector with every record in the collection, so query time grows with the number of records.
A record whose number of values differs from the collection’s dimensions, or whose values aren’t finite numbers, is reported in failedItems with INVALID_ARGUMENT. Under cosine similarity, a vector whose values are all zero is also rejected. The rest of the records are still written.
When topK isn’t set, the component returns up to 10 matches.
Detailed information on the Meilisearch vector component
Component format
To set up a Meilisearch vector store, create a component of type vector.meilisearch. See this guide on how to create and apply a vector store configuration.
A collection is a Meilisearch index with a single userProvided embedder named default with the requested dimensions. Record metadata is filterable by default.
You can pass the following Meilisearch index settings as comma-separated values in the metadata of a create collection request:
Metadata
Details
Example
filterableAttributes
Additional Meilisearch attributes to declare as filterable. daprMetadata is always filterable.
"daprMetadata.year"
sortableAttributes
Meilisearch attributes to declare as sortable.
"daprMetadata.year"
Creating a collection that already exists returns ALREADY_EXISTS and doesn’t change its settings. Collections share the Meilisearch instance with search indexes: list collections only returns indexes that have the default user-provided embedder, and getting or deleting any other index as a collection, or upserting or deleting records in it, returns FAILED_PRECONDITION.
Get collection returns the following properties: primaryKey (always id), filterableAttributes, and sortableAttributes when set.
Record mapping
The record id is the Meilisearch primary key. It must be 1 to 511 bytes of ASCII letters, digits, hyphens, and underscores.
The record values are stored in _vectors.default.
The record metadata is stored as the daprMetadata object. Filter paths are translated to daprMetadata.<path>, so a filter on dealer.city addresses daprMetadata.dealer.city.
The record payload is stored base64-encoded under the daprPayload attribute.
Distance metric and scores
Meilisearch only supports cosine similarity for user-provided embeddings. DISTANCE_METRIC_UNSPECIFIED selects cosine, and any other metric in a create collection or query request returns INVALID_ARGUMENT. Because cosine similarity is undefined for a vector whose values are all zero, such vectors, and vectors with values that aren’t finite numbers, are rejected with INVALID_ARGUMENT.
For a vector query, Meilisearch reports a normalised ranking score of (1 + cosine) / 2. The component converts it back so that match scores are the cosine similarity in [-1, 1], and translates a scoreThreshold of t into a Meilisearch rankingScoreThreshold of (1 + t) / 2. A scoreThreshold outside [-1, 1] returns INVALID_ARGUMENT.
When topK isn’t set, the component returns up to 10 matches.
Waiting for writes
Meilisearch processes writes asynchronously as tasks. With INDEXING_MODE_WAIT_FOR_COMPLETION, the component waits for the task to finish by polling the Meilisearch task API with exponential backoff.
When the experimental Meilisearch tasksStreamingRoute feature is enabled and the API key has the tasks.get permission, the component instead shares a single task-change stream for all waiting writes. If the route reports that it is unavailable, the component falls back to polling. The choice is transparent to your application.
A Meilisearch task is atomic: if the task fails, none of the records in it are written, and a request that waits for completion fails with the task’s error. The component therefore checks the records that Meilisearch would reject before it sends the task. A record with an invalid id, no vector values, a number of values that differs from the collection’s dimensions, or a vector with a zero norm or non-finite values is reported in failedItems with INVALID_ARGUMENT, and the rest of the records are still written.
Upserting into a collection that doesn’t exist fails the request with NOT_FOUND.