Welcome to Engram development. This guide walks through setting up a local environment for contributing code to the project.
Before you start, make sure you have:
- Python 3.11 or higher
- Git
- Make
- A code editor such as VS Code or PyCharm
- Docker, optional for container-based development
- PostgreSQL, optional for testing the
ENGRAM_DB_URLworkflow
Verify the core tools:
python --version
git --version
make helpLocal development uses SQLite by default, so PostgreSQL is only needed when you are explicitly testing the team-mode database path.
- Fork the repository on GitHub.
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/Engram.git
cd Engram- Add the upstream remote:
git remote add upstream https://github.com/Agentscreator/engram-memory.git
git remote -vReplace YOUR-USERNAME with your GitHub username.
Create and activate a virtual environment.
On Windows PowerShell:
python -m venv venv
.\venv\Scripts\Activate.ps1On macOS or Linux:
python3.11 -m venv venv
source venv/bin/activateThen install Engram and development dependencies:
make installThis installs Engram in editable mode, project dependencies, and development tools such as pytest and ruff.
If your machine has multiple Python installations, pin the interpreter explicitly:
make install PYTHON=/path/to/python
make test PYTHON=/path/to/pythonCheck that Engram imports correctly:
python -c "import engram; print('Engram imported successfully')"Run the local HTTP MCP server:
make serveOpen the local dashboard at:
http://127.0.0.1:7474/dashboard
Press Ctrl+C to stop the server.
Use the root Makefile as the canonical command entry point:
make helpCommon targets:
make install # Install development dependencies
make test # Run CI-style tests
make lint # Run ruff lint checks
make format # Format Python files with ruff
make format-check # Check formatting without writing changes
make check # Run lint, format-check, and tests
make build # Build Python package artifacts
make clean # Remove local build/cache artifacts
make serve # Run the local HTTP MCP serverDocker targets:
make docker-build
make docker-up
make docker-up-sqlite
make docker-up-postgres
make docker-down
make docker-logsmake docker-up starts the SQLite profile by default. Use make docker-up-postgres when you need the PostgreSQL profile.
Create a feature branch before making changes:
git checkout main
git pull upstream main
git checkout -b feature/your-feature-nameGood branch names:
fix/conflict-detection-thresholddocs/add-troubleshooting-guidefeature/improve-entity-extraction
Make your changes in the relevant area:
- Core logic:
src/engram/ - Tests:
tests/ - Documentation:
docs/,README.md, or contributor docs
Before opening a PR, run:
make checkFor focused testing:
make test
make test TEST_ARGS="tests/test_file.py::test_name -vv -s"Review your changes:
git status
git diffStage and commit:
git add <changed-files>
git commit -m "docs: update developer setup workflow"Use conventional commit prefixes such as fix:, feat:, docs:, test:, or chore:.
Push your branch:
git push origin feature/your-feature-name- Open your fork on GitHub.
- Click Compare & pull request.
- Explain what changed, why it changed, and how you tested it.
- Create the pull request.
If maintainers request changes, update your branch and push again. The PR updates automatically.
Make sure you are in the repository root and your virtual environment is active:
cd Engram
make installReinstall the editable package:
make installInitialize the local database, then rerun tests:
python -m engram --init-db
make testCheck Docker is running and inspect the logs:
docker --version
make docker-logsFor PostgreSQL profile testing, set required overrides in a local .env file and never commit secrets.
- Read docs/IMPLEMENTATION.md.
- Review CONTRIBUTING.md.
- Open a GitHub Discussion if you need design alignment before implementing.