Qdrant
Unstable API
0.8.0
@project-lakechain/qdrant-storage-connector
The Qdrant storage connector enables uploading vector embeddings produced by other middlewares to a Qdrant collection.
ℹ️ This middleware interacts with a third-party API outside of your AWS account.
🌲 Adding Documents
Section titled “🌲 Adding Documents”To use the Qdrant storage connector, you import it in your CDK stack, and connect it to a data source providing document embeddings.
💁 You need to specify a Qdrant API key to the connector, by specifying a reference to an AWS Secrets Manager secret containing the API key.
import { QdrantStorageConnector } from '@project-lakechain/qdrant-storage-connector';import { CacheStorage } from '@project-lakechain/core';
class Stack extends cdk.Stack { constructor(scope: cdk.Construct, id: string) { const cache = new CacheStorage(this, 'Cache');
const qdrantApiKey = secrets.Secret.fromSecretNameV2( this, 'QdrantApiKey', process.env.QDRANT_API_KEY_SECRET_NAME as string );
// Create the Qdrant storage connector. const connector = new QdrantStorageConnector.Builder() .withScope(this) .withIdentifier('QdrantStorageConnector') .withCacheStorage(cache) .withSource(source) // 👈 Specify a data source .withApiKey(qdrantApiKey) .withCollectionName('{collection_name}') .withUrl('https://xyz-example.eu-central.aws.cloud.qdrant.io:6333') .build(); }}Store Text
Section titled “Store Text”When the document being processed is a text document, you can choose to store the text of the document in the Qdrant payload. To do so, you can use the withStoreText and withTextKey options. If the document is not a text, this option is ignored.
💁 By default, the text is not included in the index.
const connector = new QdrantStorageConnector.Builder() .withScope(this) .withIdentifier('QdrantStorageConnector') .withCacheStorage(cache) .withSource(source) .withApiKey(qdrantApiKey) .withCollectionName('{collection_name}') .withStoreText(true) .withTextKey('my-content') .withUrl('https://xyz-example.eu-central.aws.cloud.qdrant.io:6333') .build();Configure Named vector
Section titled “Configure Named vector”Since Qdrant supports multiple vectors per entry, you can use the withVectorName option to specify one.
The connector defaults to unnamed (default) vector.
💁 By default, the text is not included in the index.
const connector = new QdrantStorageConnector.Builder() .withScope(this) .withIdentifier('QdrantStorageConnector') .withCacheStorage(cache) .withSource(source) .withApiKey(qdrantApiKey) .withCollectionName('collection_name') .withVectorName('my-vector-name') .withUrl('https://xyz-example.eu-central.aws.cloud.qdrant.io:6333') .build();🏷️ Properties
Section titled “🏷️ Properties”Supported Inputs
Section titled “Supported Inputs”| Mime Type | Description |
|---|---|
*/* |
This middleware supports any type of documents. Note that if no embeddings are specified in the document metadata, the document is filtered out. |
Supported Outputs
Section titled “Supported Outputs”This middleware does not produce any output.
Supported Compute Types
Section titled “Supported Compute Types”| Type | Description |
|---|---|
CPU |
This middleware only supports CPU compute. |
📖 Examples
Section titled “📖 Examples”- Bedrock + Qdrant Pipeline - An example showcasing an embedding pipeline using Amazon Bedrock and Qdrant.