feat(embed): add a replaceable local embedding provider#72
Merged
CodeAbra merged 1 commit intoJul 13, 2026
Merged
Conversation
42a65de to
c901f41
Compare
Owner
|
Thanks for the whole stack, #67 through #71 are all merged and shipped in v2.2.2. For #72: I rebased it locally and it comes out clean (the stacked deps drop away, only your provider commit lands), but GitHub still has the old branch state so it shows a conflict here. Could you rebase pr/configurable-embedder-provider onto the current main and push? Then I'll merge it right away, landing with your authorship. Nice design on the provider, the loopback-only URL check, strict response validation, and resumable zero-failure migration are exactly the right shape. |
c901f41 to
d4f9a53
Compare
Keep native BGE as the default while allowing a strict loopback HTTP provider, query/document roles, crash-safe resumable re-embedding, atomic table swaps, and stale-HNSW detection after model or dimension migrations. Designed by Marsu — Refined by Codex. Co-Authored-By: Codex <codex@openai.com>
d4f9a53 to
1c27de4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft / stacked PR
Do not merge before #67 through #71. This is the final feature PR in the stack, after the baseline, graph-integrity, and bounded-topology fixes. The GitHub diff includes dependency commits until those PRs land; it will then be rebased onto
mainso the review diff contains only the configurable-provider and migration work.Problem
IAE constructs the built-in English BGE model inside each process. Operators
cannot select a multilingual or domain-specific model without replacing the
native implementation, and changing model or dimension invalidates every
stored vector and ANN index.
Why this matters: French retrieval evidence
This work was motivated by a separate French-memory benchmark, not by an
assumption that IAE users already run Solon. Solon is a public, MIT-licensed
French embedding model family published by OrdalieTech; its model card requires
different query and passage handling, which is one reason the provider contract
distinguishes
queryfromdocumentinputs.The benchmark used 31 synthetic facts, 30 independent memory threads and 100
French questions, with no customer or personal data. Each model ranked the same
fact corpus by dense cosine similarity in the same warm Apple Silicon
environment:
BAAI/bge-small-en-v1.5OrdalieTech/Solon-embeddings-base-0.1OrdalieTech/Solon-embeddings-large-0.1On this corpus, Solon Large improved first-result recall by 31 percentage
points and Recall@5 by 25 points over IAE's built-in English BGE model. A
shared loopback service measured 24.0 ms p50 / 32.2 ms p95 for individual
queries, about 7 ms of median local HTTP overhead, 198.9 items/s for a batch of
100, and roughly 493 MiB of warm RSS. The external model is documented at
https://huggingface.co/OrdalieTech/Solon-embeddings-large-0.1.
These numbers are corpus-specific and do not argue for changing IAE's
default model to Solon. They demonstrate the practical value of letting users
choose a multilingual or domain-specific embedder while preserving native BGE
as the zero-configuration default. Solon is the validation model for this PR,
not a new dependency or a required deployment.
Solution
dimension, timeout, and strict response validation;
record and swaps only after an exact zero-failure count;
_hippo_meta.embed_dimone SQLite transaction;byte-for-byte;
SQLite, covering dimension changes and same-dimension model changes;
Security and compatibility
Only unauthenticated
httpURLs on127.0.0.1,localhost, or::1areaccepted. Credentials, query strings, fragments, and alternate paths are
rejected. Responses are capped at 32 MiB and must match the configured model,
dimension, vector count, numeric type, and finiteness. Existing users remain on
the native 384-dimensional backend unless they opt in.
Deliberate exclusions
The PR defines a generic local protocol; it does not vendor Solon,
sentence-transformers, model weights, or a model server into IAE. Operators own
the loopback service and must stop the daemon and back up the store before
migration.
Validation
preservation tests;
Recall@1/Recall@5 on 100 synthetic questions;
service, followed by HNSW rebuild and successful vector recall;
APPROVE, with no blocking code change;activation notes are captured in the local deployment runbook.
Designed by Marsu — Refined by Codex.
Public CI result
The final cumulative macOS correctness gate is fully green on
c901f41: 5,152 passed, 113 skipped, 107 deselected, and 4 xfailed across 5,375 collected tests in 1:15:51.The production universal2 wheel builds successfully, and the secret scan passes.