Skip to main content

Databricks AI Search Client (formerly Vector Search)

Project description

Databricks AI Search Python SDK

The Python SDK for Databricks AI Search, the fully managed vector and keyword search service in the Databricks platform. AI Search is the new name for the product previously known as Databricks Vector Search.

Installation

pip install databricks-ai-search

The legacy databricks-vectorsearch package continues to work; once the companion databricks-vectorsearch==0.68 release lands, that package becomes a thin re-export shim of databricks-ai-search that emits a deprecation warning on import. New projects should install databricks-ai-search.

Usage

from databricks.ai_search.client import AISearchClient

# Initialize the client (auto-detects credentials in Databricks notebooks)
client = AISearchClient()

# Create an endpoint and index
endpoint = client.create_endpoint(name="my-endpoint", endpoint_type="STANDARD")
index = client.create_delta_sync_index(
    endpoint_name="my-endpoint",
    index_name="my_catalog.my_schema.my_index",
    primary_key="id",
    embedding_dimension=768,
    embedding_vector_column="embedding",
    source_table_name="my_catalog.my_schema.my_source_table",
)

# Query the index
results = index.similarity_search(
    query_vector=[0.1, 0.2, 0.3, ...],
    columns=["id", "text"],
    num_results=10,
)

AISearchClient is the canonical class name; VectorSearchClient is preserved as a backward-compat alias (VectorSearchClient is AISearchClient evaluates True). The same applies to AISearchIndex / VectorSearchIndex and AISearchException / VectorSearchException.

Authentication

The client supports the same authentication methods as the legacy SDK:

  • Auto-detection (recommended for Databricks notebooks) — no arguments required
  • Personal Access Token (PAT)AISearchClient(workspace_url=..., personal_access_token=...)
  • Service Principal (OAuth M2M, AWS / GCP)AISearchClient(workspace_url=..., service_principal_client_id=..., service_principal_client_secret=...)
  • Azure Service Principal — additionally pass azure_tenant_id=...
  • Model Serving with user credentialsAISearchClient(credential_strategy=CredentialStrategy.MODEL_SERVING_USER_CREDENTIALS)

See the docstrings on AISearchClient.__init__ for details.


DB license

Copyright (2022) Databricks, Inc.

This library (the "Software") may not be used except in connection with the Licensee's use of the Databricks Platform Services pursuant to an Agreement (defined below) between Licensee (defined below) and Databricks, Inc. ("Databricks"). This Software shall be deemed part of the Downloadable Services under the Agreement, or if the Agreement does not define Downloadable Services, Subscription Services, or if neither are defined then the term in such Agreement that refers to the applicable Databricks Platform Services (as defined below) shall be substituted herein for "Downloadable Services". Licensee's use of the Software must comply at all times with any restrictions applicable to the Downloadable Services and Subscription Services, generally, and must be used in accordance with any applicable documentation.

Additionally, and notwithstanding anything in the Agreement to the contrary:

  • THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

If you have not agreed to an Agreement or otherwise do not agree to these terms, you may not use the Software.

This license terminates automatically upon the termination of the Agreement or Licensee's breach of these terms.

Agreement: the agreement between Databricks and Licensee governing the use of the Databricks Platform Services, which shall be, with respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless Licensee has entered into a separate written agreement with Databricks governing the use of the applicable Databricks Platform Services.

Databricks Platform Services: the Databricks services or the Databricks Community Edition services, according to where the Software is used.

Licensee: the user of the Software, or, if the Software is being used on behalf of a company, the company.

Project details


Release history Release notifications | RSS feed

This version

0.73

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

databricks_ai_search-0.73-py3-none-any.whl (62.0 kB view details)

Uploaded Python 3

File details

Details for the file databricks_ai_search-0.73-py3-none-any.whl.

File metadata

File hashes

Hashes for databricks_ai_search-0.73-py3-none-any.whl
Algorithm Hash digest
SHA256 bbff931ccc952bae054353ccc33c1e13dcbc388b4f30a181e4506bcf703fe57a
MD5 50d975f328790801c8f0b9ae0872c53f
BLAKE2b-256 2f6e7625aa81606f2da6d24c3faf4f6c4ffc72feb35978364d9bf67e57383b2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page