Development Contributions
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.
For the complete contributor checklist, see
CONTRIBUTING.md in
the repository root. By participating you agree to our
Code of Conduct.
Before You Start
1. Open an Issue First
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.- Search existing issues first.
- If none match, open a bug report or feature request.
- For anything beyond a trivial fix, wait for a maintainer to confirm the approach.
Closes #<issue-number>, and that
issue must carry the accepted label. A maintainer applies accepted once we
agree the change is worth making. Pull requests that do not link an accepted
issue are closed automatically, with instructions to reopen once the label is
applied. Documentation-only changes are exempt.
Closed does not mean rejected. Getting the label and reopening takes about a
minute, and the check reruns on reopen.
Show Your Work
Both issue forms ask how you verified the problem: what you ran, the real output you saw, and why it is a bug rather than expected behavior. Reports without that are hard to act on and usually sit unanswered. They also ask whether AI was involved. That question is about how the problem was found and confirmed, not about how the text was written: drafting the write-up with a model is fine. The same applies to pull requests, where the AI disclosure covers the code in the diff. We ask because it tells reviewers where to look, not because it counts against you.2. Sign the Contributor License Agreement (CLA)
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.Submitting Your Contribution through a PR
- Fork & Clone the repository: Mem0 on GitHub
- Create a Feature Branch: Use a dedicated branch, e.g.,
feature/my-new-feature - Implement Changes: If adding a feature or fixing a bug, be sure to:
- Write necessary tests
- Add documentation, docstrings, and runnable examples
- Code Quality Checks:
- Run linting to catch style issues
- Ensure all tests pass
- Commit using Conventional Commits
(
feat:,fix:,docs:,refactor:,test:) - Submit a Pull Request against
main, linking the issue and filling out the PR template.
Python SDK (mem0/)
Dependency Management
We usehatch 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:
Pre-commit Hooks
Ensurepre-commit is installed before contributing (hooks run ruff + isort):
Linting with ruff
Run the linter and fix any reported issues before submitting your PR (line length 120):
Code Formatting
To maintain a consistent code style, format your code and sort imports (isort,profile = "black"):
Testing with pytest
Run tests to verify functionality before submitting your PR:
make install_all to install necessary dependencies before running tests.
TypeScript SDK (mem0-ts/)
We use pnpm (v10+) for all TypeScript packages. Do NOT use
npm or yarn.
Standards
- Build: tsup
- Formatter: Prettier
- Tests: jest
- Always run type checking after changes:
pnpm run typecheck(ortsc --noEmit) - Use ES module
importsyntax: neverrequire()
Reporting Security Issues
Do not report security vulnerabilities through public issues or pull requests. Please follow our Security Policy to report them privately.Release Process
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!