docs/contributing/development.mdx
We strive to make contributions easy, collaborative, and enjoyable. Mem0 is a
polyglot monorepo containing the Python SDK (mem0/), the TypeScript SDK
(mem0-ts/), CLIs, integrations, the self-hosted server, and the docs site.
Follow the steps below for a smooth contribution process.
Always open an issue before opening a pull request. This lets us discuss the change, avoid duplicate work, and agree on the approach before you write code.
Every pull request must link to an issue using Closes #<issue-number>.
We cannot merge any pull request until you have signed our Contributor License Agreement (CLA). When you open your first PR, the CLA bot will comment with a link to sign — it takes less than a minute and only needs to be done once.
feature/my-new-featurefeat:, fix:, docs:, refactor:, test:)main, linking the issue and filling out the
PR template.For detailed guidance on pull requests, refer to GitHub's documentation.
mem0/)We use hatch as our package manager. Install it by following the official instructions.
Do NOT use pip or conda for dependency management. Instead, follow these steps in order:
# 1. Install base dependencies
make install
# 2. Activate virtual environment (this will install dependencies)
hatch shell # For default environment
hatch -e dev_py_3_11 shell # For dev_py_3_11 (differences are mentioned in pyproject.toml)
# 3. Install all optional dependencies
make install_all
Ensure pre-commit is installed before contributing (hooks run ruff + isort):
pre-commit install
ruffRun the linter and fix any reported issues before submitting your PR (line length 120):
make lint
To maintain a consistent code style, format your code and sort imports (isort, profile = "black"):
make format
make sort
pytestRun tests to verify functionality before submitting your PR:
make test
Note: Some dependencies have been removed from the main dependencies to reduce package size. Run make install_all to install necessary dependencies before running tests.
mem0-ts/)We use pnpm (v10+) for all TypeScript packages. Do NOT use
npm or yarn.
cd mem0-ts
pnpm install
pnpm run build # tsup (CJS + ESM)
pnpm run test # jest (all tests)
pnpm run test:unit # unit tests with coverage
pnpm run typecheck (or tsc --noEmit)import syntax — never require()Do not report security vulnerabilities through public issues or pull requests. Please follow our Security Policy to report them privately.
Packages are published automatically via GitHub Actions when a GitHub Release is
created with the correct tag prefix (e.g. v* for the Python SDK, ts-v* for the
TypeScript SDK). See
CONTRIBUTING.md
for the full tag-prefix table and publishing details.
Thank you for contributing to Mem0!