Embed every mirrored message locally with a pinned model #43
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #9. Decision: ADR 0005 §2 to §5 and §7.
What to build
Image. The
Containerfiledownloadsonnx/model_quantized.onnxandtokenizer.jsonfromXenova/bge-small-en-v1.5at revisionea104dacec62c0de699686887e3f920caeb4f3e3. The build checks both sha256 values from ADR 0005 §2 and fails on a mismatch. The files go to a fixed path in the image, read-only, owned by root. Addonnxruntime,tokenizersandnumpytopyproject.tomlanduv.lock.Config. An optional
[embed]section withmodel_dir(default: the image path),batch(messages per tick, default 32),pause_seconds(default 0), andpoll_seconds(default 60). With the section absent, nothing loads the model.Schema v4.
embeddings(message_id INTEGER PRIMARY KEY, model TEXT NOT NULL, vec BLOB NOT NULL). The vector is 384 float32 values. Deleting a message deletes its vector in the same transaction. The reader waits for v4 as it does today.embed.py. OneEmbedderthat loads the session with one intra-op thread, tokenises with truncation at 512, and returns the CLS output L2-normalised. The input text is the subject plus the blade'strim_quotedplain text. One message per model run.The thread.
SyncWorker.run_foreverstarts anembedthread when[embed]is set. Each tick does three things:batchmessages without a vector for the current model, newest first.It then sleeps for
poll_seconds, or loops at once while a backlog remains, withpause_secondsbetween batches.Reporting.
mail_statusreportsembed: offorembed: model=bge-small-en-v1.5, plusembedded=Nper account.mailmind checkloads the model and embeds one fixed string.sync --onceruns one embed tick.Logs. Counts, the model name and timings only.
Acceptance
make checkpasses, including pip-audit.make image-amd64builds, and the image size growth is stated in the PR.