LangChain.js

The TypeScript framework for building LLM-powered apps and AI agents from interoperable, swappable components.

Framework
npm
v1.5.19
18,292 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 100
Maintenance 100
Community 76
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 90
Code Quality 85
Innovation 88
Learning Curve 70

LangChain.js is the JavaScript/TypeScript framework for building applications powered by large language models. It provides a standard interface over chat models, tools, embeddings, and vector stores so you can wire them together into agents and chains, then swap providers without rewriting your application logic.

Built around a composable, component-based architecture, LangChain.js ships a universal initChatModel entry point, a middleware-driven agent runtime, and a vast ecosystem of provider and tool integrations. It runs across Node.js, Deno, Bun, browsers, and edge runtimes, and integrates with LangGraph for orchestration and LangSmith for tracing, evaluation, and production monitoring.

What You Get

  • A universal initChatModel interface for loading and swapping chat models across providers with one call
  • A middleware-based agent runtime (createAgent / ReactAgent) for tool-using, multi-step agents
  • A large ecosystem of integrations for model providers, tools, vector stores, and retrievers
  • First-class TypeScript types and support for Node.js, Deno, Bun, browsers, and edge runtimes
  • Tight integration with LangGraph for orchestration and LangSmith for tracing and evaluation

Common Use Cases

  • Building tool-using AI agents that plan and execute multi-step tasks
  • Retrieval-augmented generation (RAG) over private data using vector stores and retrievers
  • Prototyping and shipping chatbots and assistants that can switch model providers freely
  • Augmenting LLMs with real-time data from external systems and APIs

Under The Hood

Architecture — LangChain.js is a pnpm/turbo monorepo whose langchain package (in libs/langchain) sits atop @langchain/core and @langchain/langgraph. Its public surface (src/index.ts) re-exports message primitives, tools, prompts, and a universal initChatModel entry point, while src/agents implements the agent runtime — ReactAgent, a middleware pipeline, node/transformer graph construction, and runnable callables — that compiles tool-using agents down to LangGraph state machines. Provider integrations are kept out of the core and shipped as separate @langchain/* workspace packages.

Tech Stack — Written in TypeScript targeting Node.js 20+, it builds with tsdown and Turbo, tests with Vitest, and depends on @langchain/langgraph, @langchain/langgraph-checkpoint, langsmith, and zod (v3 or v4) for schema validation. It publishes dual ESM/CJS output and supports Deno, Bun, browsers, and edge runtimes.

Code Quality — The package carries roughly 68 Vitest test files, with dedicated tests directories under the agent and middleware modules, plus separate integration, environment, and dependency-range test suites at the repo root. Code is strictly typed with exported type definitions throughout, linted via oxlint, and organized by concern (agents, chat_models, tools, prompts, storage, load).

API Design — The developer experience is deliberately layered: a single initChatModel call gets beginners running with any provider, while createAgent and middleware give advanced users fine-grained control. Naming is consistent and discoverable, types are first-class, and the docs and examples are extensive — though the sheer breadth of the ecosystem and its abstraction layers give it a moderate learning curve.

Used by 142 apps in this directory

TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,356

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 26%
JavaScript 24%
HTML 20%
Updated 6 days ago
TypeScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,356

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 26%
JavaScript 24%
HTML 20%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers