Support for Databricks AI support in LangChain
Actively maintained. Last release 11 days ago. A safe choice.
$
pip install databricks-langchain🦜🔗 Databricks LangChain Integration
The databricks-langchain package provides seamless integration of Databricks AI features into LangChain applications. This repository is now the central hub for all Databricks-related LangChain components, consolidating previous packages such as langchain-databricks and langchain-community.
Installation
From PyPI
pip install databricks-langchain
From Source
pip install git+https://git@github.com/databricks/databricks-ai-bridge.git#subdirectory=integrations/langchain
Key Features
- LLMs Integration: Use Databricks-hosted large language models (LLMs) like Llama and Mixtral through
ChatDatabricks. - Vector Search: Store and query vector representations using
DatabricksVectorSearch. - Embeddings: Generate embeddings with
DatabricksEmbeddings. - Genie: Use Genie in Langchain.
- Deep Agents Sandbox: Run Deep Agents shell and filesystem tools inside a Databricks sandbox with
DatabricksSandbox(installdatabricks-langchain[deepagents]). - Sandbox Tool: Run shell commands in a Databricks sandbox from any LangChain or LangGraph agent with
DatabricksSandboxTool(installdatabricks-langchain[sandbox]). - Sandbox Session: Provision, wait for, and auto-delete a sandbox for that tool with the
DatabricksSandboxSessioncontext manager, keeping sandbox lifecycle in your application rather than the model.
Getting Started
Use LLMs on Databricks
from databricks_langchain import ChatDatabricks
llm = ChatDatabricks(endpoint="databricks-meta-llama-3-1-70b-instruct")
Use a Genie Space as an Agent (Preview)
Note: Requires Genie API Private Preview. Contact your Databricks account team for enablement.
from databricks_langchain.genie import GenieAgent
genie_agent = GenieAgent(
"space-id", "Genie",
description="This Genie space has access to sales data in Europe"
)
Contribution Guide
We welcome contributions! Please see our contribution guidelines for details.
License
This project is licensed under the MIT License.
Thank you for using Databricks LangChain!