Welcome to Engram development! This guide walks you through setting up your local environment to contribute code to the project.
Before you start, make sure you have:
-
Python 3.11 or higher \\�ash python --version \\
-
Git (for version control) \\�ash git --version \\
-
A code editor (VS Code, PyCharm, or similar)
-
PostgreSQL (optional, for team-mode testing)
- Local development works with SQLite by default
- Only needed if you're testing the \ENGRAM_DB_URL\ workflow
- Go to https://github.com/imadahmad9507-ops/Engram
- Click the Fork button (top-right corner)
- Select your GitHub username as the owner
- Click Create fork
\\�ash git clone https://github.com/YOUR-USERNAME/Engram.git cd Engram \\
Replace \YOUR-USERNAME\ with your actual GitHub username.
This lets you stay in sync with the main repository:
\\�ash git remote add upstream https://github.com/imadahmad9507-ops/Engram.git git remote -v # Verify both origin and upstream are configured \\
A virtual environment isolates project dependencies from your system Python.
On Windows (PowerShell): \\powershell python -m venv venv .\venv\Scripts\Activate.ps1 \\
On macOS / Linux: \\�ash python3.11 -m venv venv source venv/bin/activate \\
You should see (venv)\ appear at the start of your terminal prompt.
\\�ash pip install --upgrade pip \\
\\�ash pip install -e ".[dev]" \\
This installs:
- Engram itself in editable mode (changes to code take effect immediately)
- All required dependencies
- Development tools for testing and linting
\\�ash where python # Windows which python # macOS/Linux \\
\\�ash python -c "import engram; print('✓ Engram imported successfully')" \\
\\�ash python -m engram \\
Press \Ctrl+C\ to stop it.
\\�ash pytest tests/ \\
\\�ash pytest tests/ --cov=src/engram \\
\\�ash pytest tests/test_commit.py -v \\
Before making changes, create a branch:
\\�ash
git checkout main git pull upstream main
git checkout -b feature/your-feature-name \\
Good branch names:
- \ix/conflict-detection-threshold\
- \docs/add-troubleshooting-guide\
- \eature/improve-entity-extraction\
Make your changes in:
- Core logic: /src/engram/\
- Tests: /tests/\
- Documentation: /docs/\ or \README.md\
\\�ash pytest tests/ --tb=short \\
\\�ash
black src/engram tests/
flake8 src/engram tests/ \\
\\�ash
git status
git add src/engram/ tests/
git commit -m "docs: add developer setup guide with troubleshooting section" \\
Commit message format:
- Start with \ix:, \eat:, \docs:, \ est:, or \chore:\
- First line: short summary (50 chars max)
- Add blank line + details if needed
\\�ash git push origin feature/your-feature-name \\
- Go to https://github.com/YOUR-USERNAME/Engram
- Click Compare & pull request
- Fill in the PR description explaining what you changed and why
- Click Create Pull Request
If maintainers suggest changes:
- Make the changes on your branch
- Commit: \git commit -am "Update based on review feedback"\
- Push: \git push origin feature/your-feature-name\
- The PR updates automatically
Solution: Make sure you're in the \Engram\ directory and your venv is activated: \\�ash cd Engram .\venv\Scripts\Activate.ps1 # Windows PowerShell source venv/bin/activate # macOS/Linux pip install -e ".[dev]" \\
Solution: Reinstall in editable mode: \\�ash pip install -e ".[dev]" --force-reinstall \\
Solution: Initialize the database: \\�ash python -m engram --init-db pytest tests/ \\
Solution: \\�ash chmod +x install.sh ./install.sh \\
\\�ash git fetch upstream git rebase upstream/main git push origin main \\
\\�ash pytest tests/test_file.py::test_name -vv -s \\
- Read the Architecture: See docs/IMPLEMENTATION.md
- Check Contribution Guidelines: See CONTRIBUTING.md
- Ask Questions: Open a GitHub Discussion if needed
Welcome to Engram development! We're glad you're here. 🎉