langchainjs README

The project's README from github.com/langchain-ai/langchainjs. As one markdown file: README.md.

LangChain Logo

The agent engineering platform.

npm License: MIT Twitter

LangChain is a framework for building LLM-powered applications. It helps you chain together interoperable components and third-party integrations to simplify AI application development — all while future-proofing decisions as the underlying technology evolves.

[!TIP] Just getting started? Check out Deep Agents — a higher-level package built on LangChain for agents that have built-in capabilites for common usage patterns such as planning, subagents, file system usage, and more.

Documentation: To learn more about LangChain, check out the docs.

If you're looking for more advanced customization or agent orchestration, check out LangGraph.js, our framework for building agents and controllable workflows.

For an equivalent Python library, check out LangChain.

To help you ship LangChain apps to production faster, check out LangSmith, a unified developer platform for building, testing, and monitoring LLM applications.

⚡️ Quick Install

You can use npm, pnpm, or yarn to install LangChain.js

npm install -S langchain or pnpm install langchain or yarn add langchain

🚀 Why use LangChain?

LangChain helps developers build applications powered by LLMs through a standard interface for agents, models, embeddings, vector stores, and more.

Use LangChain for:

📦 LangChain's ecosystem

🌐 Supported Environments

LangChain.js is written in TypeScript and can be used in:

📖 Additional Resources

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see CONTRIBUTING.md.

Please report any security issues or concerns following our security guidelines.

langchainjs (langchain-ai/langchainjs)

Searching Database…

这是什么?LangChain.js 是一个 TypeScript 框架,用于构建由大语言模型驱动的应用。它为开发者提供统一的接口,涵盖智能体、模型、嵌入、向量存储以及第三方集成。
它是框架还是库?它是一个框架或库,需要导入到 Node.js 或 JavaScript 项目中使用,而不是独立的应用程序。它提供可组合的构建模块(如链、智能体、检索器),而不是图形界面。
我该如何把它添加到项目中?可以使用 npm、pnpm 或 yarn 安装,例如 'npm install -S langchain'。
我可以在哪些运行环境中使用它?它可以在 Node.js(支持 ESM 和 CommonJS,版本为 20.x/22.x/24.x)、Cloudflare Workers、Vercel/Next.js、Supabase Edge Functions、浏览器、Deno 和 Bun 中运行。
我还需要 LangGraph 或 LangSmith 吗?还是只用 LangChain 就够了?仅使用 LangChain 即可覆盖链、模型和集成功能。但如果要进行复杂的智能体编排,可以参考 LangGraph.js;如果需要生产环境的监控与评估,可以参考 LangSmith。它们是独立的配套产品。
LangChain 有 Python 版本吗?有的,LangChain 也有对应的 Python 库,LangChain.js 则是其 TypeScript/JavaScript 版本。
什么是 Deep Agents?Deep Agents (JS) 是基于 LangChain 构建的更高层级的软件包,用于构建具备内置规划、子智能体和文件系统使用能力的智能体。
为什么我要选择 LangChain,而不是直接编写原始的 API 调用?LangChain 为模型提供商、向量存储和工具提供统一的接口,因此你可以方便地替换模型、快速搭建原型,而无需从零重新构建集成。
生产环境中谁在使用 LangGraph?据报道,LinkedIn、Uber、Klarna、GitLab 等公司在生产环境中使用 LangGraph。它是同一生态中更底层的编排框架。
Size
686.9 MB
Stars
18.3K
Age
3y
Commits · 90 Days