👋 Welcome! Thank you for your interest in contributing. LangChain has helped form the largest developer community in generative AI, and we're always open to new contributors. Whether you're fixing bugs, adding features, improving documentation, or sharing feedback, your involvement helps make LangChain and LangGraph better for everyone 🦜❤️
To contribute to this project, please follow a "fork and pull request" workflow. Please do not try to push directly to this repo unless you are a maintainer.
Found a bug? Please help us fix it by following these steps:
- Search: Check if the issue already exists in our GitHub Issues
- Create issue: If no issue exists, create a new one. When writing, be sure to follow the template provided and include a minimal, reproducible example. Attach any relevant labels to the final issue once created.
- Wait: A project maintainer will triage the issue and may ask for additional information. Please be patient as we manage a high volume of issues. Do not bump the issue unless you have new information to provide.
Note: If a project maintainer is unable to reproduce the issue, it is unlikely to be addressed in a timely manner.
If you are adding an issue, please try to keep it focused on a single topic. If two issues are related, or blocking, please link them rather than combining them. For example: "This issue is blocked by #123 and related to #456."
Have an idea for a new feature or enhancement?
- Search: Search the issues for existing feature requests
- Discuss: If no requests exist, start a new discussion under the relevant category so that project maintainers and the community can provide feedback
- Describe: Be sure to describe the use case and why it would be valuable to others. If possible, provide examples or mockups where applicable. Outline test cases that should pass.
Documentation improvements are always welcome! We strive to keep our docs clear and comprehensive, and your perspective can make a big difference. See our documentation contribution guide for details.
With a large userbase, it can be hard for our small team to keep up with all the feature requests and bug fixes. If you have the skills and time, we would love your help!
- If you start working on an issue, please assign it to yourself or ask a maintainer to do so. This helps avoid duplicate work.
- If you are looking for something to work on, check out the issues labeled "good first issue" or "help wanted".
Integrations are a core component of LangChain. LangChain provides standard interfaces for several different components (language models, vector stores, etc) that are crucial when building LLM applications. Contributing an integration helps expand LangChain's ecosystem and makes your service discoverable to millions of developers.
Why contribute an integration to LangChain?
- Discoverability: LangChain is the most used framework for building LLM applications, with over 20 million monthly downloads.
- Interoperability: LangChain components expose a standard interface, allowing developers to easily swap them for each other. If you implement a LangChain integration, any developer using a different component will easily be able to swap yours in.
- Best Practices: Through their standard interface, LangChain components encourage and facilitate best practices (streaming, async, etc.) that improve developer experience and application performance.
See our dedicated integration contribution guide for specific details and patterns. You can also check out the guides on extending LangChain.js in our docs.
Important: We no longer accept new integrations to this repository.
New integrations must be published as standalone packages. Here's how to contribute a new integration:
- Create your own repository to distribute LangChain integrations (e.g.,
https://github.com/yourname/langchain-yourservice) - Publish the package to npm (e.g.,
@yourname/langchain-yourserviceorlangchain-yourservice) - Let us know by opening an issue or discussion so we can add it to the list of recommended integrations
This is a monorepo managed with pnpm workspaces and Turborepo. Here's an overview of the main packages:
| Package | Path | Description |
|---|---|---|
langchain |
libs/langchain |
Main LangChain package with agents, prompts, and orchestration |
@langchain/core |
libs/langchain-core |
Core abstractions and interfaces (base classes, runnables, etc.) |
@langchain/textsplitters |
libs/langchain-textsplitters |
Text splitting utilities |
@langchain/openai |
libs/providers/langchain-openai |
OpenAI integration |
@langchain/anthropic |
libs/providers/langchain-anthropic |
Anthropic integration |
| Other providers | libs/providers/langchain-* |
First-party provider integrations |
When submitting a pull request:
- Fill out the PR template - Describe what your PR does, why it's needed, and any relevant context
- Link related issues - Use closing keywords like
Fixes #123to automatically close issues when your PR is merged - Keep PRs focused - One feature or fix per PR makes review easier and faster
- Add tests - Include unit tests for new functionality; integration tests for new external APIs
- Update documentation - If your change affects public APIs, update the relevant docs
- Run checks locally - Make sure
pnpm lint,pnpm format:check, andpnpm testpass before pushing
- A maintainer will review your PR and may request changes
- Please respond to feedback in a timely manner
- Once approved, a maintainer will merge your PR
Tip: If you'd like a shout-out on Twitter when your contribution is released, include your Twitter handle in the PR description!
- LangChain Forum: Connect with the community for technical questions, ideas, and feedback
- GitHub Issues: Bug reports and feature requests
- Slack: LangChain Community Slack
Although we try to have a developer setup to make it as easy as possible for others to contribute (see below), it is possible that some pain point may arise around environment setup, linting, documentation, or other.
Should that occur, please contact a maintainer! Not only do we want to help get you unblocked, but we also want to make sure that the process is smooth for future contributors.
In a similar vein, we do enforce certain linting, formatting, and documentation standards in the codebase. If you are finding these difficult (or even just annoying) to work with, feel free to contact a maintainer for help - we do not want these to get in the way of getting good code into the codebase.
As of now, LangChain has an ad hoc release process: releases are cut with high frequency by a developer and published to npm.
If your contribution has made its way into a release, we will want to give you credit on Twitter (only if you want though)! If you have a Twitter account you would like us to mention, please let us know in the PR or in another manner.
For testing unreleased changes, maintainers can publish dev releases of individual packages. Dev releases are published to npm with a special tag and version format that includes the git commit SHA.
To create a dev release:
- Go to Actions → 📦 Publish
- Click "Run workflow"
- Select the branch you want to release from (defaults to
main, but you can choose your feature branch) - Optionally change the npm tag (defaults to
dev) - Click "Run workflow"
Version format: x.y.z-<tag>.<short-sha> (e.g., 1.1.0-dev.abc1234)
To install a dev release:
# Install the latest dev release
npm install @langchain/core@dev
# Install a specific dev version
npm install @langchain/core@1.1.0-dev.abc1234Dev releases are useful for:
- Testing bug fixes before an official release
- Validating new features in downstream projects
- CI/CD pipelines that need to test against the latest changes
This project uses the following tools, which are worth getting familiar with if you plan to contribute:
- pnpm (v10.14.0) - dependency management
- oxlint - enforcing standard lint rules
- oxfmt - enforcing standard code formatting
- vitest - testing code
Clone this repo, then cd into it:
cd langchainjsNext, try running the following common tasks:
Our goal is to make it as easy as possible for you to contribute to this project. All commands can be run from the project root using pnpm --filter <package> to target specific workspaces.
Common package filters:
--filter langchain- the mainlangchainpackage--filter @langchain/core- the core package--filter @langchain/openai- OpenAI integration (and similarly for other providers)
Prerequisite: Node version v24.x is required. Please check node version node -v and update it if required.
To get started, install the dependencies for the project from the root:
pnpm installMake sure you have nvm installed and setup:
# switch to recommended Node.js version
nvm useThen, build the core package (required before working on other packages):
pnpm --filter @langchain/core buildWe use oxlint to enforce standard lint rules. To run the linter:
pnpm --filter langchain lintWe use oxfmt to enforce code formatting style. To run the formatter:
pnpm formatTo just check for formatting differences, without fixing them:
pnpm format:checkIn general, tests should be added within a tests/ folder alongside the modules they are testing.
Unit tests cover modular logic that does not require calls to outside APIs.
If you add new logic, please add a unit test. Unit tests should be called *.test.ts.
To run unit tests for a specific package:
pnpm --filter langchain test
pnpm --filter @langchain/core testIntegration tests cover logic that requires making calls to outside APIs (often integration with other services).
If you add support for a new external API, please add a new integration test. Integration tests should be called *.int.test.ts.
Note that most integration tests require credentials or other setup. You will likely need to set up a libs/langchain/.env or libs/community/langchain-community/.env file based on the .env.example file.
We generally recommend only running integration tests with pnpm --filter <package> test:single, but if you want to run all integration tests:
pnpm --filter langchain test:integrationWe use type tests to verify that TypeScript types work correctly. Type tests are files ending in .test-d.ts and use expectTypeOf from vitest to assert type behavior.
import { expectTypeOf } from "vitest";
expectTypeOf(someFunction).returns.toMatchTypeOf<ExpectedType>();Type tests ensure that:
- Public APIs have correct type signatures
- Generic types resolve correctly
- Type inference works as expected
To run type tests along with unit tests:
pnpm --filter langchain testFind more information on writing type tests in the Vitest docs.
To build a specific package:
pnpm --filter langchain build
pnpm --filter @langchain/core buildEnvironment tests test whether LangChain works across different JS environments, including Node.js (both ESM and CJS), Edge environments (eg. Cloudflare Workers), and browsers (using Webpack).
To run the environment tests with Docker, run the following command from the project root:
pnpm test:exports:docker