跳到主要内容Skip to main content
Agent 框架与编排Agent Frameworks & Orchestration生产可用Production

LangChain

langchain-ai / langchain

LLM 应用框架:模型、工具、检索、记忆与 agent 的组件化抽象;LangGraph 做有状态编排,LangSmith 做观测。An LLM application framework: component abstractions for models, tools, retrieval, memory and agents; LangGraph handles stateful orchestration and LangSmith observability.

150.0k stars 25161 forks Python 语言Language MIT 许可License 最近推送Last push 2026-11-20

为什么选Why choose it

  • 生态最大,几乎所有模型/向量库/工具都有适配。The largest ecosystem, with adapters for most models, vector stores and tools.
  • 从简单链到 agent 都有现成组件,起步快。Components for everything from simple chains to agents make starting fast.
  • 和 LangGraph、LangSmith 组成完整开发栈。Forms a full stack with LangGraph and LangSmith.

不适合Not for

抽象层多,简单调用可能被过度封装。Many abstraction layers can over-wrap a simple call.
版本迭代快,生产要锁版本并读迁移说明。Fast-moving versions require pinning and reading migration notes.
不是推理引擎或托管平台。Not an inference engine or hosting platform.

最小上手Minimum setup

  1. pip install langchain,用统一模型接口跑一次调用。pip install langchain and make one call through the unified model interface.
  2. 加一个检索器与工具,做最小 chain。Add a retriever and a tool to build a minimal chain.
  3. 需要状态/分支时再上 LangGraph,不要一开始就堆组件。Move to LangGraph only when state or branching is needed; do not stack components on day one.

依赖与成本Dependencies and cost

Python;模型 provider 的 API key 或本地端点;向量库与工具各有依赖。Python; a provider API key or local endpoint; vector stores and tools bring their own dependencies.

许可与使用边界License and usage boundaries

MIT;集成的模型、向量库与工具各自许可。MIT; integrated models, vector stores and tools carry their own licences.

开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

替代与相邻Alternatives and neighbors

  • LangGraph — 生产可用Production,把 agent 写成有状态图:节点、边、检查点、人工确认与回滚都能显式表达。Write an agent as a stateful graph: nodes, edges, checkpoints, human approval and rollback are explicit.
  • CrewAI — 先试这个Start here,用“角色 + 任务 + 协作流程”搭多 agent 团队,适合快速把分工跑起来。Build multi-agent teams from roles, tasks and a collaboration process; good for getting division of labour running quickly.
  • AutoGen — 生产可用Production,微软的多 agent 框架,强调可对话的 agent、工具调用与分布式运行。Microsoft’s multi-agent framework built around conversable agents, tool use and distributed execution.

下一步Next steps

  • 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
  • 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.

GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.