Build AI apps
LangChain
The most used framework for wiring language models to your own data, tools and apps.
- Rank
- #3
- Stars
- 149k
- Licence
- MIT
- Checked
- 6 Nov 2026
What it does
LangChain gives Python and JavaScript developers one standard way to talk to many model providers (OpenAI, Anthropic, Google, local Ollama models and more), plus ready-made parts for chatbots, searching your own documents and building agents that call tools. Its sister project LangGraph handles agents that need memory and multiple steps.
How to use it
Shell: PowerShell (Windows 11, Python 3.10+, Ollama installed for a free local model)
Install LangChain and the Ollama integration.
pip install -U langchain langchain-ollamaSave this as hello.py: it sends a prompt to a local model, so no API key or cost.
from langchain.chat_models import init_chat_model model = init_chat_model("ollama:llama3.2") print(model.invoke("Explain a VPC in one sentence").content)Run it.
python hello.py
Best practices
- Pin package versions in requirements.txt. LangChain moves fast and minor releases can change APIs.
- Keep API keys in environment variables (for example $env:OPENAI_API_KEY), never in your code or Git.
- Start with a plain model call and add chains or agents only when you need them; extra layers make bugs harder to find.
- Turn on tracing (LangSmith or your own logging) so you can see every prompt and tool call when an answer goes wrong.
In the news
- TechCrunch · 21 Oct 2025 · Open source agentic startup LangChain hits $1.25B valuation
- Fortune · 20 Oct 2025 · Exclusive: Early AI darling LangChain is now a unicorn with a fresh $125 million in funding