Code contributions are always welcome! Whether you’re fixing bugs, adding features, or improving performance, your contributions help deliver a better developer experience for thousands of developers.
Before submitting large new features or refactors, please first discuss your ideas in the forum. This ensures alignment with project goals and prevents duplicate work.This does not apply to bugfixes or small improvements, which you can contribute directly via pull requests. Be sure to link any relevant issues in your PR description. Use to automatically close issues when the PR is merged.New integrations should follow the integration guidelines.
git clone https://github.com/your-username/name-of-forked-repo.git# For instance, for LangChain:git clone https://github.com/parrot123/langchain.git# For LangGraph:git clone https://github.com/parrot123/langgraph.git
Copy
# Inside your repo, install dependenciesuv sync --all-groups
You will need to install uv if you haven’t previously.
Directories are relative to the package you’re working in.
Every code change must include comprehensive tests.
1
Unit tests
Location: tests/unit_tests/Requirements:
No network calls allowed
Test all code paths including edge cases
Use mocks for external dependencies
Copy
make test# Or directly:uv run --group test pytest tests/unit_tests
2
Integration tests
Integration tests require access to external services/ provider APIs (which can cost money) and therefore are not run by default.Not every code change will require an integration test, but keep in mind that we’ll require/ run integration tests separately as apart of our review process.Location: tests/integration_tests/Requirements:
Required: Complete type annotations for all functions
Copy
def process_documents( docs: list[Document], processor: DocumentProcessor, *, batch_size: int = 100) -> ProcessingResult: """Process documents in batches. Args: docs: List of documents to process. processor: Document processing instance. batch_size: Number of documents per batch. Returns: Processing results with success/failure counts. """
Create a minimal test case that demonstrates the bug. Maintainers and other contributors should be able to run this test and see the failure without additional setup or modification
2
Write failing tests
Add unit tests that would fail without your fix
3
Implement the fix
Make the minimal change necessary to resolve the issue
4
Verify the fix
Ensure that tests pass and no regressions are introduced
5
Document the change
Update docstrings if behavior changes, add comments for complex logic
We aim to keep the bar high for new features. We generally don’t accept new core abstractions, changes to infra, changes to dependencies, or new agents/chains from outside contributors without an existing issue that demonstrates an acute need for them.In general, feature contribution requirements include:
1
Design discussion
Open an issue describing:
The problem you’re solving
Proposed API design
Expected usage patterns
2
Implementation
Follow existing code patterns
Include comprehensive tests and documentation
Consider security implications
3
Integration considerations
How does this interact with existing features?
Are there performance implications?
Does this introduce new dependencies?
We will reject features that are likely to lead to security vulnerabilities or reports.
Before submitting your PR, ensure you have completed the following steps. Note that the requirements differ slightly between LangChain and LangGraph.
LangChain
LangGraph
1
Unit tests
Copy
make test
All unit tests must pass
2
Integration tests
Copy
make integration_tests
(Run if your changes affect integrations)
3
Formatting
Copy
make formatmake lint
Code must pass all style checks
4
Type checking
Copy
make type_check
All type hints must be valid
5
PR submission
Push your branch and open a pull request. Follow the provided form template. Note related issues using a closing keyword. After submitting, wait, and check to ensure the CI checks pass. If any checks fail, address the issues promptly - maintainers may close PRs that do not pass CI within a reasonable timeframe.
WIP - coming soon! In the meantime, follow instructions for LangChain.
Our goal is to have the most accessible developer setup possible. Should you experience any difficulty getting setup, please ask in the community slack or open a forum post.
You’re now ready to contribute high-quality code to LangChain!