ProtectedColocatedThe host relational connection a colocated provider borrows to store and query
vectors in the same database as the application's entity data. undefined until
SetColocatedHost (or TryWireColocatedHost) is called.
ProtectedApiOnly sub-classes can access the API key
Access the underlying Qdrant client for advanced operations.
True when this driver does not accept ingestion via CreateRecord(s) /
UpdateRecord(s) — implies vectors are managed out-of-band (e.g.
SimpleVectorServiceProvider reads embeddings directly from
MJ: Entity Record Documents.VectorJSON). Pipelines that would
otherwise call ingestion APIs should short-circuit when this is true
to avoid spurious "unsupported" error logs.
Subclasses that genuinely support ingestion leave the default false.
Whether this provider's QueryIndex/HybridQuery params.id is the EntityDocumentID
(a GUID) rather than an external/logical index name. External services (Pinecone, Qdrant)
and DB-colocated providers key by an index name and return false (the default). The
in-process SimpleVectorServiceProvider reads vectors out of
MJ: Entity Record Documents keyed by EntityDocumentID, so it overrides this to true.
Callers that hold both identifiers (e.g. the duplicate-record detector) consult this to
pass the correct id for the resolved provider instead of assuming index-name semantics.
Whether this provider requires an API key / credential to operate. Defaults to true
for external, cloud-hosted vector services (Pinecone, Qdrant, …). Override and return
false for in-process / local providers that authenticate via the host process or the
application's own database rather than a remote credential — e.g. the in-memory
SimpleVectorServiceProvider, which reads vectors out of MJ: Entity Record Documents.VectorJSON and never calls an external service.
Callers that gate on a missing key (e.g. the Entity Vector Sync pipeline and the duplicate-record detector) consult this so a keyless local provider isn't rejected with a spurious "No API Key found" error.
Whether this provider stores vectors inside the application's relational database and
can resolve query results to entity records without an external mapping hop. Override
and return true in colocated providers (e.g. PgVectorColocated, SQLServerVectorDatabase).
Whether this provider supports hybrid (vector + keyword) search. Override and return true in providers that implement HybridQuery().
Build a Qdrant-native filter from the shared SharedIndexFilterOptions interface used across all MJ vector providers.
The shared filter options (EntityName, RecordIDs, etc.) are first converted to
generic MetadataFilterCondition objects via VectorMetadataFilter.BuildConditions,
then translated into Qdrant's structured filter format. The resulting filter uses
must clauses with match.value for equality and match.any for set membership.
The provider-agnostic filter options.
A Qdrant filter object suitable for passing as QueryOptions.filter,
or undefined if the options produce no conditions.
Build per-record routing and operational directives for this provider.
Called by the generic sync pipeline once per source database row, before the
VectorRecord is constructed. The returned object is stored on
VectorRecord.providerTemporaryDirectives and passed to CreateRecords alongside
the stored metadata — but is never itself persisted in the vector index.
Providers override this to extract whatever routing values they need from
providerConfig (the parsed VectorIndex.ProviderConfig JSON) and from
sourceRecord (the raw database row). Example: the Pinecone driver reads
providerConfig.namespaceField, looks up the corresponding value in sourceRecord,
and returns { namespace: '<orgId>' } so CreateRecords can route each vector
to the correct Pinecone namespace without embedding org data in the stored metadata.
The default implementation returns an empty object — providers that do not need per-record routing need not override this method.
The raw database row being vectorized.
The parsed VectorIndex.ProviderConfig JSON blob.
An opaque key/value map consumed by this provider's CreateRecord(s).
Run a colocated query that fuses a vector component with an optional keyword component
in a single server-side statement, applying an optional metadata filter. Only meaningful
when SupportsColocatedQuery is true; the default implementation throws to surface
misuse on providers that don't support it.
Optional_contextUser: UserInfoCreate a new Qdrant collection with the specified vector configuration.
Additional Qdrant-specific collection parameters (e.g., HNSW config,
quantization, replication factor) can be passed via params.additionalParams.
Index creation parameters including id (collection name),
dimension (vector size), metric (distance type), and optional
additionalParams for Qdrant-specific settings.
A BaseResponse indicating success or failure.
Insert or update a single vector record (point) into a collection. Delegates to CreateRecords with a single-element array.
The vector record to upsert (id, values, and optional metadata).
OptionalindexName: stringThe target collection name. Required.
A BaseResponse indicating success or failure.
Insert or update multiple vector records (points) into a collection via upsert.
Array of vector records to upsert.
OptionalindexName: stringThe target collection name. Required.
A BaseResponse indicating success or failure.
Delete all points from a collection by dropping and recreating it with the same vector configuration. Qdrant does not expose a native "truncate" operation.
Warning: This resets all optimizer and indexing state for the collection.
The target collection name.
Optional_namespace: stringIgnored; Qdrant does not use namespaces.
A BaseResponse indicating success or failure.
Delete a Qdrant collection and all its points permanently.
Request parameters; params.id must be the collection name.
A BaseResponse indicating success or failure.
Delete a single point from a Qdrant collection. Delegates to DeleteRecords with a single-element array.
The record to delete; only record.id is used.
OptionalindexName: stringThe target collection name. Required.
A BaseResponse indicating success or failure.
Delete multiple points from a Qdrant collection in a single batch operation.
The records to delete; only their id fields are used.
OptionalindexName: stringThe target collection name. Required.
A BaseResponse indicating success or failure.
Update collection-level parameters such as optimizer configuration and indexing
thresholds. Pass Qdrant-specific update parameters via params.data.
Edit parameters; params.id is the collection name and params.data
contains the Qdrant updateCollection payload.
A BaseResponse indicating success or failure.
Get detailed information about a specific collection including its actual dimension and distance metric.
Request parameters; params.id must be the collection name.
A BaseResponse whose data is an IndexDescription on success,
or a failure response if the collection does not exist.
Retrieve a single point by ID. Delegates to GetRecords.
Request parameters. params.id is the point ID and
params.data.collectionName identifies the target collection. Both are required.
A BaseResponse whose data is an array of VectorRecord
objects on success, or a failure response on error.
Retrieve multiple points by their IDs from a Qdrant collection.
Request parameters. params.data.collectionName is the target
collection and params.data.ids is the array of point IDs to retrieve.
If ids is not provided, params.id is used as a single-element list.
A BaseResponse whose data is an array of VectorRecord
objects on success, or a failure response on error.
Perform a hybrid search combining vector similarity with keyword (BM25) matching. Only available on providers where SupportsHybridSearch is true. Default implementation falls back to a standard vector QueryIndex call.
OptionalcontextUser: UserInfoList all collections (indexes) in the connected Qdrant instance.
Note: The Qdrant list endpoint does not return per-collection vector configuration,
so dimension is reported as 0 and metric as 'cosine' for every entry.
Use GetIndex for accurate details.
An IndexList containing descriptions of every collection. Returns an empty list on error.
List vector IDs using Qdrant's scroll API with optional metadata filtering and cursor-based pagination.
Parameters including IndexName (collection name), optional Limit
(default 100), optional PaginationToken (Qdrant scroll offset from a
previous call), and optional MetadataFilter (key-value pairs translated
to Qdrant must match conditions).
A ListVectorIDsResult with the matching IDs and an optional
NextPaginationToken for the next page.
Query the vector index with metadata filtering using SharedIndexFilterOptions.
Default implementation converts the filter options to a native filter object and delegates to QueryIndex. Providers can override BuildMetadataFilter() for custom filter syntax.
Standard query options with an additional metadataFilter field
OptionalcontextUser: UserInfoThe query response from the vector database
Perform an approximate nearest-neighbor search against a Qdrant collection.
Two query modes are supported:
params.vector is provided, searches directly with that vector.
params.id is interpreted as the collection name.params.id is provided, retrieves the point's vector
first, then uses it as the query vector.Query options including:
vector (number[]) -- the query embedding.id (string) -- collection name (when vector is present) or point ID.topK (number) -- maximum results to return (default 10).includeMetadata (boolean) -- include payload in results (default true).includeValues (boolean) -- include vectors in results (default false).filter (object) -- optional Qdrant-native filter.Optional_contextUser: UserInfoA BaseResponse whose data contains { matches, namespace },
or a failure response on error.
Wire in the host relational connection so this provider reuses it for colocated storage and queries instead of opening its own pool. No-op semantics for providers that ignore it; colocated providers require it before any operation.
Convenience used by callers that hold an opaque provider reference (the active MJ data
provider). If host implements IColocatedVectorHost and this provider supports
colocated queries, wire it in.
true if the host was wired in, false otherwise.
Update a single record. Delegates to UpdateRecords.
If the record includes values, the point is upserted (vector + payload replaced).
If only metadata is provided (no values), the payload is updated in place
via Qdrant's setPayload operation without touching the vector.
Update options including id, optional values, optional metadata,
and data.collectionName (required).
A BaseResponse indicating success or failure.
Update one or more records in a Qdrant collection.
Records with values are upserted (full point replacement). Records with only
metadata (no values) are updated via setPayload to modify the payload
without changing the vector.
Update options. Must include data.collectionName. For batch
operations, provide data.records as an array of individual update options.
For single-record updates, the top-level id/values/metadata are used.
A BaseResponse indicating success or failure.
ProtectedwrapBuild a standard FAILURE BaseResponse.
Always return this (never a success response) from a catch block — returning a
success response on error silently swallows real failures and makes callers, and the
vectorization pipeline, believe an operation worked when it did not.
Optionalmessage: stringOptional human-readable error detail; falls back to a generic message.
ProtectedwrapBuild a standard SUCCESS BaseResponse. Shared across all drivers so every provider reports results in a uniform shape.
The provider-specific payload to attach to the response.
MemberJunction vector database provider backed by Qdrant, a high-performance open-source vector similarity search engine.
How it works: Each logical "index" maps to a Qdrant collection. A collection stores points consisting of an ID, a dense vector embedding, and an arbitrary JSON payload (metadata). The provider uses the official
@qdrant/js-client-restclient for all communication with the Qdrant server.Connection: Configure the server URL via
QDRANT_URL(defaults tohttp://localhost:6333) and optionally an API key viaQDRANT_API_KEY(required for Qdrant Cloud). TheapiKeyconstructor parameter is forwarded directly to the Qdrant client.Distance metrics: Supports
cosine(default),euclidean, anddotproduct, mapped to Qdrant'sCosine,Euclid, andDotdistance types respectively.Metadata filtering: Supports both Qdrant-native
must/should/must_notfilter syntax and the sharedSharedIndexFilterOptionsinterface used across all MJ vector providers. Conditions are converted to Qdrant's structured filter format via BuildMetadataFilter.Registered with the MJ class factory as
'QdrantDatabase'.