Azure / Azure/azure-sdk-for-rust
Cosmos: Support binary vector queries
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
### Feature Summary
Add Cosmos binary encoding support for vector search query responses.
### Feature Description
After the cross-partition vector query work in #5130 and the current binary query work in #5040 and #5070 merge, extend binary response handling to vector search queries, including the non-streaming ordered merge path used by `ORDER BY VectorDistance(...)`.
The implementation should preserve the existing binary negotiation and text-fallback contract, decode service-provided sort-key envelopes without lossy text coercion, and emit merged results in the negotiated response format.
Acceptance criteria:
- Binary responses work for single- and cross-partition vector queries.
- Indexed and brute-force `VectorDistance` queries are supported.
- Finite `TOP` and `OFFSET`/`LIMIT` windows work through the non-streaming ordered merge path.
- Filters and bound vector parameters behave consistently in binary and text modes.
- Text fallback remains supported when the service cannot return binary.
- Tests cover CosmosBinary, JsonText, and fallback behavior without changing default behavior when binary encoding is disabled.
### Use Case
Reduce vector-query response size and preserve binary numeric fidelity while supporting global cross-partition vector ranking.
### Alternatives
Continue using text JSON for vector query responses, which forfeits binary encoding's size and numeric-fidelity benefits.
### Additional Context
Parent epic: #4823
Depends on #5130 and should be implemented after the active query encoding work in #5040 and #5070 lands.
Contributor guide
Research direction
Start by reviewing the cross-partition vector query work in #5130 and the binary query work in #5040 and #5070. Trace Cosmos binary response handling and the non-streaming ordered merge path for ORDER BY VectorDistance(...). Done means single- and cross-partition indexed and brute-force queries support binary responses, text fallback, filters, bound vectors, and the listed windows with coverage for CosmosBinary and JsonText.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, rust
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100