Repository navigation
Description
Summary
mnemon embed --status reports embedding_available: true — and recall proceeds as if semantic search were active — when the configured embedding model does not exist on the provider. The availability check only probes that the endpoint answers; it never verifies the model.
Consequence: recall's similarity signal is silently 0 for every query, with no warning anywhere. On Ollama this happens out of the box, because the default model is nomic-embed-text and most users have pulled a different embedding model (e.g. bge-m3).
Environment
- mnemon CLI 0.2.12 (Windows, amd64), commit
master - Ollama local at
http://localhost:11434 ollama listcontainsbge-m3:latestbut notnomic-embed-text- DB has 18 insights, all with stored embeddings (backfilled with
--embed-model bge-m3)
Steps to reproduce
$ mnemon embed --status
{"total_insights":18,"embedded":18,"coverage":"100%",
"embedding_available":true,"ollama_available":true,
"protocol":"ollama","model":"nomic-embed-text"}embedding_available: true — but the model named in the same output does not exist:
$ curl -s http://localhost:11434/api/embeddings -d '{"model":"nomic-embed-text","prompt":"x"}'
{"error":"model \"nomic-embed-text\" not found, try pulling it first"}Yet recall does not report anything:
$ mnemon recall "how do I expose a local server to my phone" --verbose
...
similarity 0.0000 <-- always 0, regardless of queryEvery hit is scored by keyword/entity/graph only. There is no error, no warning, and --status says everything is fine.
For comparison, the same query with the correct model:
$ mnemon recall "how do I expose a local server to my phone" --embed-model bge-m3 --verbose
#1 similarity 0.5888 score 0.582So the vector path is healthy — it was simply never reached, and nothing said so.
Root cause
1. The availability probe only checks the endpoint — cmd/memory/embed.go:48
available := ec.Available()
output := map[string]interface{}{
...
"embedding_available": available,
"ollama_available": available, // Backward-compatible alias.
"protocol": ec.Protocol(),
"model": ec.Model(), // <-- names a model that may not exist
}2. The code already knows the model may need pulling — but that branch is unreachable — cmd/memory/embed.go:62-64
if !ec.Available() {
if ec.Protocol() == embed.ProtocolOllama {
return fmt.Errorf("Ollama embedding provider not available at %s — install with: brew install ollama && ollama pull %s", ec.Endpoint(), ec.Model())
}
...
}Available() returns true as soon as the daemon answers, so when the daemon is up but the model is missing, this error — the one that would tell the user to run ollama pull — never fires. Execution falls through to ec.Embed(), which fails per-call instead.
3. recall swallows that per-call error — cmd/memory/recall.go:183-188
// Try to get query embedding for hybrid search
var queryVec []float64
ec := embed.NewClientWithModel(resolveEmbedModel())
if ec.Available() {
queryVec, _ = ec.Embed(keyword) // <-- error discarded; queryVec stays nil
}queryVec == nil then flows into search.IntentAwareRecallFrom(...), where the similarity signal contributes nothing. Silent downgrade to lexical-only.
Expected behavior
embedding_available should mean "a query can actually be embedded right now". At minimum:
embed --statusshould distinguish endpoint reachable from model usable — e.g. amodel_availablefield, or makeembedding_availablefalse when a probe embed fails.recallshould not discard theEmbederror silently. A one-line warning to stderr (recall: embedding unavailable (model "nomic-embed-text" not found), falling back to lexical scoring) would have made this self-diagnosing.
Suggested fixes (any of)
- In
--status, do one cheap probe embed (or call/api/tagsand check membership for the Ollama protocol) and report the real answer; keepollama_availableas a separate "daemon up" field. - Cache a tri-state client status (
unknown | ok | model-missing) on firstEmbedfailure, sorecallcan emit the warning once instead of per call. - Consider a better default model for the Ollama protocol, or at least surface the first failure prominently —
nomic-embed-textis not among the models mostollama pullusers end up with, so the default path is broken by default for them.
Notes
- Backfilling with
--all --embed-model bge-m3works and liftscoverageto 100% — the data side has no problem. This is purely a detection/reporting gap. - Related but distinct: feat(memory): support OpenAI-compatible embedding backends (e.g. SiliconFlow BAAI/bge-m3) #117 (OpenAI-compatible embedding backends) and Support Matryoshka dimension truncation for Ollama embeddings #4 (Matryoshka truncation).
Activity