langchain-ai/langchain-azure
Python adapters for LangChain and LangGraph on Azure: models, agent hosting, and state
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
This is a Python integration monorepo, not a standalone agent runner. Under libs/, langchain-azure-ai bridges LangChain and LangGraph to Foundry SDK clients, while sibling packages cover compute, Cosmos DB, Dynamic Sessions, SQL Server, PostgreSQL, and Azure Storage. The model adapter can be instantiated directly as AzureAIOpenAIApiChatModel or selected through the azure_ai provider in init_chat_model.
There are two distinct boundaries for agent execution. AgentServiceFactory.create_prompt_agent_node() exposes a Foundry-managed prompt agent as one node in a graph with the required AgentServiceAgentState fields; the surrounding graph does not have to be hosted on Foundry. Alternatively, Foundry can host the whole graph through its hosted-agent interfaces. langchain_azure_compute.graph is a separate execution integration backed by Azure Durable Task Scheduler.
Key Capabilities & Differentiators
AzureAIOpenAIApiChatModel uses OpenAI-compatible Foundry endpoints, with use_responses_api selecting Responses or Chat Completions where the model and endpoint support the chosen API. The model name identifies a deployment, not a bundled model. The AI package also integrates Foundry tools, Content Safety middleware, and Azure AI Search as a vector-store backend.
For state, Foundry-hosted agents can use FoundryCheckpointSaver with Foundry State Store, while Cosmos DB offers both a LangGraph checkpointer and a separate long-term memory store. For execution, the Durable Task Scheduler integration supports compiled LangGraph workflows and LangChain agents with per-step and per-tool fault isolation, automatic worker failover, and durable interrupt() / resume() waits. Checkpoint storage and execution recovery are separate design decisions.
Trade-offs & Limitations
For a service that only calls a Foundry model, the direct Foundry SDK is the simpler option: there is no graph or adapter layer to maintain. For an existing LangGraph application, the repository provides a way to adopt Azure integrations selectively. Calling a managed agent as a node is a smaller migration than moving the entire runtime. This is also the replacement path for Azure adapters in langchain-community, but migrations should verify authentication and behavior for the adapters actually in use.
Portability decreases as the application takes dependencies on Foundry hosting, Azure-backed state, or Durable Task Scheduler. Running the graph in your own environment gives you control over the application process, not independence from remote inference or storage. The SDK is MIT-licensed; service charges and terms, endpoint quotas, identity roles, and data retention remain Azure deployment concerns.
Hardware & Deployment Guide
For a local model integration, install langchain-azure-ai with pip, configure a Foundry project endpoint and model deployment, and use az login with DefaultAzureCredential for local Entra ID authentication. The project-endpoint example requires the Azure AI Developer role; the key-auth example uses endpoint rather than project_endpoint. Prompt-agent tracing with create_prompt_agent(..., trace=True) requires the opentelemetry extra.
Local development still calls Azure over the network; this is not an offline inference stack. For managed hosting, start with samples/hosting/langgraph-hosted-agents/, which covers prerequisites, local runs, and deployment. In the libs/azure-ai release line, v1.3.1 fixed credential-based AzureSearch.from_texts without a key, v1.4.0 documented the Responses and Invocations hosting interfaces, and v1.4.1 disabled model response storage in hosted-agent samples. Treat the last change as sample behavior, not a global retention policy.
Teams already using LangChain or LangGraph that want to add Foundry inference, managed agent nodes, or Azure-backed graph state and execution without moving every component at once.
You need fully offline inference, want to avoid Azure service dependencies, or only need a thin client for one Foundry endpoint.
Quick Start & Installation
pip install -U langchain-azure-ai
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| langchain-azure ★ | 148 | — | Jupyter Notebook | MIT | Python adapters for LangChain and LangGraph on Azure: models, agent hosting, and |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| ag-ui | 22.6k | +611 | TypeScript | MIT | A typed event protocol and SDKs that connect agent backends to interactive apps |
| ruflo | 82.8k | +342 | TypeScript | MIT | A TypeScript orchestration layer for coding agents, with shared memory and MCP |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/langchain-ai/langchain-azure.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about langchain-azure
Does calling a Foundry agent require moving my whole LangGraph application to Azure?
Do I need a GPU, and how should I size the runtime?
Can I use the SDK commercially or self-host it for compliance?
When is this preferable to using the Foundry SDK directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy