- Notifications
You must be signed in to change notification settings - Fork0
🦜🔗 Build context-aware reasoning applications 🦜🔗
License
philschmid/langchainjs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
⚡ Building applications with LLMs through composability ⚡
Looking for the Python version? Check outLangChain.
To help you ship LangChain apps to production faster, check outLangSmith.LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.
You can use npm, yarn, or pnpm to install LangChain.js
npm install -S langchain
oryarn add langchain
orpnpm add langchain
LangChain is written in TypeScript and can be used in:
- Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x, 22.x
- Cloudflare Workers
- Vercel / Next.js (Browser, Serverless and Edge functions)
- Supabase Edge Functions
- Browser
- Deno
LangChain is a framework for developing applications powered by language models. It enables applications that:
- Are context-aware: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)
- Reason: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)
This framework consists of several parts.
- Open-source libraries: Build your applications using LangChain's open-sourcebuilding blocks,components, andthird-party integrations.UseLangGraph.js to build stateful agents with first-class streaming and human-in-the-loop support.
- Productionization: UseLangSmith to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence.
- Deployment: Turn your LangGraph applications into production-ready APIs and Assistants withLangGraph Cloud.
The LangChain libraries themselves are made up of several different packages.
@langchain/core
: Base abstractions and LangChain Expression Language.@langchain/community
: Third party integrations.langchain
: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.- LangGraph.js: LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more. Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. Integrates smoothly with LangChain, but can be used without it.
Integrations may also be split into their own compatible packages.
This library aims to assist in the development of those types of applications. Common examples of these applications include:
❓Question Answering over specific documents
- Documentation
- End-to-end Example:Doc-Chatbot
💬 Chatbots
- Documentation
- End-to-end Example:Chat-LangChain
The main value props of the LangChain libraries are:
- Components: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
- Off-the-shelf chains: built-in assemblages of components for accomplishing higher-level tasks
Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.
Components fall into the followingmodules:
📃 Model I/O:
This includes prompt management, prompt optimization, a generic interface for all LLMs, and common utilities for working with LLMs.
📚 Retrieval:
Data Augmented Generation involves specific types of chains that first interact with an external data source to fetch data for use in the generation step. Examples include summarization of long pieces of text and question/answering over specific data sources.
🤖 Agents:
Agents allow an LLM autonomy over how a task is accomplished. Agents make decisions about which Actions to take, then take that Action, observe the result, and repeat until the task is complete. LangChain provides astandard interface for agents, along withLangGraph.js for building custom agents.
Please seehere for full documentation, which includes:
- Getting started: installation, setting up the environment, simple examples
- Overview of theinterfaces,modules andintegrations
- Tutorial walkthroughs
- Reference: full API docs
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, seehere.
Please report any security issues or concerns following oursecurity guidelines.
This is built to integrate as seamlessly as possible with theLangChain Python package. Specifically, this means all objects (prompts, LLMs, chains, etc) are designed in a way where they can be serialized and shared between languages.
About
🦜🔗 Build context-aware reasoning applications 🦜🔗
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- TypeScript87.3%
- Jupyter Notebook5.7%
- HTML4.0%
- JavaScript2.6%
- Shell0.2%
- MDX0.1%
- Other0.1%