Documentation Index
Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Databricks Lakehouse Platform unifies data, analytics, and AI on one platform.本指南提供了开始使用
DatabricksEmbeddings 向量嵌入模型. 有关所有 DatabricksEmbeddings 功能和配置的详细文档,请前往 API reference.
概述
集成详情
Supported methods
DatabricksEmbeddings supports all methods of Embeddings class including async APIs.
Endpoint requirement
The serving endpointDatabricksEmbeddings wraps must have OpenAI-compatible embedding input/output format (reference). As long as the input format is compatible, DatabricksEmbeddings can be used for any endpoint type hosted on Databricks Model Serving:
- Foundation Models - Curated list of 先进的 foundation models such as BAAI General Embedding (BGE). These endpoint are ready to use in your Databricks workspace without any set up.
- Custom Models - You can also deploy custom 向量嵌入模型 to a serving endpoint via MLflow with your choice of framework such as LangChain, Pytorch, Transformers, etc.
- External Models - Databricks endpoints can serve models that are hosted outside Databricks as a proxy, such as proprietary model service like OpenAI text-embedding-3.
设置
要访问 Databricks 模型,您需要创建一个 Databricks account, set up credentials (only if you are outside Databricks workspace), and install required packages.Credentials (only if you are outside databricks)
If you are running LangChain app inside Databricks, you can skip this step. Otherwise, you need manually set the Databricks workspace hostname and personal access token toDATABRICKS_HOST and DATABRICKS_TOKEN environment variables, respectively. See Authentication Documentation for how to get an access token.
安装
LangChain 的 Databricks 集成位于databricks-langchain 包中:
实例化
索引与检索
向量嵌入模型常用于检索增强生成 (RAG) 流程中, 既用于索引数据,也用于后续检索数据。 更详细的说明请参阅我们的 RAG tutorials. 下面展示如何使用embeddings 对象来索引和检索数据。 在此示例中,我们将在 InMemoryVectorStore.
直接使用
Under the hood, the vectorstore and retriever implementations are callingembeddings.embed_documents(...) and embeddings.embed_query(...) to create embeddings for the text(s) used in from_texts and retrieval invoke operations, respectively.
You can directly call these methods to get embeddings for your own use cases.
Embed single texts
You can embed single texts or documents withembed_query:
Embed multiple texts
You can embed multiple texts withembed_documents:
Async usage
You can also useaembed_query and aembed_documents for producing embeddings asynchronously:
API 参考
For detailed documentation onDatabricksEmbeddings 功能和配置选项的详细文档,请参阅 API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

