Contributing to LangGraph
Thank you for your interest in contributing to LangGraph! This guide will help you get started.
Development Setup
Prerequisites
- Python 3.9+
- Poetry for dependency management
Installation
git clone https://github.com/langchain-ai/langgraph.git
cd langgraph
poetry install --with dev,test
Running Tests
# Run all tests
poetry run pytest
# Run specific test file
poetry run pytest tests/unit_tests/test_graph.py
# Run with coverage
poetry run pytest --cov=langgraph
Contribution Workflow
- Check existing issues: Look for open issues or discussions before starting work
- Create an issue: For significant changes, open an issue to discuss the approach
- Fork and branch: Create a feature branch from
main - Implement: Write your code following our style guidelines
- Test: Add tests for new functionality, ensure all existing tests pass
- Document: Update docstrings and documentation as needed
- Submit PR: Open a pull request with a clear description
Pull Request Standards
Required
- All CI checks must pass (lint, type check, tests)
- New features must include test coverage
- Public API changes must include docstring updates
- Breaking changes must be discussed in an issue first
PR Description Template
- What: Brief description of the change
- Why: Motivation and context
- How: Implementation approach
- Testing: How the change was tested
Code Quality
- Format with
blackandruff - Type check with
mypy --strict - Sort imports with
isort - Lint with
ruff check
Areas for Contribution
- New checkpoint backends (Redis, DynamoDB, etc.)
- Example agent implementations
- Documentation improvements and tutorials
- Performance optimizations in the Pregel execution engine
- Bug fixes and test coverage improvements
License
By contributing, you agree that your contributions will be licensed under the MIT License.