---
title: AI Search example notebooks
description: "Example notebooks for Databricks AI Search: build and query indexes with the Python SDK, LangChain, and managed or external embedding models."
canonical_url: https://docs.databricks.com/gcp/en/ai-search/example-notebooks
---

# AI Search example notebooks

The following notebooks show how to use the AI Search Python SDK. For reference information, see the [Python SDK reference](https://api-docs.databricks.com/python/ai-search/databricks.ai_search.html).

## LangChain

For more information about using LangChain with Databricks AI Search, see [Databricks vector search integration](https://python.langchain.com/docs/integrations/vectorstores/databricks_vector_search).

| Notebook                                                                                                          | Description                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [AI Search with the Python SDK](https://docs.databricks.com/gcp/en/ai-search/vector-search-python-sdk-example.md) | Create a search endpoint, build a delta-sync vector index, run similarity searches, and convert results to LangChain documents. |

## <a id="embedding-model-notebooks" /> Use an embedding model

These notebooks show how to configure a Databricks Model Serving endpoint to generate embeddings.

| Notebook                                                                                                                          | Description                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Use an OpenAI embedding model](https://docs.databricks.com/gcp/en/ai-search/vector-search-external-embedding-model-example.md)   | Use the Python SDK with an external embedding model (OpenAI) to create and query an AI Search index.                                                                                  |
| [Use a GTE embedding model](https://docs.databricks.com/gcp/en/ai-search/vector-search-foundation-embedding-model-gte-example.md) | Use the GTE foundation embedding model to load a dataset into a Delta table, chunk the text, create an AI Search endpoint and delta-sync index, and run similarity searches.          |
| [Register and serve an OSS embedding model](https://docs.databricks.com/gcp/en/ai-search/embedding-with-oss-models.md)            | Download an open source embedding model (`e5-small-v2`) from Hugging Face, register it to Unity Catalog, and deploy it as a Model Serving endpoint for use with Databricks AI Search. |

## Use AI Search with an OAuth token

| Notebook                                                                                                       | Description                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Use AI Search with an OAuth token](https://docs.databricks.com/gcp/en/ai-search/vector-search-oauth-token.md) | Query a Databricks AI Search endpoint using the Python SDK or direct HTTP requests, authenticated using a service principal OAuth token over the network-optimized path. |
