agsamantha/node_modules/langchain
2024-10-02 15:15:21 -05:00
..
agents update readme+reqs 2024-10-02 15:15:21 -05:00
cache update readme+reqs 2024-10-02 15:15:21 -05:00
chains update readme+reqs 2024-10-02 15:15:21 -05:00
chat_models update readme+reqs 2024-10-02 15:15:21 -05:00
dist update readme+reqs 2024-10-02 15:15:21 -05:00
document_loaders update readme+reqs 2024-10-02 15:15:21 -05:00
document_transformers update readme+reqs 2024-10-02 15:15:21 -05:00
embeddings update readme+reqs 2024-10-02 15:15:21 -05:00
experimental update readme+reqs 2024-10-02 15:15:21 -05:00
load update readme+reqs 2024-10-02 15:15:21 -05:00
memory update readme+reqs 2024-10-02 15:15:21 -05:00
output_parsers update readme+reqs 2024-10-02 15:15:21 -05:00
retrievers update readme+reqs 2024-10-02 15:15:21 -05:00
runnables update readme+reqs 2024-10-02 15:15:21 -05:00
schema update readme+reqs 2024-10-02 15:15:21 -05:00
storage update readme+reqs 2024-10-02 15:15:21 -05:00
stores update readme+reqs 2024-10-02 15:15:21 -05:00
tools update readme+reqs 2024-10-02 15:15:21 -05:00
util update readme+reqs 2024-10-02 15:15:21 -05:00
vectorstores update readme+reqs 2024-10-02 15:15:21 -05:00
agents.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
agents.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
agents.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
agents.js update readme+reqs 2024-10-02 15:15:21 -05:00
callbacks.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
callbacks.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
callbacks.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
callbacks.js update readme+reqs 2024-10-02 15:15:21 -05:00
chains.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
chains.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
chains.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
chains.js update readme+reqs 2024-10-02 15:15:21 -05:00
document.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
document.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
document.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
document.js update readme+reqs 2024-10-02 15:15:21 -05:00
evaluation.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
evaluation.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
evaluation.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
evaluation.js update readme+reqs 2024-10-02 15:15:21 -05:00
hub.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
hub.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
hub.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
hub.js update readme+reqs 2024-10-02 15:15:21 -05:00
indexes.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
indexes.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
indexes.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
indexes.js update readme+reqs 2024-10-02 15:15:21 -05:00
LICENSE update readme+reqs 2024-10-02 15:15:21 -05:00
load.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
load.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
load.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
load.js update readme+reqs 2024-10-02 15:15:21 -05:00
memory.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
memory.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
memory.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
memory.js update readme+reqs 2024-10-02 15:15:21 -05:00
output_parsers.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
output_parsers.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
output_parsers.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
output_parsers.js update readme+reqs 2024-10-02 15:15:21 -05:00
package.json update readme+reqs 2024-10-02 15:15:21 -05:00
README.md update readme+reqs 2024-10-02 15:15:21 -05:00
smith.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
smith.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
smith.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
smith.js update readme+reqs 2024-10-02 15:15:21 -05:00
sql_db.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
sql_db.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
sql_db.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
sql_db.js update readme+reqs 2024-10-02 15:15:21 -05:00
text_splitter.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
text_splitter.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
text_splitter.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
text_splitter.js update readme+reqs 2024-10-02 15:15:21 -05:00
tools.cjs update readme+reqs 2024-10-02 15:15:21 -05:00
tools.d.cts update readme+reqs 2024-10-02 15:15:21 -05:00
tools.d.ts update readme+reqs 2024-10-02 15:15:21 -05:00
tools.js update readme+reqs 2024-10-02 15:15:21 -05:00

🦜🔗 LangChain.js

Building applications with LLMs through composability

CI npm License: MIT Twitter Open in Dev Containers

Looking for the Python version? Check out LangChain.

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

Quick Install

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

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

🌐 Supported Environments

LangChain is written in TypeScript and can be used in:

  • Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x
  • Cloudflare Workers
  • Vercel / Next.js (Browser, Serverless and Edge functions)
  • Supabase Edge Functions
  • Browser
  • Deno

🤔 What is LangChain?

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-source building blocks, components, and third-party integrations. Use LangGraph.js to build stateful agents with first-class streaming and human-in-the-loop support.
  • Productionization: Use LangSmith 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 with LangGraph 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: A library for building 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.

LangChain Stack

This library aims to assist in the development of those types of applications. Common examples of these applications include:

Question Answering over specific documents

💬 Chatbots

🚀 How does LangChain help?

The main value props of the LangChain libraries are:

  1. 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
  2. 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 following modules:

📃 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 a standard interface for agents, along with LangGraph.js for building custom agents.

📖 Documentation

Please see here for full documentation, which includes:

💁 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 here.

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

🖇️ Relationship with Python LangChain

This is built to integrate as seamlessly as possible with the LangChain 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.