Skip to content

Implement QdrantVectorStore#1086

Merged
malatewang merged 10 commits into
MemMachine:mainfrom
edwinyyyu:qdrant_vector_store
May 1, 2026
Merged

Implement QdrantVectorStore#1086
malatewang merged 10 commits into
MemMachine:mainfrom
edwinyyyu:qdrant_vector_store

Conversation

@edwinyyyu

@edwinyyyu edwinyyyu commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Purpose of the change

Add Qdrant as a vector store backend.

Description

Based on #1379.

Notes:

  • in-memory Qdrant, REST Qdrant, and gRPC Qdrant all have different behaviors that surface at the Python client level.
  • approach for NULL values is to not store the key and use IsEmpty instead of IsNull
    • IsNull requires explicit Null
    • IsEmpty allows IsNull on properties not in the schema
  • also considered making both missing keys and explicitly None keys result in missing key in database -- this requires using IsEmpty instead of IsNull on Qdrant side -- not chosen because for low cardinality NULL filters, explicit NULL + IsNull approach is faster than missing + IsEmpty -- can be reconsidered before merge if storage is a bigger concern
  • schema updates not supported
  • prioritizes CP over AP for registry writes
    - similarity/distance (e.g. proposed WIP: Normalize similarities to [0, 1] #1095) -- we just use the score_threshold naively for now replaced by Define vector similarity score direction and range #1296

Type of change

[Please delete options that are not relevant.]

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Checklist

[Please delete options that are not relevant.]

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

@edwinyyyu edwinyyyu marked this pull request as draft February 10, 2026 18:26
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch 5 times, most recently from 4c523d4 to b0b0187 Compare February 11, 2026 21:33
@edwinyyyu edwinyyyu added the Integration An integration into a 3rd party framework or solution using MemMachine label Feb 13, 2026
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch 2 times, most recently from 6660b8a to 4a18ef4 Compare February 24, 2026 18:07
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch 9 times, most recently from a8004ec to e1fa4d6 Compare March 5, 2026 19:55
@edwinyyyu edwinyyyu marked this pull request as ready for review March 5, 2026 20:07
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch from bfc4c81 to 43e9bda Compare March 5, 2026 21:25
@edwinyyyu edwinyyyu marked this pull request as draft March 6, 2026 22:30
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch from 43e9bda to 18e029c Compare March 6, 2026 23:07
@edwinyyyu edwinyyyu marked this pull request as ready for review March 6, 2026 23:07
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch 2 times, most recently from 04ddb04 to 110e807 Compare March 9, 2026 19:34
@edwinyyyu edwinyyyu requested a review from sscargal April 6, 2026 18:43
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch 2 times, most recently from b08e783 to e06eb12 Compare April 6, 2026 20:30
Not as FilterNot,
)
from memmachine_server.common.filter.filter_parser import (
Or as FilterOr,

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.

probably we should update the variable name in the filter_parser to just make the name to make more sense

@edwinyyyu edwinyyyu Apr 6, 2026

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.

Do you mean the "Or" or something else in "filter_parser"?

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.

I mean we may just rename Or to FilterOr in the filter_parser to make it clearer. Not related to this PR

@edwinyyyu edwinyyyu marked this pull request as draft April 6, 2026 23:43
@edwinyyyu edwinyyyu force-pushed the qdrant_vector_store branch from e06eb12 to 9747369 Compare April 6, 2026 23:56
@edwinyyyu edwinyyyu marked this pull request as ready for review April 6, 2026 23:56
@sscargal sscargal requested a review from Copilot April 7, 2026 22:03

Copilot AI left a comment

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Qdrant as a new vector store backend, including configuration, resource-manager wiring, and a Qdrant-backed VectorStore implementation with tests.

Changes:

  • Introduces QdrantVectorStore / QdrantVectorStoreCollection with support for upsert/query/get/delete plus filter translation.
  • Extends database configuration + DatabaseManager / ResourceManager to provision Qdrant clients and expose a VectorStore.
  • Adds unit + integration tests (including Testcontainers-based Qdrant) and updates dev/test dependencies.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pyproject.toml Extends dev testcontainers extras to include Qdrant.
packages/server/pyproject.toml Adds optional dependency group for qdrant-client.
packages/server/src/memmachine_server/common/vector_store/vector_store.py Extends collection interface with a config property; docstring return type tweak.
packages/server/src/memmachine_server/common/vector_store/qdrant_vector_store.py New Qdrant vector store implementation (collection ops, filters, registry).
packages/server/src/memmachine_server/common/resource_manager/resource_manager.py Exposes get_vector_store() from ResourceManager.
packages/server/src/memmachine_server/common/resource_manager/init.py Updates IResourceManager protocol to include get_vector_store().
packages/server/src/memmachine_server/common/resource_manager/database_manager.py Adds Qdrant client lifecycle + get_vector_store() resolution.
packages/server/src/memmachine_server/common/errors.py Adds QdrantConfigurationError.
packages/server/src/memmachine_server/common/configuration/database_conf.py Adds QdrantConf, provider enum support, parse/serialize integration.
packages/server/server_tests/memmachine_server/conftest.py Adds Qdrant containers + async clients fixtures (REST, gRPC, distributed).
packages/server/server_tests/memmachine_server/common/vector_store/test_qdrant_vector_store.py Comprehensive tests for QdrantVectorStore (unit + integration).
packages/server/server_tests/memmachine_server/common/resource_manager/test_database_manager.py Adds DatabaseManager tests for Qdrant provisioning and validation.
packages/server/server_tests/memmachine_server/common/configuration/test_database_conf.py Adds Qdrant configuration parsing/defaults tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/server/src/memmachine_server/common/vector_store/qdrant_vector_store.py Outdated
Comment thread packages/server/src/memmachine_server/common/vector_store/qdrant_vector_store.py Outdated
Comment thread packages/server/src/memmachine_server/common/resource_manager/database_manager.py Outdated
Comment thread packages/server/src/memmachine_server/common/vector_store/qdrant_vector_store.py Outdated
Comment thread packages/server/src/memmachine_server/common/vector_store/qdrant_vector_store.py Outdated
@sscargal

sscargal commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

@edwinyyyu We likely need to update the sample_config files to show how a user would configure the QDrant database, in lieu of the other database options, as you have in the unit tests.

Do we have any checks for misconfigurations, such as when the user configures more than one storage database, that could cause conflicts? ie: If we configure Neo4j and Qdrant and ...

@edwinyyyu edwinyyyu modified the milestones: v0.3.5, v0.4.0 Apr 7, 2026
@edwinyyyu

edwinyyyu commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

@edwinyyyu We likely need to update the sample_config files to show how a user would configure the QDrant database, in lieu of the other database options, as you have in the unit tests.

Do we have any checks for misconfigurations, such as when the user configures more than one storage database, that could cause conflicts? ie: If we configure Neo4j and Qdrant and ...

It can't be used as a vector_graph_store. The configuration system will reject it because internally it knows the types. There is no way for users to know except by documentation because the configuration file models are not 1-1 with interfaces. #1199 will be one consumer. Before that, specifying a vector store in a configuration file is useless.

@edwinyyyu

Copy link
Copy Markdown
Contributor Author

Tried on_disk option for vectors but didn't see much effect on performance.

@sscargal sscargal left a comment

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.

LGTM

Not as FilterNot,
)
from memmachine_server.common.filter.filter_parser import (
Or as FilterOr,

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.

I mean we may just rename Or to FilterOr in the filter_parser to make it clearer. Not related to this PR

else:
qdrant_filter = partition_key_filter

effective_limit = limit if limit is not None else 10000

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 effective_limit violates the interface definition in vector_store.py. Either update the interface docstring or this function.

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.

It's probably not good to allow limit = None. I will make a separate PR to update the API and rebase this.

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.

Some vector store backends will still require a limit smaller than may be requested, but the new comment should work still since it's a limit rather than a quota.

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration An integration into a 3rd party framework or solution using MemMachine performance Issues relating to MemMachine performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants