# LangChain — card for AI agents

Framework for composing applications with LLMs through chains and agents.

Category: Agent, MCP and tool libraries · PyPI package `langchain` · latest version 1.4.7 (checked 2026-11-01)
Install: `pip install langchain`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## LangChain
- Build agents with `create_agent` from `langchain.agents`, passing `model`, `tools` and `system_prompt`.
- Pass the model as a `"provider:model"` string where the docs do, e.g. `"openai:gpt-5.5"` or `"ollama:devstral-2"`. When a provider needs extra settings, as Azure needs `azure_deployment`, build the model with `init_chat_model` and pass the object as `model`.
- Install the provider extra or package shown in the docs alongside `langchain` (`"langchain[openai]"`, `"langchain[anthropic]"`, `langchain-ollama`, `langchain-aws`).
- Write tools as typed Python functions with a docstring, and pass them in `tools=[...]`.
- Invoke with `{"messages": [...]}` and read the reply from `result["messages"][-1].content_blocks`.
- Add guardrails, retries, routing or tool policies through middleware. For workflows that combine deterministic and agentic steps, use LangGraph.
- Fetch `https://docs.langchain.com/llms.txt` to discover available docs pages before exploring further.

## Agent Skills for it
- Official: langchain-ai/langchain-skills (5 skills): `npx skills add langchain-ai/langchain-skills`
- langchain-architecture from wshobson/agents: `npx skills add wshobson/agents --skill langchain-architecture`
- langchain from Orchestra-Research/AI-Research-SKILLs: `npx skills add Orchestra-Research/AI-Research-SKILLs --skill langchain`
- langchain-architecture from rmyndharis/antigravity-skills: `npx skills add rmyndharis/antigravity-skills --skill langchain-architecture`
- langchain-chains from a5c-ai/babysitter: `npx skills add a5c-ai/babysitter --skill langchain-chains`

## Docs written for agents
- [llms.txt (index of the docs)](https://docs.langchain.com/llms.txt)

## What it is
- LangChain is an MIT-licensed Python package, `langchain` on PyPI. The README describes it as "a framework for building agents and LLM-powered applications". It offers a standard interface for models, embeddings, vector stores and other components, along with third-party integrations. The repository was created in October 2022.
- The docs reduce an agent to "Agent = Model + Harness". LangChain supplies the harness through `create_agent`, which covers the prompt, the tools and any middleware around the model loop. The docs repeat one weather-tool example across ten providers, including OpenAI, Gemini, Claude, Ollama, Bedrock and Azure. Most variants pass a `"provider:model"` string, such as `"ollama:devstral-2"`. The Claude variant uses a bare model name, `"claude-sonnet-4-6"`. The Azure variant first builds the model with `init_chat_model` and an `azure_deployment` argument, then passes that object in.
- The docs place LangChain between two sibling projects. Deep Agents is the "batteries-included" option, and the README points people who are just getting started to it. LangGraph is the low-level orchestration layer for workflows that mix deterministic and agentic steps. LangChain sits in the middle, for developers who want a customizable harness tailored to their own use case and data.

## Caveats
- A lot of surface to learn (2023 view): In a 2023 post, the maintainers wrote that packing an entire ecosystem into one package leaves users with many features to learn. The post predates the current docs, which center on `create_agent`.
- Three layers to choose between: The README sends advanced customization and agent orchestration to LangGraph, and it sends newcomers to Deep Agents. Expect to work out which of the three layers your project needs.
- Every provider example adds an install: Each provider example in the docs installs something beyond `langchain`. Some use an extra such as `"langchain[openai]"`. Others use a separate package such as `langchain-ollama` or `langchain-fireworks`.
- Tracing points to LangSmith: For tracing, debugging and evaluation, the docs send you to LangSmith, which requires `LANGSMITH_TRACING=true` and an API key. The same docs site covers LangSmith, Fleet and the open source packages.

## Numbers (AgentGid data)
- Gid Score: 88.7 (#13 of all tools, 1 of 192 in its category)
- Used in 127 public projects set up for AI coding agents (2.0%)
- Downloads last week: 37,588,359 (as of 2026-11-24), -3.7% over 4 weeks
- GitHub stars: 149,961 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
python-dotenv 70.9%, Pydantic 56.7%, FastAPI 53.5%, LangGraph 53.5%, Uvicorn 52.8%, OpenAI Python Library 38.6%

## Checked alternatives (same job)
- LangGraph: https://agentgid.com/tools/langgraph/agent.md
- Pydantic AI: https://agentgid.com/tools/pydantic-ai/agent.md
- LlamaIndex: https://agentgid.com/tools/llama-index/agent.md
- Semantic Kernel: https://agentgid.com/tools/semantic-kernel/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/langchain-pypi/
- Homepage: https://docs.langchain.com/
- Repository: https://github.com/langchain-ai/langchain
- Source: https://github.com/langchain-ai/langchain#readme
- Source: https://github.com/langchain-ai/langchain
- Source: https://github.com/langchain-ai/langchain/releases
- Source: https://docs.langchain.com/langchain/

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
