Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve vector store API#1201

Merged
malatewang merged 24 commits into
MemMachine:mainfrom
edwinyyyu:batch_vectors
Apr 2, 2026
Merged

Improve vector store API#1201
malatewang merged 24 commits into
MemMachine:mainfrom
edwinyyyu:batch_vectors

Conversation

@edwinyyyu
Copy link
Copy Markdown
Contributor

@edwinyyyu edwinyyyu commented Mar 9, 2026

Motivation:

  • Update APIs to be easier to read, work with, and extend.
  • Support more efficient operations.
  • Define concurrency models for horizontal scaling.

Changes:

  • query now returns an Iterable with one item per query vector.
  • Add collection startup and shutdown for cases where collection must be loaded.
  • Support multitenancy via sharding and define concurrency guarantees.
  • Fix default booleans to match docstring comments.
  • Naming constraints.

Details:

  • Most vector databases recommend against one collection per tenant, and empirical tests show that many collections induces significant overhead.
  • We guarantee safe concurrent usage on a single process.
  • We guarantee safe concurrent sharded usage (one node per logical collection) on multiple processes.

Naming constraints determined by lowest common denominators for support.

@edwinyyyu edwinyyyu changed the title Improve vector query return value Improve vector store API based on discussions Mar 10, 2026
@edwinyyyu edwinyyyu marked this pull request as draft March 11, 2026 18:43
@edwinyyyu edwinyyyu changed the title Improve vector store API based on discussions Improve vector store API Mar 13, 2026
@edwinyyyu
Copy link
Copy Markdown
Contributor Author

Blocks #1199, #1205

@edwinyyyu edwinyyyu marked this pull request as ready for review March 13, 2026 19:54
@edwinyyyu edwinyyyu mentioned this pull request Mar 14, 2026
26 tasks
@edwinyyyu edwinyyyu force-pushed the batch_vectors branch 3 times, most recently from b3b2a57 to cf599b4 Compare March 17, 2026 23:37
async def upsert(
self,
*,
partition_key: str,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need partition here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

) -> None:
"""
Create a collection in the vector store.
Create a logical collection in the vector store and return a handle to it.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type should be Collection

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In open_or_create_collection.


@abstractmethod
async def delete_collection(self, collection_name: str) -> None:
async def open_collection(self, *, namespace: str, name: str) -> Collection:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return type should be Collection | None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@edwinyyyu edwinyyyu requested a review from malatewang March 18, 2026 00:53
@edwinyyyu
Copy link
Copy Markdown
Contributor Author

Before merge, need to check that (de)serialization is deterministic.

@edwinyyyu
Copy link
Copy Markdown
Contributor Author

edwinyyyu commented Mar 18, 2026

Before merge, need to check that (de)serialization is deterministic.

Tests work now on Qdrant implementation branch.

@edwinyyyu edwinyyyu force-pushed the batch_vectors branch 3 times, most recently from d69686f to 69fa649 Compare March 27, 2026 19:24
edwinyyyu added 18 commits April 1, 2026 22:14
Signed-off-by: Edwin Yu <[email protected]>
This reverts commit 08ecc96.
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
Signed-off-by: Edwin Yu <[email protected]>
@malatewang malatewang merged commit a7c2d0e into MemMachine:main Apr 2, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants