Contributing¶
Setup¶
Running tests¶
All 135 tests are pure Python — no Rust, Java, Ruby, or C compiler needed. The extractors are regex-based and tested with string fixtures.
Running docs locally¶
Opens the documentation site at http://127.0.0.1:8000 with live reload.
Project structure¶
memoire/
cli.py # CLI commands (init, ingest, start, stop, install-service, uninstall-service, check, mcp, hook-event, pre-read)
db.py # SurrealDB connection and schema management
daemon.py # Background daemon (filesystem watcher + hook event receiver)
ingester.py # Quick scan and deep ingest
processor.py # Static analysis extractors + LLM markdown extraction
sdk.py # Core graph operations (store, query, score, promote, detect cycles)
mcp_server.py # MCP server (get_context, expand, search, recent_events)
tests/
test_extractors.py # All unit tests
docs/ # MkDocs documentation source
mkdocs.yml # MkDocs configuration
Adding a new language¶
- Add side-effect patterns to
processor.pyas_SIDE_EFFECT_PATTERNS_<LANG> - Add a
_detect_side_effects_<lang>function - Optionally add
_extract_state_mutations_<lang>if the language has mutable instance state - Add
_extract_<lang>for imports, inheritance, and test assertion edges - Add the suffix to
process_file's dispatch block (both side-effect and graph sections) - Update
_is_test_pathinsdk.pyfor the language's test file conventions - Add tests in
tests/test_extractors.py - Update the language table in
docs/languages.mdandREADME.md
Adding a new provider¶
- Add the provider name to
_PROVIDER_CHOICESincli.py - Add LLM defaults to
_LLM_DEFAULTS - Write a
_configure_<provider>function that creates the right instructions file and MCP config - Add the provider to
init's dispatch block - If the provider uses a new LLM API, add a branch in
_call_llminprocessor.py - Update
docs/providers.md
Code style¶
- No comments unless the why is non-obvious
- No docstrings beyond one-line summaries
- Minimal changes — don't refactor adjacent code while fixing a bug
- All new extractors must have tests before merging