Enable local embeddings and hybrid people search #23

Merged
piers merged 1 commit from feat/svd-dev-peoplemind-mcp-7-local-embeddings-on-by-default-3e27f1f9 into main 2026-11-01 11:56:34 +00:00
Collaborator

Add pinned, hash-verified model fetching, default-on embedding configuration, schema v5 Person vectors, content-based refresh, and single-threaded ONNX inference. Wire sync backfill and lazy API loading into lexical, hybrid, and semantic search while preserving exact-handle priority and lexical fallback.

Cover refresh, merge and Forget cleanup, disabled and missing-model behavior, HTTP ranking, fetch integrity, and worker isolation. Validation: 246 passed, 5 skipped (3 Radicale, 2 model); mypy, ruff, formatting, and native package build passed.

Closes #7
Co-Authored-By: gpt-6.1-sol noreply@openai.com

Add pinned, hash-verified model fetching, default-on embedding configuration, schema v5 Person vectors, content-based refresh, and single-threaded ONNX inference. Wire sync backfill and lazy API loading into lexical, hybrid, and semantic search while preserving exact-handle priority and lexical fallback. Cover refresh, merge and Forget cleanup, disabled and missing-model behavior, HTTP ranking, fetch integrity, and worker isolation. Validation: 246 passed, 5 skipped (3 Radicale, 2 model); mypy, ruff, formatting, and native package build passed. Closes #7 Co-Authored-By: gpt-6.1-sol <noreply@openai.com>
Add pinned, hash-verified model fetching, default-on embedding configuration, schema v5 Person vectors, content-based refresh, and single-threaded ONNX inference. Wire sync backfill and lazy API loading into lexical, hybrid, and semantic search while preserving exact-handle priority and lexical fallback.

Cover refresh, merge and Forget cleanup, disabled and missing-model behavior, HTTP ranking, fetch integrity, and worker isolation. Validation: 246 passed, 5 skipped (3 Radicale, 2 model); mypy, ruff, formatting, and native package build passed.

Closes #7
Co-Authored-By: gpt-6.1-sol <noreply@openai.com>
Owner

Architect verification (scratch worktree at f17282d, outside the repo dir):

  • pytest without the model: 246 passed, 5 skipped (3 Radicale, 2 model); baseline before #7 was 232 passed, 3 skipped
  • make model with the pre-fetched files present: model=ok via the hash-match path; the download path into an empty directory also returned model=ok with both files
  • model-marked tests: 2 passed (role and organisation queries rank the expected Person first in a fixture of 50; vectors normalised, one intra-op and one inter-op thread)
  • full suite with the model present: 248 passed, 3 skipped
  • mypy --strict clean over 31 source files; ruff check and format clean; uv lock --check resolved 107 packages
  • no nested .git; models/.gitignore is *; write set is exactly the 16 Primary Files
  • codex-svd integrate: readyForMerge true, testResult green, CI absent (repo has no CI)

Gate rulings confirmed in the diff: the model pins match mailmind ADR 0005 §2 byte for byte; the fetch script is stdlib Python with staged atomic placement; CLS pooling, L2-normalised, no query prefix, one text per run, one thread; relation labels enter person_text; Error: code=embed-off and on covered=N; API-side lazy load behind a lock, reset by build_app; sync clears the table when disabled and never refuses boot on a missing model; person_vectors cascades from persons; no plaintext stored, codes and counts only on stdout and in logs; migration 5 appended, schema literals bumped in the three tests; conftest defaults [embed] enabled = false.

One nit, accepted: scripts/fetch_model.py writes a .gitignore of * into the parent of whichever destination it is given. For the default models/ path that is the intended effect.

Ready for the operator to merge. ADR 0006 Amendment 1 and the README update follow in an architect PR.

Architect verification (scratch worktree at f17282d, outside the repo dir): - pytest without the model: 246 passed, 5 skipped (3 Radicale, 2 model); baseline before #7 was 232 passed, 3 skipped - `make model` with the pre-fetched files present: `model=ok` via the hash-match path; the download path into an empty directory also returned `model=ok` with both files - model-marked tests: 2 passed (role and organisation queries rank the expected Person first in a fixture of 50; vectors normalised, one intra-op and one inter-op thread) - full suite with the model present: 248 passed, 3 skipped - mypy --strict clean over 31 source files; ruff check and format clean; `uv lock --check` resolved 107 packages - no nested .git; `models/.gitignore` is `*`; write set is exactly the 16 Primary Files - `codex-svd integrate`: readyForMerge true, testResult green, CI absent (repo has no CI) Gate rulings confirmed in the diff: the model pins match mailmind ADR 0005 §2 byte for byte; the fetch script is stdlib Python with staged atomic placement; CLS pooling, L2-normalised, no query prefix, one text per run, one thread; relation labels enter `person_text`; `Error: code=embed-off` and `on covered=N`; API-side lazy load behind a lock, reset by `build_app`; sync clears the table when disabled and never refuses boot on a missing model; `person_vectors` cascades from `persons`; no plaintext stored, codes and counts only on stdout and in logs; migration 5 appended, schema literals bumped in the three tests; conftest defaults `[embed] enabled = false`. One nit, accepted: `scripts/fetch_model.py` writes a `.gitignore` of `*` into the parent of whichever destination it is given. For the default `models/` path that is the intended effect. Ready for the operator to merge. ADR 0006 Amendment 1 and the README update follow in an architect PR.
piers merged commit 41f602aa5a into main 2026-11-01 11:56:34 +00:00
Sign in to join this conversation.
No description provided.