# Contributing to Engram Python SDK

Thank you for your interest in contributing to Engram.

## Development Setup

```bash
# Clone the repository
git clone https://github.com/Terronex-dev/engram-py.git
cd engram-py

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install in development mode with all extras
pip install -e ".[dev,langchain]"

# Run tests
pytest tests/ -v

# Run linter
ruff check src/

# Run type checker
mypy src/
```

## Code Standards

- **Type hints** — All functions must have complete type annotations
- **Docstrings** — Google-style docstrings for all public functions/classes
- **Tests** — New features require tests; maintain >90% coverage
- **Formatting** — Use ruff for linting (config in pyproject.toml)

## Pull Request Process

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/your-feature`)
3. Make your changes with tests
4. Run `pytest` and `ruff check src/` to verify
5. Commit with clear messages
6. Open a PR against `main`

## Commit Messages

Follow conventional commits:
- `feat:` New features
- `fix:` Bug fixes
- `docs:` Documentation changes
- `test:` Test additions/changes
- `refactor:` Code refactoring
- `chore:` Maintenance tasks

## Binary Format Compatibility

The Python SDK must maintain compatibility with the TypeScript reference implementation (`@terronex/engram`). Any changes to the binary format require:

1. Discussion in an issue first
2. Coordinated updates across all SDKs
3. Version bump to the format spec

## Questions?

Open an issue or reach out at dev@terronex.dev.
