|
| 1 | +# Contributing to MemU |
| 2 | + |
| 3 | +Thank you for your interest in contributing to MemU! This document provides guidelines and information for contributors. |
| 4 | + |
| 5 | +## π Ways to Contribute |
| 6 | + |
| 7 | +We welcome all types of contributions: |
| 8 | + |
| 9 | +- π **Bug Reports** - Help us identify and fix issues |
| 10 | +- π‘ **Feature Requests** - Suggest new capabilities and improvements |
| 11 | +- π **Documentation** - Improve guides, examples, and API docs |
| 12 | +- π§ **Code Contributions** - Add features, fix bugs, optimize performance |
| 13 | +- π§ͺ **Testing** - Write tests, improve coverage, test edge cases |
| 14 | +- π¨ **UI/UX** - Enhance user experience and interface design |
| 15 | +- π **Translations** - Help make MemU accessible globally |
| 16 | +- π’ **Community** - Help others in discussions and support channels |
| 17 | + |
| 18 | +## π Quick Start for Contributors |
| 19 | + |
| 20 | +### Prerequisites |
| 21 | +- Python 3.8+ |
| 22 | +- Git |
| 23 | +- A code editor (VS Code recommended) |
| 24 | + |
| 25 | +### Development Setup |
| 26 | + |
| 27 | +```bash |
| 28 | +# 1. Fork the repository on GitHub |
| 29 | +# 2. Clone your fork locally |
| 30 | +git clone https://github.com/YOUR_USERNAME/MemU.git |
| 31 | +cd MemU |
| 32 | + |
| 33 | +# 3. Create a virtual environment |
| 34 | +python -m venv venv |
| 35 | +source venv/bin/activate # On Windows: venv\Scripts\activate |
| 36 | + |
| 37 | +# 4. Install development dependencies |
| 38 | +pip install -e ".[dev]" |
| 39 | + |
| 40 | +# 5. Install pre-commit hooks |
| 41 | +make pre-commit-install |
| 42 | + |
| 43 | +# 6. Verify setup by running tests |
| 44 | +make test |
| 45 | +``` |
| 46 | + |
| 47 | +### Available Commands |
| 48 | + |
| 49 | +```bash |
| 50 | +make help # Show all available commands |
| 51 | +make test # Run tests |
| 52 | +make coverage # Run tests with coverage report |
| 53 | +make lint # Run linting (flake8, mypy) |
| 54 | +make format # Format code (black, isort) |
| 55 | +make pre-commit-run # Run all pre-commit checks |
| 56 | +make clean # Clean build artifacts |
| 57 | +``` |
| 58 | + |
| 59 | +## π§ Development Guidelines |
| 60 | + |
| 61 | +### Code Style |
| 62 | +- Follow **PEP 8** Python style guidelines |
| 63 | +- Use **Black** for code formatting (line length: 88) |
| 64 | +- Use **isort** for import sorting |
| 65 | +- Use **type hints** for all functions and methods |
| 66 | +- Write **docstrings** for public APIs |
| 67 | + |
| 68 | +### Code Quality Standards |
| 69 | +- Maintain **test coverage > 80%** |
| 70 | +- All code must pass **linting** (flake8, mypy) |
| 71 | +- Use **meaningful variable and function names** |
| 72 | +- Keep functions **focused and small** |
| 73 | +- Follow **SOLID principles** |
| 74 | + |
| 75 | +### Testing |
| 76 | +```bash |
| 77 | +# Run all tests |
| 78 | +pytest |
| 79 | + |
| 80 | +# Run with coverage |
| 81 | +pytest --cov=memu --cov-report=html |
| 82 | + |
| 83 | +# Run specific test file |
| 84 | +pytest tests/test_memory_agent.py |
| 85 | + |
| 86 | +# Run tests with specific marker |
| 87 | +pytest -m "not slow" |
| 88 | +``` |
| 89 | + |
| 90 | +## π Submitting Changes |
| 91 | + |
| 92 | +### Before You Start |
| 93 | +1. **Search existing issues** to avoid duplicates |
| 94 | +2. **Create an issue** for new features or major changes |
| 95 | +3. **Discuss your approach** in the issue before implementing |
| 96 | + |
| 97 | +### Creating Issues |
| 98 | + |
| 99 | +When reporting bugs, please include: |
| 100 | +- **Environment details** (Python version, OS, MemU version) |
| 101 | +- **Reproduction steps** with minimal code example |
| 102 | +- **Expected vs actual behavior** |
| 103 | +- **Error messages** or stack traces |
| 104 | + |
| 105 | +For feature requests, please describe: |
| 106 | +- **The problem** you're trying to solve |
| 107 | +- **Proposed solution** or approach |
| 108 | +- **Alternative solutions** you've considered |
| 109 | +- **Use cases** and examples |
| 110 | + |
| 111 | +### Pull Request Process |
| 112 | + |
| 113 | +1. **Create a feature branch** |
| 114 | + ```bash |
| 115 | + git checkout -b feature/amazing-feature |
| 116 | + # or for bug fixes |
| 117 | + git checkout -b bugfix/fix-memory-leak |
| 118 | + ``` |
| 119 | + |
| 120 | +2. **Make your changes** |
| 121 | + - Write clear, descriptive commit messages |
| 122 | + - Keep commits focused and atomic |
| 123 | + - Add tests for new functionality |
| 124 | + - Update documentation as needed |
| 125 | + |
| 126 | +3. **Test your changes** |
| 127 | + ```bash |
| 128 | + make test |
| 129 | + make lint |
| 130 | + make coverage |
| 131 | + ``` |
| 132 | + |
| 133 | +4. **Submit pull request** |
| 134 | + - Use descriptive title and description |
| 135 | + - Reference related issues (e.g., "Fixes #123") |
| 136 | + - Include testing instructions |
| 137 | + - Add screenshots for UI changes |
| 138 | + |
| 139 | +### Commit Message Format |
| 140 | + |
| 141 | +Use conventional commit format: |
| 142 | + |
| 143 | +``` |
| 144 | +type(scope): description |
| 145 | +
|
| 146 | +Examples: |
| 147 | +feat(memory): add semantic search functionality |
| 148 | +fix(llm): resolve OpenAI timeout issues |
| 149 | +docs(readme): update installation instructions |
| 150 | +test(agent): add unit tests for memory retrieval |
| 151 | +refactor(core): restructure memory storage logic |
| 152 | +``` |
| 153 | + |
| 154 | +**Types:** |
| 155 | +- `feat`: New feature |
| 156 | +- `fix`: Bug fix |
| 157 | +- `docs`: Documentation changes |
| 158 | +- `test`: Adding or fixing tests |
| 159 | +- `refactor`: Code restructuring without feature changes |
| 160 | +- `perf`: Performance improvements |
| 161 | +- `chore`: Maintenance tasks |
| 162 | + |
| 163 | +## π― Current Priorities |
| 164 | + |
| 165 | +We're currently focusing on: |
| 166 | + |
| 167 | +| Priority | Area | Description | |
| 168 | +|----------|------|-------------| |
| 169 | +| π₯ **High** | Multi-modal Support | Images, audio, video memory processing | |
| 170 | +| π₯ **High** | Performance | Memory retrieval optimization, caching | |
| 171 | +| π₯ **High** | LLM Providers | Additional provider integrations | |
| 172 | +| π‘ **Medium** | Enterprise Features | SSO, RBAC, audit logging | |
| 173 | +| π‘ **Medium** | Mobile SDKs | React Native, Flutter support | |
| 174 | +| π’ **Low** | UI Improvements | Dashboard, memory visualization | |
| 175 | + |
| 176 | +## π·οΈ Issue Labels |
| 177 | + |
| 178 | +| Label | Description | |
| 179 | +|-------|-------------| |
| 180 | +| `good first issue` | Perfect for newcomers | |
| 181 | +| `help wanted` | Extra attention needed | |
| 182 | +| `bug` | Something isn't working | |
| 183 | +| `enhancement` | New feature request | |
| 184 | +| `documentation` | Improvements to docs | |
| 185 | +| `performance` | Performance optimization | |
| 186 | +| `breaking change` | Requires version bump | |
| 187 | +| `priority:high` | Urgent issues | |
| 188 | +| `priority:medium` | Important issues | |
| 189 | +| `priority:low` | Nice to have | |
| 190 | + |
| 191 | +## π Code Review Process |
| 192 | + |
| 193 | +### For Contributors |
| 194 | +- Be open to feedback and constructive criticism |
| 195 | +- Respond promptly to review comments |
| 196 | +- Make requested changes in new commits (don't force push) |
| 197 | +- Ask questions if feedback is unclear |
| 198 | + |
| 199 | +### For Reviewers |
| 200 | +- Be constructive and respectful in feedback |
| 201 | +- Focus on code quality, maintainability, and project goals |
| 202 | +- Suggest improvements with explanations |
| 203 | +- Approve when ready, request changes when needed |
| 204 | + |
| 205 | +## π Security |
| 206 | + |
| 207 | +**Reporting Security Issues:** |
| 208 | +- **DO NOT** create public issues for security vulnerabilities |
| 209 | +- Email security issues privately to [security@nevamind.ai](mailto:security@nevamind.ai) |
| 210 | +- Include detailed reproduction steps and impact assessment |
| 211 | +- We'll acknowledge receipt within 24 hours |
| 212 | + |
| 213 | +## π License and Attribution |
| 214 | + |
| 215 | +By contributing to MemU, you agree that: |
| 216 | +- Your contributions will be licensed under the **Apache License 2.0** |
| 217 | +- You have the right to contribute the code/content |
| 218 | +- Your contribution doesn't violate any third-party rights |
| 219 | + |
| 220 | +## π Community Guidelines |
| 221 | + |
| 222 | +- Be respectful and inclusive |
| 223 | +- Follow our [Code of Conduct](CODE_OF_CONDUCT.md) |
| 224 | +- Help others learn and grow |
| 225 | +- Share knowledge and best practices |
| 226 | +- Celebrate diverse perspectives and experiences |
| 227 | + |
| 228 | +## π Getting Help |
| 229 | + |
| 230 | +| Channel | Best For | |
| 231 | +|---------|----------| |
| 232 | +| π¬ [Discord](https://discord.gg/hQZntfGsbJ) | Real-time chat, quick questions | |
| 233 | +| π£οΈ [GitHub Discussions](https://github.com/NevaMind-AI/MemU/discussions) | Feature discussions, Q&A | |
| 234 | +| π [GitHub Issues](https://github.com/NevaMind-AI/MemU/issues) | Bug reports, feature requests | |
| 235 | +| π§ [Email](mailto:contact@nevamind.ai) | Private inquiries | |
| 236 | + |
| 237 | +## π Recognition |
| 238 | + |
| 239 | +Contributors are recognized in: |
| 240 | +- README.md contributors section |
| 241 | +- Release notes for significant contributions |
| 242 | +- Our [Contributors](https://github.com/NevaMind-AI/MemU/graphs/contributors) page |
| 243 | + |
| 244 | +Thank you for helping make MemU better! π |
0 commit comments