A 21-lesson Microsoft course teaching developers the fundamentals of building generative AI applications with Python and TypeScript.
langchain-ai/langchain
A Python framework for building LLM-powered applications and agents, with standard interfaces for models, embeddings, vector stores and third-party integrations.
- Stars
- 148,120
- Forks
- 24,859
- Open issues
- 674
- Last commit
- 4 hours ago
What is it?
LangChain is a framework for building agents and LLM-powered applications. It lets developers chain together interoperable components and third-party integrations so that application code does not have to be rewritten each time the underlying model or provider changes.
The core offering is a standard interface for chat models, embedding models, vector stores, retrievers and tools. Models are initialized through a single helper such as init_chat_model, so switching between providers like OpenAI, Anthropic or Google Gemini requires minimal code changes. Integrations with a large catalog of model providers and data sources are maintained as part of the ecosystem.
LangChain sits alongside related projects in the same ecosystem: LangGraph for lower-level, controllable agent orchestration, Deep Agents for agents with built-in planning and subagents, and LangSmith for evaluation, observability and debugging. A TypeScript counterpart, LangChain.js, is maintained separately.
Key features
- 01Standard interfaces for chat models, embeddings, vector stores, retrievers and tools.
- 02Single-call model initialization across multiple providers such as OpenAI, Anthropic and Gemini.
- 03Large library of third-party integrations for model providers, tools and data sources.
- 04Layered abstractions, from high-level quickstart components to low-level control.
- 05Works with LangGraph, Deep Agents and LangSmith for orchestration and observability.
Use cases
- Building a retrieval-augmented generation (RAG) app that answers questions over private documents.
- Prototyping an LLM feature and swapping between model providers without rewriting application code.
- Creating tool-using agents that call external APIs or internal systems.
- Adding LLM capabilities to a Python backend while keeping a consistent interface.
Quick start
- 1
Install LangChain with uv
uv add langchain - 2
Initialize a chat model and invoke it (set the matching provider API key first)
python -c "from langchain.chat_models import init_chat_model; model = init_chat_model('openai:gpt-5.5'); print(model.invoke('Hello, world!'))"
Things to know
- Calling most models requires a paid API key from a model provider.
Topics
FAQ
- What is langchain?
- A Python framework for building LLM-powered applications and agents, with standard interfaces for models, embeddings, vector stores and third-party integrations. LangChain is a framework for building agents and LLM-powered applications. It lets developers chain together interoperable components and third-party integrations so that application code does not have to be rewritten each time the underlying model or provider changes.
- Is langchain free to use? What license does it have?
- langchain is open source under the MIT license. Check the license terms before using it in commercial products.
- Is langchain still maintained?
- Actively maintained. The last commit to langchain was on Oct 20, 2026.
- What can I use langchain for?
- Building a retrieval-augmented generation (RAG) app that answers questions over private documents. Prototyping an LLM feature and swapping between model providers without rewriting application code. Creating tool-using agents that call external APIs or internal systems. Adding LLM capabilities to a Python backend while keeping a consistent interface.
- How do I install langchain?
- Install LangChain with uv: uv add langchain Initialize a chat model and invoke it (set the matching provider API key first): python -c "from langchain.chat_models import init_chat_model; model = init_chat_model('openai:gpt-5.5'); print(model.invoke('Hello, world!'))"
- Where can I get langchain?
- The source code and installation instructions are on GitHub: https://github.com/langchain-ai/langchain
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A visual platform for building, testing and deploying AI agents and workflows, with built-in API and MCP server exposure.
A lightweight Python framework for building multi-agent workflows with tools, handoffs, guardrails, sessions and tracing, provider-agnostic across OpenAI and 100+ LLMs.
Python framework for building autonomous AI agents that research, plan, code and run tasks, with memory, RAG and 100+ LLM providers.
AutoGPT is an open-source platform for building, running, and scheduling AI agents that carry out multi-step workflows from plain-English descriptions or a visual builder.
A memory layer for AI agents and apps that stores and retrieves user, session, and agent context across conversations.