Home / Function/ from_existing_collection() — langchain Function Reference

from_existing_collection() — langchain Function Reference

Architecture documentation for the from_existing_collection() function in qdrant.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  01876da1_fe36_ce29_f72f_3bc6e76349db["from_existing_collection()"]
  671b47a0_cdd3_a89d_e90f_0631a4bd67d3["QdrantVectorStore"]
  01876da1_fe36_ce29_f72f_3bc6e76349db -->|defined in| 671b47a0_cdd3_a89d_e90f_0631a4bd67d3
  style 01876da1_fe36_ce29_f72f_3bc6e76349db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/langchain_qdrant/qdrant.py lines 434–493

    def from_existing_collection(
        cls: type[QdrantVectorStore],
        collection_name: str,
        embedding: Embeddings | None = None,
        retrieval_mode: RetrievalMode = RetrievalMode.DENSE,
        location: str | None = None,
        url: str | None = None,
        port: int | None = 6333,
        grpc_port: int = 6334,
        prefer_grpc: bool = False,  # noqa: FBT001, FBT002
        https: bool | None = None,  # noqa: FBT001
        api_key: str | None = None,
        prefix: str | None = None,
        timeout: int | None = None,
        host: str | None = None,
        path: str | None = None,
        distance: models.Distance = models.Distance.COSINE,
        content_payload_key: str = CONTENT_KEY,
        metadata_payload_key: str = METADATA_KEY,
        vector_name: str = VECTOR_NAME,
        sparse_vector_name: str = SPARSE_VECTOR_NAME,
        sparse_embedding: SparseEmbeddings | None = None,
        validate_embeddings: bool = True,  # noqa: FBT001, FBT002
        validate_collection_config: bool = True,  # noqa: FBT001, FBT002
        **kwargs: Any,
    ) -> QdrantVectorStore:
        """Construct `QdrantVectorStore` from existing collection without adding data.

        Returns:
            QdrantVectorStore: A new instance of `QdrantVectorStore`.
        """
        client = QdrantClient(
            location=location,
            url=url,
            port=port,
            grpc_port=grpc_port,
            prefer_grpc=prefer_grpc,
            https=https,
            api_key=api_key,
            prefix=prefix,
            timeout=timeout,
            host=host,
            path=path,
            **kwargs,
        )

        return cls(
            client=client,
            collection_name=collection_name,
            embedding=embedding,
            retrieval_mode=retrieval_mode,
            content_payload_key=content_payload_key,
            metadata_payload_key=metadata_payload_key,
            distance=distance,
            vector_name=vector_name,
            sparse_embedding=sparse_embedding,
            sparse_vector_name=sparse_vector_name,
            validate_embeddings=validate_embeddings,
            validate_collection_config=validate_collection_config,
        )

Domain

Subdomains

Frequently Asked Questions

What does from_existing_collection() do?
from_existing_collection() is a function in the langchain codebase, defined in libs/partners/qdrant/langchain_qdrant/qdrant.py.
Where is from_existing_collection() defined?
from_existing_collection() is defined in libs/partners/qdrant/langchain_qdrant/qdrant.py at line 434.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free