Repository navigation
Conversation
Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Mike Nguyen <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
|
|
||
| This is a proposal surrounding the implementation of two new specialised state stores without bringing into | ||
| scope the deep integrations planned on implementation of these building blocks. Whilst the two building | ||
| blocks share almost the same envelope, the method of requesting the records can vary significantly and should |
There was a problem hiding this comment.
I'm wondering if it'd make sense to ship a single building block with both of the APIs combined into one. With a single component, we get a unified API for index/upsert/delete documents, and different endpoints for fetching, one for lexical search and one for vector search.
This would be beneficial if a user needs to use both APIs at the same time.
There was a problem hiding this comment.
Unless there's some scenario you can think of where a query to a provider might do some sort of join operation between lexical and vector searches (e.g. we can offload that heavy lifting to the provider - we absolutely should not do any manipulation of this data in the runtime), I would vote they remain separate.
This obviates the need for another (and differing) capabilities functionality at the building block level, it keeps the APIs for each building block simple and focused and it potentially improves the rate at which provider implementations can be developed and added (e.g. they need only implement the API associated with one block at a time, not have to implement a broader set just for v1.0).
Especially if the results from either are instead used alongside local logic in the app, that's the domain of the SDK to offer a usage smooth experience where it's the domain of the runtime to establish connectivity, issue commands and perform data transfer. I think runtime's role is better suited to small, lean building block APIs going forward.
There was a problem hiding this comment.
I was considering this too - I can make it clearer in the proposal but I share the same sentiment as Whit.
The two building blocks can be objectively very different. I feel like it may be running the risk of becoming a feature flag mess/very confusing for implementation where providers have differing feature sets that fall distinctly within the lexical or vector search buckets.
We should focus on having distinct building blocks, if you need to use both APIs at the same time then you'd just need to register another component type with the same provider.
There was a problem hiding this comment.
One thing I'd love to see explicitly spelled out is the story for someone who wants to use both search & vector against the same provider. From ^ it sounds like the answer is to register 2 components pointing to the same server.
When that happens, is the underlying data shared - so an item indexed for search and its vector can be tied together by a common ID or are they independent? I think that matters with AI use cases where you might want to store something once and both search it by keyword && find it by similarity.
And is there a scenario where a single query should do both at once - keyword & similarity combined by the provider itself?
There was a problem hiding this comment.
Rather than trying to design a feature like @cicoyle is describing as a one-off feature for this, I'd much rather take that idea back to the drawing board and figure out if the idea is applicable across more components and design that as a separate runtime feature than necessarily jam in something that potentially complex as a one-off here. Seems like that would dramatically increase the complexity of what's otherwise a pretty straightforward proposal here.
| } | ||
|
|
||
| message BatchQueryVectorsRequestAlpha1 { | ||
| string store_name = 1; |
There was a problem hiding this comment.
I see store_name && collection here and inside QueryVectorsRequestAlpha1 - shall we trim the inner msg?
| The current implementations of state stores do not accomodate the necessity to access data not only by | ||
| key-value but an extended querying layer. New 'specialised' building blocks facilitate rapid development. | ||
|
|
||
| There is a specific need from AI workloads to not only query by key but also by 'relevant' records returned |
There was a problem hiding this comment.
Can you add a Use Cases section? I believe it would help ground the separate vs combined API decision - might be good to note under an Alternatives Considered section or similar. There are RAG/agent retrieval patterns where lexical & vector results get fused together. I believe its a first class AI usecase that should be considered, rather than it being an edge case. Its worth deciding if we should have the APIs separate and/or have a hybrid, even if the hybrid API is out of scope for now - it should be thought thru ahead of implementation to prevent breaking changes later on.
There was a problem hiding this comment.
One of the key ideas of my proposal to split out into discrete building blocks is to explicitly pivot away from what the key/value state store turned into: a far more use-case governed platform with runtime shims holding together what providers failed to provide.
I would dramatically prefer that if there's an AI use-case, it be proposed as a separate block - more of a composite component that's able to express the individual functionality but which only applies to those providers that can do both operations. This is a central tenant of my handily rejected planes proposal, but is exactly along the lines of what I was thinking.
Some people will just need a vector store. Some people will just need a search store. For those that need both, build something that specifically speaks to that use-case but atop far more generic basic components.
There was a problem hiding this comment.
Addressed in the scope boundary
|
|
||
| This is a proposal surrounding the implementation of two new specialised state stores without bringing into | ||
| scope the deep integrations planned on implementation of these building blocks. Whilst the two building | ||
| blocks share almost the same envelope, the method of requesting the records can vary significantly and should |
There was a problem hiding this comment.
One thing I'd love to see explicitly spelled out is the story for someone who wants to use both search & vector against the same provider. From ^ it sounds like the answer is to register 2 components pointing to the same server.
When that happens, is the underlying data shared - so an item indexed for search and its vector can be tied together by a common ID or are they independent? I think that matters with AI use cases where you might want to store something once and both search it by keyword && find it by similarity.
And is there a scenario where a single query should do both at once - keyword & similarity combined by the provider itself?
Signed-off-by: Mike Nguyen <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
Signed-off-by: Mike Nguyen <hey@mike.ee>
nelson-parente
left a comment
There was a problem hiding this comment.
I reviewed the implementation in dapr/components-contrib#4613 and dapr/dapr#9974 against this text at 4339cda. The code follows the proposal closely, and the protos and HTTP routes match it one for one. The open threads are further along than the PR page shows.
Five threads are answered in the text but still open. @mikeee, resolve them with a pointer to the line, then @cicoyle can re-review against a short list.
- Score direction: the
VectorMatch.scorecomment and the vector score table.proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 709 to 723 in 4339cda
- A reason code on failed items:
FailedItem.erroris agoogle.rpc.Status.proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 217 to 223 in 4339cda
- Offset or cursor: opaque continuation tokens.
proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 401 to 426 in 4339cda
- Inner
store_nameandcollectionon batch queries: the text says they are ignored.proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 730 to 731 in 4339cda
- One block or two: the opening paragraph keeps them separate.
proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 7 to 10 in 4339cda
What the text still needs. Each item below is something the code already decided and the proposal does not say.
- Use Cases, and whether one index can back both blocks. Cassie's follow-up on the one-or-two thread asked whether the two components can share data. The code answers it by accident: point the vector component at an index the search component created and
GetCollectionreportsDimensions: 0as if it were a valid collection. Hybrid retrieval is the main RAG pattern, and today the text only lists it as deferred. A short Use Cases section settles both threads. It needs to say what a user who wants lexical and vector results over the same documents does in alpha. - An empty search query. The
oneofallows neithertextnornative. The runtime forwards that to the component, Meilisearch treats it as match-all, and its conformance suite depends on that. The contrib doc comment says "exactly one", and the runtime validation list covers the vectoroneofbut not this one. Write the rule down.proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 739 to 749 in 4339cda
- Inner batch fields. Ignoring them means a caller who sets a different collection on one query gets results from another collection without an error. Alpha is the time to remove the two fields, which is what Cassie asked. The other option is to reject a value that differs from the batch.
- The HTTP error body. The runtime renders a component status error with the
google.rpc.Codename aserrorCode, for exampleNOT_FOUND, next to the existingERR_*codes. The component error contract section covers gRPC only. This is a new HTTP contract, so it belongs here.proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 758 to 768 in 4339cda
- Token binding. The text binds a continuation token to "component-declared result-affecting metadata", but nothing defines how a component declares it, and the Meilisearch fingerprint leaves metadata out. Define the mechanism or drop the clause.
proposals/20260428-BCRS-Search-and-vector-blocks.md
Lines 412 to 413 in 4339cda
Observability is deferred to beta, which is fine, and the code matches that. The code-level findings are on #4613 and #9974.
Purely a building block implementation of the search and vector stores