Repository navigation
Embedding write-wrappers for cloud pull apply (core, sync #97 PR3) - #1417
Conversation
The Pro daemon's upcoming embedding PULL needs to apply vectors synced from another device into the local store, but `upsert_embeddings` / `delete_embeddings` were store-only (the read API from #1416 added reads; this adds the symmetric writes). Surface both as `NodeService` wrappers: - `NodeService::upsert_embeddings(node_id, Vec<NewEmbedding>)` — replace a node's vectors wholesale (mirrors the local generation path). - `NodeService::delete_embeddings(node_id)` — clear a node's vectors. Like the read wrappers, both are deliberately NOT behind the `nlp` feature: applying a received vector doesn't need the generation engine, so a daemon built without llama-cpp can still receive embeddings. Test: upsert a synthetic 768-dim vector via the wrapper, read it back via get_embeddings (round-trip), then delete and assert empty. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
APPROVE ⏳ Initial review, top commit on The symmetric write half of #1416, and just as clean. I checked the things that could bite a thin wrapper: ✅ Both delegate to real, ungated store methods. ✅ The "empty is a no-op" doc is actually true. I went to confirm it, expecting the usual unconditional ✅ Round-trip test exercises the real path — upsert a 768-dim vector via the wrapper, read it back through #1416's Good to merge. This lines up the core surface for PR 3b (the daemon pull: realtime/replay |
#1417) The Pro daemon's upcoming embedding PULL needs to apply vectors synced from another device into the local store, but `upsert_embeddings` / `delete_embeddings` were store-only (the read API from #1416 added reads; this adds the symmetric writes). Surface both as `NodeService` wrappers: - `NodeService::upsert_embeddings(node_id, Vec<NewEmbedding>)` — replace a node's vectors wholesale (mirrors the local generation path). - `NodeService::delete_embeddings(node_id)` — clear a node's vectors. Like the read wrappers, both are deliberately NOT behind the `nlp` feature: applying a received vector doesn't need the generation engine, so a daemon built without llama-cpp can still receive embeddings. Test: upsert a synthetic 768-dim vector via the wrapper, read it back via get_embeddings (round-trip), then delete and assert empty. Co-authored-by: Mayank Tomar <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
What
Core half of the pull slice of NodeSpaceAI/nodespace-sync#97. The push half (sync #178, merged) used the read API from #1416; the pull half needs to apply vectors synced from another device into the local store, but
upsert_embeddings/delete_embeddingswere store-only.Changes
NodeService::upsert_embeddings(node_id, Vec<NewEmbedding>)— replace a node's vectors wholesale (mirrors the local generation path; the symmetric write to Read-embeddings API for cloud push (core half of sync #97) #1416'sget_embeddings).NodeService::delete_embeddings(node_id)— clear a node's vectors (for a remote embeddings delete).Both are deliberately not gated behind
nlp, same rationale as the read wrappers: applying a received vector doesn't need the generation engine, so a daemon built without llama-cpp (sync #10) can still receive embeddings. Generation stays#[cfg(feature = "nlp")].Verification
get_embeddings(round-trip) → delete → assert empty.cargo test(new test green) +cargo clippy --libclean. Additive only.Part of NodeSpaceAI/nodespace-sync#97 (PR 3a; PR 3b = the daemon pull: realtime/replay
embeddings→ these wrappers, + the full two-daemon round-trip harness).