Thank you for your interest in contributing! This guide will help you get started.
# Clone the repository
git clone https://github.com/your-username/keepcontext-ai.git
cd keepcontext-ai
# Create virtual environment
uv venv .venv
.\.venv\Scripts\Activate.ps1 # Windows
source .venv/bin/activate # macOS/Linux
# Install all dependencies (prod + dev)
uv pip install -r requirements.txt
uv pip install -e ".[dev]"
# Copy environment template
cp .env.example .env
# Edit .env with your API keys# All tests with coverage
make test
# Unit tests only
pytest tests/unit/ -v
# Integration tests only
pytest tests/integration/ -v
# Specific test file
pytest tests/unit/test_workflow.py -v- PEP 8 conventions enforced by
ruff - black for formatting (line length 88)
- isort for import ordering (black profile)
- mypy strict mode for type checking
- Type annotations on all function signatures
- Docstrings on all public functions and classes
- Functions under 50 lines
- Files under 400 lines (800 max)
- Custom exceptions, never bare
except: - Dependency injection over global state
- Immutable models (
frozen=True)
# Check
make lint
# Auto-fix
make format- Create a branch from
develop:git checkout -b feat/your-feature develop - Write tests first (TDD)
- Implement the feature
- Ensure all tests pass:
make test - Ensure lint passes:
make lint - Commit with conventional commits:
feat:— new featurefix:— bug fixrefactor:— code restructuringdocs:— documentation onlytest:— test additions/changeschore:— build/tooling changes
- Open a PR against
develop
src/keepcontext_ai/
├── main.py # FastAPI entry point
├── config.py # Settings (env-based)
├── api/routes/ # REST endpoints
├── memory/ # ChromaDB vector storage
├── embeddings/ # OpenAI embedding pipeline
├── context/ # Context retrieval engine
├── graph/ # Neo4j knowledge graph
├── llm/ # Groq LLM inference
├── agents/ # LangGraph agent workflow
└── exceptions/ # Custom exception hierarchy
- Add schemas in the relevant
schemas.py - Add service logic in the appropriate module
- Add API route in
api/routes/ - Register the router in
main.py - Write unit tests in
tests/unit/ - Write integration tests in
tests/integration/ - Update documentation in
README.mdanddocs/
Open an issue on GitHub for discussion.