vector-search-python-sdk-example(Python)

Loading...

Vector Search Python SDK example usage

This notebook shows how to use the Vector Search Python SDK, which provides a VectorSearchClient as a primary API for working with Vector Search.

Alternatively, you can call the REST API directly.

Requirements

This notebook assumes that a Model Serving endpoint named databricks-bge-large-en exists. To create that endpoint, see the "Vector Search foundational embedding model (BGE) Example" notebook (AWS|Azure).

    Load toy dataset into source Delta table

    The following creates the source Delta table.

        Create vector search endpoint

          Create vector index

          Get a vector index

          Use get_index() to retrieve the vector index object using the vector index name. You can also use describe() on the index object to see a summary of the index's configuration information.

          Similarity search

          Query the Vector Index to find similar documents.

          Convert results to LangChain documents

          The first column retrieved is loaded into page_content, and the rest into metadata.

          Delete vector index