Repository navigation
Description
Summary
Dapr 1.19 adds the search and vector building blocks as alpha APIs. Search stores, reads and queries documents in a full-text search engine. Vector stores, reads and runs similarity queries over dense vectors. The Java SDK has no client API for either yet. The Go SDK implementation (dapr/go-sdk#838) is the reference for this work.
Runtime API
gRPC, in the Dapr service (search.proto, vector.proto). All calls are unary.
Search:
CreateIndexAlpha1,GetIndexAlpha1,ListIndexesAlpha1,DeleteIndexAlpha1IndexDocumentsAlpha1upserts documents by IDGetDocumentsAlpha1returns documents by ID, in request orderDeleteDocumentsAlpha1SearchAlpha1
Vector:
CreateCollectionAlpha1(with dimensions and distance metric),GetCollectionAlpha1,ListCollectionsAlpha1,DeleteCollectionAlpha1UpsertVectorsAlpha1upserts records by IDGetVectorsAlpha1returns records by ID, in request order, and omits missing IDsDeleteVectorsAlpha1QueryVectorsAlpha1BatchQueryVectorsAlpha1runs several queries against one collection. Each query succeeds or fails on its own.
Both blocks share IndexingOptionsAlpha1 on writes and FailedItem in write responses. A write can return when the provider accepts it, or wait up to a timeout for indexing to finish.
HTTP: see the Search API and Vector API references.
Components in 1.19: search.meilisearch, search.in-memory, vector.meilisearch and vector.in-memory.
Reference: the Go SDK
dapr/go-sdk#838 (draft) adds client/search.go and client/vector.go:
- Search methods:
CreateIndexAlpha1,GetIndexAlpha1,ListIndexesAlpha1,DeleteIndexAlpha1,IndexDocumentsAlpha1,GetDocumentsAlpha1,DeleteDocumentsAlpha1andSearchAlpha1. - Vector methods:
CreateCollectionAlpha1,GetCollectionAlpha1,ListCollectionsAlpha1,DeleteCollectionAlpha1,UpsertVectorsAlpha1,DeleteVectorsAlpha1,GetVectorsAlpha1,QueryVectorsAlpha1andBatchQueryVectorsAlpha1. - Shared types:
IndexingOption(WithReturnOnIndexAcceptance,WithWaitForIndexCompletion(timeout, onTimeout)),IndexAck,IndexingResponseandFailedItem. - Search types:
SearchDocument,SearchIndex,SearchQuery,SortClause,SearchHit,SearchResponseandTotalHitsRelation. - Vector types:
VectorCollection,VectorRecord,DistanceMetric,VectorQuery,VectorMatch,VectorQueryResponseandBatchQueryResult. - Each method checks that the store name and the index or collection name are not empty before it calls the sidecar.
The PR is still a draft, so its API can change before it merges.
Other SDKs: the .NET SDK has Dapr.Search (dapr/dotnet-sdk#1944) and Dapr.Vector (dapr/dotnet-sdk#1945). The JavaScript SDK added vector in dapr/js-sdk#928.
Related links: the runtime implementation (dapr/dapr#9974) and the components (dapr/components-contrib#4613).
Scope
- Generated types:
search.protoandvector.protoare already in the proto downloads insdk-autogen/pom.xml. - Add the search methods to
DaprPreviewClient, where the SDK keeps alpha APIs, and implement them inDaprClientImpl. - Add the vector methods to
DaprPreviewClientand implement them inDaprClientImpl. - Add domain types for documents, queries, records and results, so the public API does not expose the generated proto types.
- Add tests, and an example for each block that uses the
search.in-memoryandvector.in-memorycomponents. - Add docs to the Java SDK section of dapr/docs.
The two blocks can ship in separate PRs. The APIs are alpha, so their names and behavior can change in a later release.
Activity
AdepuSriCharan commentedon Nov 7, 2026
I'd like to work on this.
I'd split the work into two PRs: vector first, then search. I've implemented and tested the vector API locally against Dapr 1.19 and would appreciate feedback on the approach before opening a PR.
API. Added methods to
DaprPreviewClient, all returningMono:createVectorCollection,getVectorCollection,listVectorCollections, anddeleteVectorCollection(the last three also have overloads for request metadata).upsertVectorsreturns the acknowledgement and failed items.getVectorsreturnsList<VectorRecord>.deleteVectorsreturnsIndexAck.queryVectorssearches by vector or record ID and returns the matches and effective metric.batchQueryVectorsreturnsList<BatchQueryVectorsResultAlpha1>, with either a response or an error for each query.Types. Domain types are under
io.dapr.client.domain, keeping generated protobuf types out of the public API. Request and response names generally follow the proto with anAlpha1suffix. Two naming choices I'd like to confirm:Vectorwhere the proto name is generic, sinceDaprPreviewClientand the domain package contain multiple building blocks. For example,createVectorCollectionandCreateVectorCollectionRequestAlpha1correspond to the proto'sCreateCollectionAlpha1operation and request.IndexingOptions,IndexAck, andFailedItemare shared with search. I've omitted theAlpha1suffix fromIndexingOptionsfor reuse.Failed items and batch-query errors use
DaprException. Vector values usefloat[], while record payloads usebyte[], consistent with the proto and Go/JS SDKs. I'm open to adjusting these types if preferred.Implementation. Added a package-private
DaprVectorClientusingDaprGrpcCalls, with delegates inDaprClientImpl, following #1875. Requests are validated before calling the sidecar, and malformed responses fail withINTERNAL, similar to the .NET and JS SDKs.Tests. Added unit tests, a Testcontainers integration test, and a
vector.in-memoryexample registered invalidate.yml, following the binary store example in #1870.Does this approach look good? Thanks!
javier-aliaga commentedon Nov 9, 2026
Thanks @AdepuSriCharan ! The approach looks solid to me.