Goal
Add a configurable embedding provider to embedkit, defaulting to ollamakit.Client, with a deterministic FNV-1a hash fallback carrying its own model name — replacing the two independent implementations in symaira-seek and symaira-memory.
Why now
Both consumer repos implement the same fallback today: symaira-seek/internal/engine/embeddings.go wraps ollamakit.Embed with an FNV-1a fallback (local-hash); symaira-memory/internal/extractor/embeddings.go reimplements the same idea with a raw net/http client, bypassing ollamakit entirely. Consolidating removes one of the two duplicated code paths named in #74.
Current state / Evidence
symaira-seek/internal/engine/embeddings.go — ollamakit.Embed, FNV-1a fallback, localHashModelName, dimension autodetect
symaira-memory/internal/extractor/embeddings.go — own http.Client, FNV-1a fallback, DefaultDimensions = 768
In Scope
- Configurable provider (
ollamakit.Client as default), model name, target dimension
- Deterministic hash fallback with its own model name, returning
embedkit.Result (from the Result/SameSpace sub-issue)
- Tests asserting the hash fallback is deterministic (same input → same vector) and carries a distinct
Model value so SameSpace never conflates it with a real model's embeddings
Out of Scope
- Cache (separate sub-issue)
- Dimension pinning / renormalization (separate sub-issue)
- Migrating
symaira-seek / symaira-memory to use this package (their own issues)
Acceptance criteria
Risks / Dependencies
Part of #74. Depends on the Result/SameSpace sub-issue landing first (the provider returns embedkit.Result).
Goal
Add a configurable embedding provider to
embedkit, defaulting toollamakit.Client, with a deterministic FNV-1a hash fallback carrying its own model name — replacing the two independent implementations insymaira-seekandsymaira-memory.Why now
Both consumer repos implement the same fallback today:
symaira-seek/internal/engine/embeddings.gowrapsollamakit.Embedwith an FNV-1a fallback (local-hash);symaira-memory/internal/extractor/embeddings.goreimplements the same idea with a rawnet/httpclient, bypassingollamakitentirely. Consolidating removes one of the two duplicated code paths named in #74.Current state / Evidence
symaira-seek/internal/engine/embeddings.go—ollamakit.Embed, FNV-1a fallback,localHashModelName, dimension autodetectsymaira-memory/internal/extractor/embeddings.go— ownhttp.Client, FNV-1a fallback,DefaultDimensions = 768In Scope
ollamakit.Clientas default), model name, target dimensionembedkit.Result(from the Result/SameSpace sub-issue)Modelvalue soSameSpacenever conflates it with a real model's embeddingsOut of Scope
symaira-seek/symaira-memoryto use this package (their own issues)Acceptance criteria
ollamakit.Clientworks as the default with no consumer-side wiring beyond constructionmake testandmake lintgreen,CGO_ENABLED=0buildsRisks / Dependencies
Part of #74. Depends on the
Result/SameSpacesub-issue landing first (the provider returnsembedkit.Result).