From 8b53b1473acca1ac380a90d8e50318d15b9482b6 Mon Sep 17 00:00:00 2001 From: Dev Khant Date: Tue, 4 Mar 2025 15:47:38 +0530 Subject: [PATCH] Add contribution docs (#2294) --- docs/contributing/development.mdx | 87 +++++++++++++++++++++++++++++ docs/contributing/documentation.mdx | 55 ++++++++++++++++++ docs/docs.json | 8 +++ 3 files changed, 150 insertions(+) create mode 100644 docs/contributing/development.mdx create mode 100644 docs/contributing/documentation.mdx diff --git a/docs/contributing/development.mdx b/docs/contributing/development.mdx new file mode 100644 index 00000000..e65b2070 --- /dev/null +++ b/docs/contributing/development.mdx @@ -0,0 +1,87 @@ +--- +title: Development +icon: "code" +--- + +# Development Contributions + +We strive to make contributions **easy, collaborative, and enjoyable**. Follow the steps below to ensure a smooth contribution process. + +## Submitting Your Contribution through PR + +To contribute, follow these steps: + +1. **Fork & Clone** the repository: [Mem0 on GitHub](https://github.com/mem0ai/mem0) +2. **Create a Feature Branch**: Use a dedicated branch for your changes, e.g., `feature/my-new-feature` +3. **Implement Changes**: If adding a feature or fixing a bug, ensure to: + - Write necessary **tests** + - Add **documentation, docstrings, and runnable examples** +4. **Code Quality Checks**: + - Run **linting** to catch style issues + - Ensure **all tests pass** +5. **Submit a Pull Request** ๐Ÿš€ + +For detailed guidance on pull requests, refer to [GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). + +--- + +## ๐Ÿ“ฆ Dependency Management + +We use `poetry` as our package manager. Install it by following the [official instructions](https://python-poetry.org/docs/#installation). + +โš ๏ธ **Do NOT use `pip` or `conda` for dependency management.** Instead, run: + +```bash +make install_all + +# Activate virtual environment +poetry shell +``` + +--- + +## ๐Ÿ› ๏ธ Development Standards + +### โœ… Pre-commit Hooks + +Ensure `pre-commit` is installed before contributing: + +```bash +pre-commit install +``` + +### ๐Ÿ” Linting with `ruff` + +Run the linter and fix any reported issues before submitting your PR: + +```bash +make lint +``` + +### ๐ŸŽจ Code Formatting with `black` + +To maintain a consistent code style, format your code using `black`: + +```bash +make format +``` + +### ๐Ÿงช Testing with `pytest` + +Run tests to verify functionality before submitting your PR: + +```bash +make test +``` + +๐Ÿ’ก **Note:** Some dependencies have been removed from Poetry to reduce package size. Run `make install_all` to install necessary dependencies before running tests. + +--- + +## ๐Ÿš€ Release Process + +Currently, releases are handled manually. We aim for frequent releases, typically when new features or bug fixes are introduced. + +--- + +Thank you for contributing to Mem0! ๐ŸŽ‰ \ No newline at end of file diff --git a/docs/contributing/documentation.mdx b/docs/contributing/documentation.mdx new file mode 100644 index 00000000..33b445de --- /dev/null +++ b/docs/contributing/documentation.mdx @@ -0,0 +1,55 @@ +--- +title: Documentation +icon: "book" +--- + +# Documentation Contributions + +## ๐Ÿ“Œ Prerequisites + +Before getting started, ensure you have **Node.js (version 23.6.0 or higher)** installed on your system. + +--- + +## ๐Ÿš€ Setting Up Mintlify + +### Step 1: Install Mintlify + +Install Mintlify globally using your preferred package manager: + + + +```bash npm +npm i -g mintlify +``` + +```bash yarn +yarn global add mintlify +``` + + + +### Step 2: Run the Documentation Server + +Navigate to the `docs/` directory (where `docs.json` is located) and start the development server: + +```bash +mintlify dev +``` + +The documentation website will be available at: [http://localhost:3000](http://localhost:3000). + +--- + +## ๐Ÿ”ง Custom Ports + +By default, Mintlify runs on **port 3000**. To use a different port, add the `--port` flag: + +```bash +mintlify dev --port 3333 +``` + +--- + +By following these steps, you can efficiently contribute to **Mem0's documentation**. Happy documenting! โœ๏ธ + diff --git a/docs/docs.json b/docs/docs.json index 0c197d58..54bcd16b 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -155,6 +155,14 @@ ] } ] + }, + { + "group": "Contribution", + "icon": "handshake", + "pages": [ + "contributing/development", + "contributing/documentation" + ] } ] },