Qdrant
Public exports from @anvia/qdrant.
Import from @anvia/qdrant.
QdrantVectorStoreConnectOptions
type QdrantDistance = "Cosine" | "Dot" | "Euclid";
type QdrantVectorStoreConnectOptions = {
client?: QdrantClientLike;
collectionName: string;
vectorSize: number;
createIfMissing?: boolean;
distance?: QdrantDistance;
};Purpose: connection options for a Qdrant collection.
Return behavior: consumed by QdrantVectorStore.connect(...).
Notable errors: missing collections reject when createIfMissing is false; collection creation requires vectorSize.
Design note: connect(...) performs async collection lookup or creation before returning a store. This keeps constructors synchronous and side-effect free while making connection and configuration failures happen before ingestion or search.
QdrantVectorStore
class QdrantVectorStore<T, Metadata extends VectorMetadata = VectorMetadata> {
static connect<T, Metadata extends VectorMetadata = VectorMetadata>(
options: QdrantVectorStoreConnectOptions,
): Promise<QdrantVectorStore<T, Metadata>>;
upsertDocuments(documents: Array<EmbeddedDocument<T, Metadata>>): Promise<void>;
index(model: EmbeddingModel): QdrantVectorIndex<T, Metadata>;
}Purpose: Qdrant-backed document storage.
Return behavior: connect(...) resolves a store; index(...) binds it to an embedding model.
Notable errors: connection and upsert calls reject on Qdrant errors; upsertDocuments(...) throws when a document has no embeddings or metadata uses reserved __anvia_* keys.
QdrantVectorIndex
class QdrantVectorIndex<T, Metadata extends VectorMetadata = VectorMetadata>
implements VectorSearchIndex<T, Metadata> {
search(request: VectorSearchRequest): Promise<Array<VectorSearchResult<T, Metadata>>>;
searchIds(request: VectorSearchRequest): Promise<Array<{ score: number; id: string }>>;
asTool(options: VectorSearchToolOptions): Tool<{ query: string; topK?: number }, unknown>;
}Purpose: query-time Qdrant search adapter.
Return behavior: embeds the query, calls Qdrant, deduplicates multi-embedding document IDs, and returns normalized results.
Notable errors: embedding or Qdrant query failures reject.
filterToQdrantFilter
function filterToQdrantFilter(filter: VectorFilter | undefined): unknown;Purpose: convert Anvia vector filters to Qdrant payload filters.
Return behavior: returns undefined when no filter is supplied.
Notable errors: none directly.
